Пример #1
0
        public async Task <ActionResult <IEnumerable <TimesheetItem> > > List(string from, string to)
        {
            var sessionData = _sessionService.GetSession(HttpContext);

            if (sessionData == null)
            {
                return(Unauthorized());
            }

            DateTime fromDate = DateHelper.ParseDate(from, DateTime.MinValue);
            DateTime toDate   = DateHelper.ParseDate(to, DateTime.MaxValue);

            return(Ok(await _timesheetRepository.List(sessionData.UserId, fromDate, toDate)));
        }