public async Task <ActionResult> AddStep(LogChecklistSteps step) { //get count var stepCount = _repo.GetStepCount(step); step.Step = (short)stepCount; _repo.Add(step); var history = FileHistory(step, "Draft", "Added a Step"); _repo.Add(history); await _repo.SaveAll(); return(CreatedAtRoute("GetStep", new { stepId = step.Idstep }, step)); }