fixed include errors
This commit is contained in:
@@ -8,6 +8,7 @@ public class GetAuthorByIdSpec : SingleResultSpecification<Author>
|
||||
public GetAuthorByIdSpec(int authorId)
|
||||
{
|
||||
Query
|
||||
.Include(x => x.Books)
|
||||
.Where(x => x.Id == authorId);
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ public class GetBookByIdSpec : SingleResultSpecification<Book>
|
||||
{
|
||||
Query
|
||||
.Include(x => x.Author)
|
||||
.Include(x => x.Reviews)!
|
||||
.ThenInclude(x => x.Member)
|
||||
.Where(x => x.Id == bookId);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,11 @@ 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);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ public class GetReviewByBookIdSpec : Specification<Review>
|
||||
public GetReviewByBookIdSpec(int bookId)
|
||||
{
|
||||
Query
|
||||
.Where(x => x.Id == bookId);
|
||||
.Include(x => x.Book)
|
||||
.Include(x => x.Member)
|
||||
.Where(x => x.BookId == bookId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user