public void EditContentMenu(EditContentMenuCommand command) { var contentMenu = _contentMenuService.Find(command.ContentMenuId); contentMenu.Description = command.Description; contentMenu.Image = command.Image; contentMenu.MetaDescription = command.MetaDescription; contentMenu.MetaKeywork = command.MetaKeywork; contentMenu.Title = command.Title; _contentMenuService.Update(contentMenu); _unitOfWork.SaveChanges(); }
private void Save(ContentMenuModel model) { if (model.ContentMenuId == Guid.Empty) { var createCommand = new AddContentMenuCommand(model.Title, model.Image, model.MetaKeywork, model.MetaDescription, model.Description); model.ContentMenuId = _contentMenuCommandService.AddContentMenu(createCommand); } else { var updateCommand = new EditContentMenuCommand(model.ContentMenuId, model.Title, model.Image, model.MetaKeywork, model.MetaDescription, model.Description); _contentMenuCommandService.EditContentMenu(updateCommand); } }