Пример #1
0
        public async Task <IActionResult> getOrderThreeMonth()
        {
            var list = await _hoadonRepo.getOrderThreeMonthAgoAndNow();

            if (list == null || list.Count() == 0)
            {
                return(NotFound());
            }

            var dtoList = _mapper.Map <List <HoaDonDTO> >(list);

            var returnList = JsonConvert.SerializeObject(dtoList, Formatting.Indented,
                                                         new JsonSerializerSettings
            {
                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
            });

            return(Ok(returnList));
        }