Example #1
0
        public ActionResult ExpiringThisMonth()
        {
            var firstDayOfMonth = DateTimeExtensions.CalculateFirstDayOfThisMonth();
            var lastDayOfMonth  = DateTimeExtensions.CalculateLastDayOfThisMonth(firstDayOfMonth);

            var query = new RentalQuery {
                StartDate = firstDayOfMonth, EndDate = lastDayOfMonth
            };
            var expiringRentals = _unitOfWork.Rentals.GetRentals(query);

            var viewModel = Mapper.Map <IEnumerable <Rental>, List <RentalListViewModel> >(expiringRentals);

            return(View(viewModel));
        }