public static object Resolve(this IDependencyResolver resolver, Type type, UnregisteredAction unregisteredBehavior) { if (unregisteredBehavior == UnregisteredAction.AddAsTransient && !resolver.HasDependency(type)) { resolver.AddDependency(type, DependencyLifetime.Transient); } return(resolver.Resolve(type)); }
public static T Resolve <T>(this IDependencyResolver resolver, UnregisteredAction unregistered) where T : class { return((T)resolver.Resolve(typeof(T), unregistered)); }