Reading resources
Let's see how to perform some basic reading operations on your collection. We extend the PersonInformation
class with more fields to be able to demonstrate some more detailed querying capabilities. The PersonInformation
class now also contains a list of roles a person can have. This enables us to query on the Roles
property as well.
The class is defined as follows:
public class PersonInformation : Resource { public string LastName { get; set; } public string FirstName { get; set; } public DateTime DateOfBirth { get; set; } public List<Role> Roles { get; set; } } public class Role { public string RoleName {get;set;} }
Reading documents
In this section, we will use the Roles
property of the PersonInformation
class and start querying it using the three methodologies demonstrated in the previous sections. After creating a few documents containing different persons with different roles, we can query for all persons with the role Administrator
assigned to...