public async Task StartedEditAsync(StartedScalemodelBindingModel scalemodel, int modelId, string userId) { var model = DbContext.StartedScalemodels.Find(modelId); if (model.Number != scalemodel.Number) { await UpdateNumbersFromEdit(model.Number, scalemodel.Number); model.Number = scalemodel.Number; } Mapper.Map(scalemodel, model); model.OwnerId = userId; DbContext.StartedScalemodels.Update(model); await this.DbContext.SaveChangesAsync(); }
public async Task <IActionResult> StartedEdit(int id, StartedScalemodelBindingModel model) { await _startedScalemodelsService.StartedEditAsync(model, id, _currentUser.GetUserId(User)); return(RedirectToAction("AllStarted")); }