public IntakeFormModel Create(IntakeFormModel intakeFormModel) { var intakeForm = new IntakeForm(); intakeForm.MapFromModel(intakeFormModel); intakeForm.Status = IntakeFormStatus.New; _context.IntakeForm.Add(intakeForm); _context.SaveChanges(); return(intakeForm.ToModel()); }
public IntakeFormModel Update(IntakeFormModel intakeFormModel) { IntakeForm intakeForm = _context.IntakeForm .Include(i => i.Signatures) .Include("Questions.Answers") .First(u => u.IntakeFormId == intakeFormModel.IntakeFormId); intakeForm.MapFromModel(intakeFormModel); _context.SaveChanges(); return(intakeForm.ToModel()); }