コード例 #1
0
 public IHttpActionResult GetAll()
 {
     try
     {
         List <Sp_GetProducts_Result> products = uow.GetProduct().ToList();
         if (products != null)
         {
             IEnumerable <ProductDto> productDtos = Mapper.Map <IEnumerable <ProductDto> >(products);
             return(Ok(productDtos));
         }
         else
         {
             return(Ok(new { status = false, message = "not found products" }));
         }
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }