public EventDTO Add(EventDTO eventToAdd) { Event newEvent = new Event(); newEvent.Update(eventToAdd); uow.EventRepo.Insert(newEvent); uow.Commit(); return DTOService.ToDTO<Event, EventDTO>(newEvent); }
public static void Update(this Event destination, EventDTO source) { destination.Description = source.Description; destination.EventDate = source.EventDate; destination.ResponsibleId = source.ResponsibleId; destination.CandidateId = source.CandidateId; destination.VacancyId = source.VacancyId; destination.EventTypeId = source.EventTypeId; }
public EventDTO Update(EventDTO eventToChange) { Event domainEvent = uow.EventRepo.GetByID(eventToChange.Id); domainEvent.Update(eventToChange); uow.EventRepo.Update(domainEvent); uow.Commit(); return DTOService.ToDTO<Event, EventDTO>(domainEvent); }