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();
 }
예제 #2
0
 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);
   }
 }