the property name resolution works in the following scenarios as well, regardless if these classes are nested or not:
class Person
{
[DocumentProperty(Identifier = IdentifierType.Key)]
public string Key { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public Address Address { get; set; }
}
class Address
{
public string Street { get; set; }
public string City { get; set; }
}
previously defining an index on Address.Street would create and index on Street which is wrong
db.Advanced.EnsureIndex<Person>(new EnsureIndexData
{
Type = IndexType.Hash,
Unique = false,
Fields = new List<string> {
//"cell",
// or if you dont want use strings
db.SharedSetting.Collection.ResolvePropertyName<Person>(x=>x.Address.Street)
}
});
the property name resolution works in the following scenarios as well, regardless if these classes are nested or not:
previously defining an index on Address.Street would create and index on Street which is wrong