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()); }
IEnumerable <object> IProviderInfoDescription.GetProviders(Type providerType, object criteria) { if (providerType == null) { throw new ArgumentNullException("providerType"); } return(ProviderData.GetProvidersUsingCriteria(providerType, criteria, t => t.GetValue())); }
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)); }
T IProviderInfoDescription.GetProvider <T>(object criteria) { return((T)ProviderData.GetProvidersUsingCriteria(typeof(T), criteria, t => t.GetValue()).FirstOrDefault()); }