public async Task <SemiproductResponse> CreateAsync(Semiproduct semiproduct)
 {
     try
     {
         return(new SemiproductResponse(_context.Semiproducts
                                        .FromSqlRaw("EXEC dbo.CreateSemiproduct {0}, {1}", semiproduct.Name, semiproduct.Description)
                                        .AsEnumerable()
                                        .FirstOrDefault()));
     }
     catch (SqlException exception)
     {
         var messages = HandlingError(exception);
         return(new SemiproductResponse(messages));
     }
     catch (Exception exception)
     {
         throw;
     }
 }
Exemplo n.º 2
0
 public async Task <SemiproductResponse> UpdateAsync(Semiproduct semiproduct)
 {
     return(await _semiproducts.UpdateAsync(semiproduct));
 }