public async Task <List <OrganizedTime> > Get(DateTime from, DateTime to) { var times = await _repository.Get(from, to); var result = new List <OrganizedTime>(); OrganizedTime last = null; foreach (var time in times) { if (time.Type == TimeType.Start) { last = new OrganizedTime { Start = time.Time }; result.Add(last); } else { if (last == null) { continue; } last.End = time.Time; } } return(result); }
public IList <TimeEntity> Get(Expression <Func <TimeEntity, bool> > predicate) { return(_repository.Get(predicate)); }