Beispiel #1
0
        public static T Resolve <T>([NotNull] this Container container, Tag tag, [NotNull][ItemCanBeNull] params object[] args)
        {
            var key = new Key(TypeDescriptor <T> .Type, tag);

            return(((Resolver <T>)container.Resolvers.Get(key.GetHashCode(), key)
                    ?? container.GetResolver <T>(TypeDescriptor <T> .Type, tag))(container, args));
        }
Beispiel #2
0
        public static T Resolve <T>([NotNull] this Container container, Tag tag)
        {
            var key = new Key(TypeDescriptor <T> .Type, tag);

            return(((Resolver <T>)container.Resolvers.Get(key.GetHashCode(), key)
                    ?? container.GetResolver <T>(TypeDescriptor <T> .Type, tag))(container, EmptyArgs));
        }
 public static T Resolve <T>([NotNull] this Container container, [NotNull] Type type) =>
 container.GetResolver <T>(type)(container, EmptyArgs);
 public static T Resolve <T>([NotNull] this Container container, Tag tag, [NotNull][ItemCanBeNull] params object[] args) =>
 container.GetResolver <T>(tag)(container, args);
 public static T Resolve <T>([NotNull] this Container container, Tag tag) =>
 container.GetResolver <T>(tag)(container, EmptyArgs);
Beispiel #6
0
 public static T Resolve <T>([NotNull] this Container container, [NotNull] Type type)
 {
     return(((Resolver <T>)container.ResolversByType.GetByRef(type.GetHashCode(), type)
             ?? container.GetResolver <T>(type))(container, EmptyArgs));
 }
Beispiel #7
0
 public static T Resolve <T>([NotNull] this Container container, [NotNull][ItemCanBeNull] params object[] args)
 {
     return(((Resolver <T>)container.ResolversByType.GetByRef(TypeDescriptor <T> .HashCode, TypeDescriptor <T> .Type)
             ?? container.GetResolver <T>(TypeDescriptor <T> .Type))(container, args));
 }
Beispiel #8
0
 public static T Resolve <T>([NotNull] this Container container)
 {
     return(((Resolver <T>)container.ResolversByType.GetByRef(TypeDescriptor <T> .HashCode, TypeDescriptor <T> .Type)
             ?? container.GetResolver <T>(TypeDescriptor <T> .Type))(container, EmptyArgs));
 }
Beispiel #9
0
 public static object Resolve <T>([NotNull] this Container container, [NotNull] Type type, [NotNull][ItemCanBeNull] params object[] args)
 {
     return(((Resolver <T>)container.ResolversByType.GetByRef(type.GetHashCode(), type)
             ?? container.GetResolver <T>(type))(container, args));
 }