public class Person
{
List<Contact> Contacts {get;set;}
}
public abstract class Contact
{
string Value {get;set;}
}
public class Email : Contact
{
}
public class Chat: Contact
{
}
I have typed collection for Person.
How can I query mongodb for specific derived type (lets say Email) which has some specific value in Value field?
I can build query as Person.Contacts.Value = "someValue" , but this query returns result if "someValue" matches with any Chat.Value. What i need is Query must search in only Email.Value field and return result accordingly?
Thanking you in advance.