public async Task <IActionResult> PutInforLearner(int id, InforLearner inforLearner) { if (id != inforLearner.Id) { return(BadRequest()); } _context.Entry(inforLearner).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InforLearnerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <InforLearner> > PostInforLearner(InforLearner inforLearner) { inforLearner.Sex = true; inforLearner.Status = Status.Active; inforLearner.Birthday = DateTime.Now; _context.InforLearners.Add(inforLearner); await _context.SaveChangesAsync(); return(CreatedAtAction("GetInforLearner", new { id = inforLearner.Id }, inforLearner)); }