예제 #1
0
        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);
        }
예제 #2
0
 public IList <TimeEntity> Get(Expression <Func <TimeEntity, bool> > predicate)
 {
     return(_repository.Get(predicate));
 }