Exemplo n.º 1
0
        private bool UserHasExceededLendingLength(LibraryItem item, User user, DateTime date)
        {
            bool result      = false;
            var  lending     = user.Lendings.Where(l => l.Item.ID == item.ID).Single();
            var  elapsedDays = (date - lending.LendingDate).Days;

            if (elapsedDays > item.DaysToLend())
            {
                result = true;
            }
            return(result);
        }