public static IdentityProviderSourceType FromValue(string value) { foreach (IdentityProviderSourceType providerSourceType in IdentityProviderSourceType.Values()) { if (providerSourceType.Value().Equals(value)) { return(providerSourceType); } } throw new ArgumentException(value.ToString()); }
public static List <IdentityProviderSourceType> Values() { IdentityProviderSourceType providerSourceType = new IdentityProviderSourceType(); List <IdentityProviderSourceType> providerSourceTypeList = new List <IdentityProviderSourceType>(); foreach (FieldInfo field in providerSourceType.GetType().GetFields()) { providerSourceTypeList.Add((IdentityProviderSourceType)field.GetValue((object)providerSourceType)); } return(providerSourceTypeList); }