public int StartProcedure(StartingProcedure startingProcedure) { var procedure = new Procedure { Id = context.Procedures.Count() == 0 ? 0 : context.Procedures.Max(x => x.Id) + 1, DateTime = DateTime.Now, Comments = startingProcedure.Comments, PatientId = startingProcedure.PatientId, UserId = startingProcedure.UserId, Status = "Active" }; this.context.Add(procedure); this.context.SaveChanges(); return(procedure.Id); }
public ActionResult <int> StartProcedure(StartingProcedure procedure) { var id = this.procedureService.StartProcedure(procedure); return(this.Ok(id)); }