Example #1
0
 internal static string ConstructorResolutionBehaviorReturnedNull(
     IConstructorResolutionBehavior selectionBehavior, Type serviceType, Type implementationType)
 {
     return(string.Format(CultureInfo.InvariantCulture,
                          "The {0} that was registered through Container.Options.ConstructorResolutionBehavior " +
                          "returned a null reference after its GetConstructor(Type, Type) method was " +
                          "supplied with values '{1}' for serviceType and '{2}' for implementationType. " +
                          "{3}.GetConstructor implementations should never return null, but should throw " +
                          "a {4} with an expressive message instead.",
                          selectionBehavior.GetType().ToFriendlyName(),
                          serviceType.ToFriendlyName(),
                          implementationType.ToFriendlyName(),
                          typeof(IConstructorResolutionBehavior).Name,
                          typeof(ActivationException).FullName));
 }
 internal static string ConstructorResolutionBehaviorReturnedNull(
     IConstructorResolutionBehavior selectionBehavior, Type serviceType, Type implementationType) => 
     string.Format(CultureInfo.InvariantCulture,
         "The {0} that was registered through Container.{5}.{6} returned a null reference after " +
         "its {7}(Type, Type) method was supplied with values '{1}' for serviceType and '{2}' for " +
         "implementationType. {3}.{7} implementations should never return null, but should throw " +
         "a {4} with an expressive message instead.",
         selectionBehavior.GetType().ToFriendlyName(),
         serviceType.ToFriendlyName(),
         implementationType.ToFriendlyName(),
         nameof(IConstructorResolutionBehavior),
         typeof(ActivationException).FullName,
         nameof(Container.Options),
         nameof(ContainerOptions.ConstructorResolutionBehavior),
         nameof(IConstructorResolutionBehavior.GetConstructor));