public IEnumerable <OrderModel> GetWeekOrders(DateTime date, string userId) { var orders = new List <OrderModel>(); var sundayDate = DateService.GetSundayOfWeek(date); for (int i = 1; i < 6; i++) { var dayDate = sundayDate.AddDays(i); AddMenuIfDontExistInThisDate(dayDate); var order = GetOrderByDate(dayDate, userId); orders.Add(order); } return(orders); }
public IEnumerable <MenuModel> GetWeekMenu(DateTime date) { var menus = new List <MenuModel>(); var sundayDate = DateService.GetSundayOfWeek(date); for (int i = 1; i < 6; i++) { var dayDate = sundayDate.AddDays(i); AddMenuIfDontExistInThisDate(dayDate); var menu = GetMenuByDate(dayDate); menus.Add(menu); } return(menus); }