public void AddDropDown(DropDownBase model) { if (String.IsNullOrEmpty(model.Id)) { model.GenerateId(); } Add <DropDownBase>(model, model.GetType().Name, out var response); }
public static DropDownPostModel ConvertToPassingModel(this DropDownBase input) { var result = new DropDownPostModel(); var resultProperty = result.GetType().GetProperties().Where(b => b.BaseProperty()).ToList(); var properties = input.GetType().GetProperties(); foreach (var p in properties) { if (p.BaseProperty()) { var baseP = resultProperty.Where(b => b.Name == p.Name).FirstOrDefault(); baseP.SetValue(result, p.GetValue(input)); continue; } if (p.SkippedProperty()) { continue; } result.Properties.Add(p.GetContentPropertyByPropertyInfo(input)); } return(result); }
public void RemoveDropDown(DropDownBase model) { Remove <DropDownBase>(model, model.GetType().Name, model.Id); }
public void UpdateDropDown(DropDownBase model, IEnumerable <string> ignoreKeys = null, IEnumerable <string> takeKeys = null) { Update <DropDownBase>(model, model.Id, model.GetType().Name, ignoreKeys, takeKeys, out var response); }