public ActionResult Create() { var menuItemEditModel = new MenuItemEditModel { RouteID = RouteID }; return(View(menuItemEditModel)); }
public async Task <ServiceResult> Edit(Guid id, [FromBody] MenuItemEditModel apiEntity) { var entity = MenuItemEditModel.Map(apiEntity, id); var result = await _menuItemService.UpdateAsync(entity); if (result.TryCastModel(out MenuItem menuItem)) { result.ViewModel = MenuItemViewModel.Map(menuItem); } return(result); }