Example #1
0
 public IActionResult Post([FromBody] StoreDto storedto)
 {
     try
     {
         provider.Create(storedto.toDao());
         return(Ok("Store created succsessfully."));
     }
     catch (Exception e)
     {
         return(BadRequest($"ERROR: {e.Message}"));
     }
 }
Example #2
0
 public IActionResult Put(int id, [FromBody] StoreDto dto)
 {
     try
     {
         provider.Update(dto.toDao());
         return(Ok("Store updated successfully!"));
     }
     catch (Exception e)
     {
         return(BadRequest($"ERROR: {e.Message}"));
     }
 }