I have a LiteDB
database with 2 POCO classes
- Author that includes "
Id
" and "Name
", as Properties - Book that includes "
Title
" "Id
" and "Author
"(this property has abson
reference to the Author's collection)
I'm trying to query the book collection in order to retrieve all authors named "John
" that wrote one or more books.
class Author // collection "authors"
{
[BsonId]
public int id {get; set;}
public string Name{get; set;}
}
class Book //collection "books"
{
[BsonId]
public int id {get; set;}
public string Title{get; set;}
[BsonRef("authors")]
public Author author {get; set;}
}
Thank you for the help