示例#1
0
        public async Task <ActionResult <Day[]> > GetAllDays(int habitId)
        {
            try
            {
                var results = await _repository.GetAllDaysAsync(habitId);

                if (!results.Any())
                {
                    return(NotFound("No days found!"));
                }

                return(Ok(results));
            }
            catch (Exception ex)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
            }
        }