public async Task <OtherCostsForArticle> AddOtherCostsForArticle(OtherCostsForArticle otherCost) { var result = await _context.OtherCostsForArticles.AddAsync(otherCost); await _context.SaveChangesAsync(); return(result.Entity); }
public async Task <OtherCostsForArticle> UpdateOtherCostsForArticle(OtherCostsForArticle otherCost) { var result = await _context.OtherCostsForArticles.FirstOrDefaultAsync(s => s.Id == otherCost.Id); if (result != null) { result.Amount = otherCost.Amount; result.InformCostType = otherCost.InformCostType; await _context.SaveChangesAsync(); return(result); } return(null); }