18 lines
470 B
C#
18 lines
470 B
C#
using Ardalis.Specification;
|
|
using BookHive.Models;
|
|
|
|
namespace BookHive.Specifications.Members;
|
|
|
|
public class GetMemberByIdSpec : SingleResultSpecification<Member>
|
|
{
|
|
public GetMemberByIdSpec(int memberId)
|
|
{
|
|
Query
|
|
.Include(x => x.Loans)!
|
|
.ThenInclude(x => x.Book)
|
|
.ThenInclude(a => a!.Author)
|
|
.Include(x => x.Reviews)!
|
|
.ThenInclude(x => x.Book)
|
|
.Where(x => x.Id == memberId);
|
|
}
|
|
} |