MemberInfo IProviderInfoDescription.GetProviderMember(Type providerType, object criteria) { if (providerType == null) { throw new ArgumentNullException("providerType"); } if (criteria == null) { throw new ArgumentNullException("criteria"); } string s = criteria as string; if (s != null) { return(((IProviderInfoDescription)this).GetProviderMember(providerType, s)); } QualifiedName t = criteria as QualifiedName; if (t != null) { return(((IProviderInfoDescription)this).GetProviderMember(providerType, t)); } return(ProviderData.GetProvidersUsingCriteria(providerType, criteria, u => u.Member) .SingleOrThrow(RuntimeFailure.MultipleProviders)); }
object IProviderInfoDescription.GetProvider(Type providerType, object criteria) { if (providerType == null) { throw new ArgumentNullException("providerType"); } if (criteria == null) { throw new ArgumentNullException("criteria"); } string s = criteria as string; if (s != null) { return(((IProviderInfoDescription)this).GetProvider(providerType, s)); } QualifiedName t = criteria as QualifiedName; if (t != null) { return(((IProviderInfoDescription)this).GetProvider(providerType, t)); } return(ProviderData.GetProvidersUsingCriteria(providerType, criteria, u => u.GetValue()).FirstOrDefault()); }
object IProviderInfoDescription.GetProvider(Type providerType, QualifiedName name) { if (providerType == null) { throw new ArgumentNullException("providerType"); } return(ProviderData.GetProvider(providerType, name, t => t.GetValue())); }
ProviderInfo IProviderInfoDescription.GetProviderInfo(Type type, QualifiedName name) { if (name == null) { throw new ArgumentNullException("name"); } return(ProviderData.GetProvider(type, name, t => t)); }
IEnumerable <object> IProviderInfoDescription.GetProviders(Type providerType, object criteria) { if (providerType == null) { throw new ArgumentNullException("providerType"); } return(ProviderData.GetProvidersUsingCriteria(providerType, criteria, t => t.GetValue())); }
IEnumerable <QualifiedName> IProviderInfoDescription.GetProviderNames(Type providerType) { if (providerType == null) { throw new ArgumentNullException("providerType"); } return(ProviderData.GetProviderNames(providerType)); }
object IProviderInfoDescription.GetProvider(Type providerType, string name) { if (providerType == null) { throw new ArgumentNullException("providerType"); } return(ProviderData.GetProvidersByLocalName(providerType, name, t => t.GetValue()).SingleOrThrow(RuntimeFailure.MultipleProviders)); }
IEnumerable <object> IProviderInfoDescription.GetProviders(Type providerType) { if (providerType == null) { throw new ArgumentNullException("providerType"); } return(ProviderData.GetProviders(providerType)); }
ProviderInfo IProviderInfoDescription.GetProviderInfo(Type type, string name) { if (string.IsNullOrEmpty(name)) { throw Failure.NullOrEmptyString(nameof(name)); } return(ProviderData.GetProvidersByLocalName( type, name, t => t).SingleOrThrow(RuntimeFailure.MultipleProviders)); }
ProviderInfo IProviderInfoDescription.GetProviderInfo(Type type, object criteria) { if (criteria == null) { throw new ArgumentNullException("criteria"); } var them = ProviderData.GetProvidersUsingCriteria( type, criteria, t => t).ToList(); return(them.SingleOrThrow(RuntimeFailure.MultipleProviders)); }
public static T FromProvider <T>(string name, IEnumerable <KeyValuePair <string, object> > values = null, IServiceProvider serviceProvider = null) { if (string.IsNullOrEmpty(name)) { throw Failure.NullOrEmptyString(nameof(name)); } return((T)ProviderData.GetProvidersByLocalName(typeof(T), name, t => t.Activate(values, serviceProvider)) .SingleOrThrow(RuntimeFailure.MultipleProviders)); }
QualifiedName IProviderInfoDescription.GetProviderName(Type providerType, object instance) { if (providerType == null) { throw new ArgumentNullException("providerType"); } if (instance == null) { throw new ArgumentNullException("instance"); } return(ProviderData.GetProviderMetadata(providerType, t => t.PreciseMatch(instance), t => t.Name)); }
IEnumerable <QualifiedName> IProviderInfoDescription.GetProviderNames(Type providerType, object instance) { if (providerType == null) { throw new ArgumentNullException("providerType"); } if (instance == null) { throw new ArgumentNullException("instance"); } return(ProviderData.GetProviderMetadataMany(providerType, t => t.PreciseMatch(instance), t => t.Names) .SelectMany(t => t)); }
IEnumerable <ProviderInfo> IProviderInfoDescription.GetProviderInfos(Type providerType) { return(ProviderData.GetProviders(providerType, t => t)); }
IEnumerable <T> IProviderInfoDescription.GetProviders <T>() { return(ProviderData.GetProviders(typeof(T)).Cast <T>()); }
IEnumerable <Type> IProviderInfoDescription.GetProviderTypes() { return(ProviderData.GetAllProviderRootTypes()); }
IEnumerable <Type> IProviderInfoDescription.GetProviderTypes(Type providerType) { return(ProviderData.GetProviderTypes(providerType)); }
T IProviderInfoDescription.GetProvider <T>(string name) { return((T)ProviderData.GetProvidersByLocalName( typeof(T), name, t => t.GetValue()).SingleOrThrow(RuntimeFailure.MultipleProviders)); }
Type IProviderInfoDescription.GetProviderType(Type providerType, string name) { return(ProviderData.GetProvidersByLocalName(providerType, name, t => t.ValueType).SingleOrThrow(RuntimeFailure.MultipleProviders)); }
Type IProviderInfoDescription.GetProviderType(Type providerType, QualifiedName name) { return(ProviderData.GetProviderType(providerType, name)); }
T IProviderInfoDescription.GetProvider <T>(QualifiedName name) { return((T)ProviderData.GetProvider(typeof(T), name, t => t.GetValue())); }
T IProviderInfoDescription.GetProvider <T>(object criteria) { return((T)ProviderData.GetProvidersUsingCriteria(typeof(T), criteria, t => t.GetValue()).FirstOrDefault()); }
MemberInfo IProviderInfoDescription.GetProviderMember(Type providerType, QualifiedName name) { return(ProviderData.GetProvider(providerType, name, t => t.Member)); }