public ListOfValue AddLov(string value, string parentValue) { if (string.IsNullOrEmpty(value.Trim())) { return(null); } if (ActiveListOfValues.Any(val => val.Equals(value))) { var lov = ListOfValues.FirstOrDefault(a => a.Active && a.Value.ToLower().Trim() == value.ToLower().Trim()); if (lov == null) { return(null); } if (lov.ParentValue.Trim().ToLower() != parentValue.Trim().ToLower()) { lov.ParentValue = parentValue; return(lov); } return(lov); } var listOfValue = new ListOfValue { Value = value, ParentValue = parentValue }; ListOfValues.Add(listOfValue); return(listOfValue); }
public ListOfValue AddLov(string value) { if (ActiveListOfValues.Any(val => val.Equals(value))) { return(null); } var listOfValue = new ListOfValue { Value = value }; ListOfValues.Add(listOfValue); return(listOfValue); }