public async Task UpdateEventByIDAsync(Logic.Objects.Event targetEvent) { Data.Entities.EventType oldContextEvent = await santaContext.EventTypes.FirstOrDefaultAsync(e => e.EventTypeId == targetEvent.eventTypeID); oldContextEvent.EventDescription = targetEvent.eventDescription; oldContextEvent.IsActive = targetEvent.active; santaContext.Update(oldContextEvent); }
public async Task DeleteEventByIDAsync(Guid eventID) { Data.Entities.EventType contextEvent = await santaContext.EventTypes.FirstOrDefaultAsync(e => e.EventTypeId == eventID); santaContext.EventTypes.Remove(contextEvent); }
public async Task CreateEventAsync(Logic.Objects.Event newEvent) { Data.Entities.EventType contextEvent = Mapper.MapEvent(newEvent); await santaContext.EventTypes.AddAsync(contextEvent); }