Example #1
0
        public IObservable <List <ITimeEntry> > GetAll(DateTimeOffset start, DateTimeOffset end)
        {
            if (start > end)
            {
                throw new InvalidOperationException($"Start date ({start}) must be earlier than the end date ({end}).");
            }

            return(CreateListObservable <TimeEntry, ITimeEntry>(endPoints.GetBetween(start, end), AuthHeader)
                   .Select(timeEntries => timeEntries ?? new List <ITimeEntry>()));
        }
Example #2
0
        public Task <List <ITimeEntry> > GetAll(DateTimeOffset start, DateTimeOffset end)
        {
            if (start > end)
            {
                throw new InvalidOperationException($"Start date ({start}) must be earlier than the end date ({end}).");
            }

            return(SendRequest <TimeEntry, ITimeEntry>(endPoints.GetBetween(start, end), AuthHeader)
                   .ContinueWith(t => t.Result ?? new List <ITimeEntry>()));
        }