示例#1
0
 public async Task <IActionResult> GetSearch([FromBody] filterProduct objFilter)
 {
     try
     {
         return(Ok(await _objModule.search(objFilter)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message.ConvertExceptionToErrorInfo()));
     }
 }
示例#2
0
        public async Task <IQueryable <vwProductModel> > search(filterProduct objFilter)
        {
            try
            {
                string sql = string.Format("exec mas_product_search {0} ,'{1}', '{2}'"
                                           , objFilter.product_id == null ? "null" : objFilter.product_id.ToString()
                                           , objFilter.product_name
                                           , objFilter.status
                                           );


                return(UnitOfWork.Context.Query <vwProductModel>().FromSql(sql));
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
            }
        }