public void EditSlider(EditSliderCommand command) { var data = _sliderService.Find(command.SliderId); data.Name = command.Name; data.Description = command.Description; data.Type = 1; data.ImageURL = command.ImageUrl; _sliderService.Update(data); _unitOfWork.SaveChanges(); }
private void Save(SliderModel model) { if (model.SliderId == Guid.Empty) { var createCommand = new AddSliderCommand(model.Name,model.Description,model.ImageURL); model.SliderId = _sliderCommandService.AddSlider(createCommand); } else { var updateCommand = new EditSliderCommand(model.SliderId, model.Name, model.Description, model.ImageURL); _sliderCommandService.EditSlider(updateCommand); } }