private static T parse <T, K>(K value, string description, Func <T, bool> predicate) where T : Enumerador <Tkey, Tvalue>, new() { var matchingItem = Enumerador <Tkey, Tvalue> .GetAll <T>().FirstOrDefault(predicate); if (matchingItem == null) { var message = string.Format("'{0}' is not a valid {1} in {2}", value, description, typeof(T)); throw new ApplicationException(message); } return(matchingItem); }
public override bool Equals(object obj) { Enumerador <Tkey, Tvalue> otherValue = obj as Enumerador <Tkey, Tvalue>; if (otherValue == null) { return(false); } var typeMatches = GetType().Equals(obj.GetType()); var valueMatches = _value.Equals(otherValue.Value); return(typeMatches && valueMatches); }
public static IEnumerable <Restricciones> Lista() { return(Enumerador.GetAll <Restricciones>()); }
public static IEnumerable <TiposBaseXsd> Lista() { return(Enumerador.GetAll <TiposBaseXsd>()); }