public void GetPlansById_ReturnsSingle() { var plan = _planRepository.Get(1); Assert.IsAssignableFrom <IQueryable <PlanEntity> >(plan); Assert.NotEmpty(plan); Assert.NotNull(plan.SingleOrDefault()); Assert.True(plan.SingleOrDefault()?.IsActive); }
public IList <PlanDto> GetByDate(DateTime planDate) { planDate = planDate.Date; //SixMan.ChiMa.Domain.Family.Family family = _familyService.GetOrCreate(); IList <Plan> list = _repository.Get(planDate, Family.Id); if (list.Count() < 1) //没有计划,需加入计划并生成一个新的内容,如已计划请返回原有数据 { IList <Plan> newPlans = _plansGenerator.BuildPlans(planDate, Family); SaveList(newPlans); list = _repository.Get(planDate, Family.Id); } return(list.Select(MapToEntityDto).ToList()); }
public async Task <PlanView> GetPlanByIdAsync(int planId) { var result = _planRepository.Get(planId); var items = result.Where(p => p.IsActive); var item = await items.ProjectToPlanView().FirstOrDefaultAsync(); return(item); }
public Plan Get(Guid id) { return(_planRepository.Get(id)); }
//public List<Plan> Get(FilterPlan filter) //{ // var results = _planRepository.Get(filter); // //var result = new PagedList1<Plan>(pagedList.Datas, pagedList.Pagination); // return results; //} public List <Plan> GetPlanTable(FilterPlan filter) { var datas = _planRepository.Get(filter); return(datas); }
public Plan Get(int id) { return(planRepository.Get(id)); }