public void CreateEvent(Contracts.Event newEvent) { try { var eventEntity = Mapper.Map <Contracts.Event, Event>(newEvent); _VaODbContext.Add(eventEntity); SaveChanges(); } catch { throw; } }
public void UpdateEvent(Contracts.Event updatingEvent) { if (updatingEvent == null) { throw new Exception("Updating Event is null"); } try { var oldEvent = GetEventEntity(updatingEvent.IdEvent); Mapper.Map(updatingEvent, oldEvent); SaveChanges(); } catch { throw; } }