public async Task <IActionResult> Edit(Guid id, [Bind("Id,UserId,BillingRate,Date,UpdatedAt")] BillingRateModel billingRateModel) { if (id != billingRateModel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(billingRateModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BillingRateModelExists(billingRateModel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(billingRateModel)); }
public async Task <IActionResult> Create([Bind("Id,UserId,BillingRate,Date,UpdatedAt")] BillingRateModel billingRateModel) { if (ModelState.IsValid) { billingRateModel.Id = Guid.NewGuid(); _context.Add(billingRateModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(billingRateModel)); }