Skip to content

Commit

Permalink
fixed: #331
Browse files Browse the repository at this point in the history
  • Loading branch information
maximv committed Oct 12, 2020
1 parent fd58b60 commit a586b1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DryIoc/Container.cs
Expand Up @@ -300,16 +300,16 @@ public void Unregister(Type serviceType, object serviceKey, FactoryType factoryT
/// <summary>
/// Resolves service with the <see cref="IfUnresolved.ReturnDefaultIfNotRegistered"/> policy,
/// enabling the fallback resolution for not registered services (default MS convention).
/// But you may set the global rule <see cref="DryIoc.Rules.ServiceProviderGetServiceShouldThrowIfUnresolved"/> to alter the behavior.
/// It may help to highlight the issues by throwing the original rich DryIoc exception instead of just returning the `null`.
/// For diagnostics reasons, you may globally set the rule <see cref="DryIoc.Rules.ServiceProviderGetServiceShouldThrowIfUnresolved"/> to alter the behavior.
/// It may help to highlight the issues by throwing the original rich <see cref="ContainerException"/> instead of just returning the `null`.
/// </summary>
object IServiceProvider.GetService(Type serviceType) =>
((IResolver)this).Resolve(serviceType,
Rules.ServiceProviderGetServiceShouldThrowIfUnresolved ? IfUnresolved.Throw : IfUnresolved.ReturnDefaultIfNotRegistered);

/// <summary>
/// Resolves service with <see cref="IfUnresolved.Throw"/> policy
/// throwing the specific <see cref="ContainerException"/> if not resolved
/// throwing the specific <see cref="ContainerException"/> if not resolved.
/// </summary>
public object GetRequiredService(Type serviceType) =>
((IResolver)this).Resolve(serviceType, IfUnresolved.Throw);
Expand Down

0 comments on commit a586b1e

Please sign in to comment.