示例#1
0
        public async Task <HoursOfOperation> CreateDefault(User user)
        {
            var hours = HoursOfOperation.Create(
                user.Id
                );

            await repo.Add(hours);

            return(hours);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
 public async Task Delete(HoursOfOperation hours) => await repo.Delete(hours);