fixed include errors

This commit is contained in:
2026-03-10 11:28:12 +01:00
parent 5c3419abc0
commit e74f8042b6
16 changed files with 32 additions and 16 deletions

View File

@@ -8,6 +8,7 @@ public class GetAuthorByIdSpec : SingleResultSpecification<Author>
public GetAuthorByIdSpec(int authorId)
{
Query
.Include(x => x.Books)
.Where(x => x.Id == authorId);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}