public async Task <ActionResult> Edit(string id, Train collection) { if (!ModelState.IsValid) { return(View(collection)); } _trainService.Save(id, collection); await _unitOfWork.CommitAsync(); return(new EditSuccessResult(id)); }