public void EditWebSiteLink(EditWebSiteLinkCommand command) { var webSiteLink = _webSiteLinkService.Find(command.WebSiteLinkId); webSiteLink.Name = command.Name; webSiteLink.Link = command.Link; webSiteLink.ImageUrl = command.ImageUrl; _webSiteLinkService.Update(webSiteLink); _unitOfWork.SaveChanges(); }
private void Save(WebSiteLinkModel model) { if (model.WebSiteLinkId == Guid.Empty) { var createCommand = new AddWebSiteLinkCommand(model.Name,model.Link,model.ImageUrl); model.WebSiteLinkId = _webSiteLinkCommandService.AddWebSiteLink(createCommand); } else { var updateCommand = new EditWebSiteLinkCommand(model.WebSiteLinkId, model.Name, model.Link, model.ImageUrl); _webSiteLinkCommandService.EditWebSiteLink(updateCommand); } }