public IActionResult PutApplyForSecondaryCustomer(long id, ApplyForSecondaryCustomer applyForSecondaryCustomer) { if (id != applyForSecondaryCustomer.Id) { return(BadRequest()); } applyForSecondaryCustomer.LastUpdatedDateTime = DateTime.Now; _context.Entry(applyForSecondaryCustomer).State = EntityState.Modified; try { _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplyForSecondaryCustomerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult <ApplyForSecondaryCustomer> PostApplyForSecondaryCustomer(ApplyForSecondaryCustomer applyForSecondaryCustomer) { applyForSecondaryCustomer.CreatedDateTime = DateTime.Now; applyForSecondaryCustomer.LastUpdatedDateTime = DateTime.Now; _context.ApplyForSecondaryCustomer.Add(applyForSecondaryCustomer); _context.SaveChangesAsync(); return(applyForSecondaryCustomer); }