public virtual IGenericWebApiResult Dropdown([FromBody] string term) { try { using (var result = new GenericWebApiResult <T>()) { result.Dropdown = repo.Dropdown(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); } } }