/// <summary> /// Add multiple shifts to the database /// </summary> /// <param name="shifts"></param> /// <returns>A task of a list of shifts added to the database</returns> public Task <List <Shift> > AddShiftsAsync(List <Shift> shifts) { if (shifts == null || shifts.Count == 0) { return(Task.FromResult <List <Shift> >(null)); } foreach (Shift shift in shifts) { if (shift.Id == Guid.Empty) { shift.SetKey(Guid.NewGuid()); } shift.LastEditDate = DateTime.UtcNow; shift.Task = null; shift.Project = null; EntitySet.AddAsync(shift); } return(Task.FromResult(shifts)); }
public async Task PostAsync(Models.ExampleContextModels.Example example) { await EntitySet.AddAsync(example); }
public async Task InsertExampleAsync(Models.Test.Example example) { await EntitySet.AddAsync(example); }