public IActionResult Load(long id) { var result = _transactionTypeService.GetById(id); var model = new UpdateViewModel() { Id = id, Options = BuildTypes() }; if (result.HasErrors()) { model.Message = result.GetFailure(); return(View(model)); } var transactionType = result.GetPayload(); model.Name = transactionType.Name; model.Type = transactionType.Credit ? "C" : "D"; return(View(model)); }