public async Task <IActionResult> search([FromBody] filterUser objFilter) { try { return(Ok(await _objModule.search(objFilter))); } catch (Exception e) { return(BadRequest(e.Message.ConvertExceptionToErrorInfo())); } }
public async Task <IQueryable <vwUserModel> > search(filterUser objFilter) { try { string sql = string.Format("exec mas_User_search {0} , '{1}' , '{2}' ", objFilter.user_id == null ? "null" : objFilter.user_id.ToString(), objFilter.User_name == null ? "" : objFilter.User_name.ToString(), string.IsNullOrEmpty(objFilter.status) ? "" : objFilter.status); return(UnitOfWork.Context.Query <vwUserModel>().FromSql(sql)); } catch (Exception ex) { throw new Exception(ex.Message); } finally { } }