/// <summary> /// Instances the entity from its definition stored in custom attribute /// </summary> /// <param name="attribute"></param> /// <exception cref="System.ArgumentException">Thrown if one of the params is null</exception> internal static Option FromLOVAttribute(LOVOptionDefinitionAttribute attribute) { var opt = MapFromAttribute(attribute); attribute.AvailableValues.ForEach(x => opt.AvailableValues.Add(x)); return(opt); }
/// <summary> /// Instances the entity from its definition stored in custom attribute /// </summary> /// <param name="attribute"></param> /// <exception cref="System.ArgumentException">Thrown if one of the params is null</exception> internal static Option FromAttribute(OptionDefinitionAttribute attribute) { var opt = MapFromAttribute(attribute); // check type LOVOptionDefinitionAttribute lovAttr = attribute as LOVOptionDefinitionAttribute; if (lovAttr != null) { return(FromLOVAttribute((LOVOptionDefinitionAttribute)attribute)); } return(opt); }