public void Create(EventServiceDto eventService) { if (eventService == null) { throw new ArgumentNullException(nameof(EventServiceDto)); } repository.Add(new DataLayer.Entities.EventService().InjectFrom(eventService) as DataLayer.Entities.EventService); unit.Commit(); }
public void Update(EventServiceDto eventService) { if (eventService == null) { throw new ArgumentNullException(nameof(EventServiceDto)); } var eventServiceEntity = repository.GetById(eventService.Id).InjectFrom(eventService) as DataLayer.Entities.EventService; if (eventServiceEntity == null) { throw new Exception($"Cannot update eventService package with id = {eventService.Id}"); } repository.Update(eventServiceEntity); unit.Commit(); }