public int?Convert(string source, ResolutionContext context) { InformationSourceType sourceType = Enumeration.GetAll <InformationSourceType>().FirstOrDefault(m => m.Name.Equals(source, StringComparison.OrdinalIgnoreCase)); return((sourceType == null) ? InformationSourceType.Other.Value : sourceType.Value); }
public string Convert(int?source, ResolutionContext context) { InformationSourceType sourceType = Enumeration.GetAll <InformationSourceType>().FirstOrDefault(m => m.Value == source); return((sourceType == null) ? InformationSourceType.Other.Name : sourceType.Name); }