public virtual IGenericWebApiResult DropdownByKey([FromBody] string term) { try { using (var result = new GenericWebApiResult <T>()) { result.Dropdown = repo.DropdownByKey(new T(), term); result.Success = true; return(result); } } catch (Exception ex) { using (var result = new GenericWebApiResult <T>(ex)) { result.Success = false; dynamic more = new ExpandoObject(); more.Errors = ex.Message; result.More = more; result.Dropdown = new List <Dropdown>(); return(result); } } }