public async Task <HoursOfOperation> CreateDefault(User user) { var hours = HoursOfOperation.Create( user.Id ); await repo.Add(hours); return(hours); }
public async Task Update(HoursOfOperation hours, HoursOfOperationUpdate update) { hours.Days = update.Days.Select(d => HoursOfOperationDay.Create( d.Day, d.Open, d.Open, d.Enabled )).ToList(); await repo.Update(hours); }
public async Task <HoursOfOperation> GetOrCreateForUser(User user) { var hours = await repo.FindForUser(user); if (hours == null) { hours = HoursOfOperation.Create(user.Id); await repo.Add(hours); } return(hours); }
public async Task Delete(HoursOfOperation hours) => await repo.Delete(hours);