예제 #1
0
        public async Task <IEnumerable <Loan> > GetLoansOfUserAsync(int userId)
        {
            var spec = new Specification <Loan>(x => x.LoanUsers.FirstOrDefault(y => y.UserId == userId) != null);

            spec.Includes.Add(x => x.LoanUsers);

            IEnumerable <Loan> loans = await _loanRepo.FindAllAsync(spec);

            return(loans);
        }