ra0o0f / arangoclient.net

ArangoDB .NET Client with LINQ support
Apache License 2.0
99 stars 37 forks source link

make sure that the property name are properly resolved regardless if it's a nested property or not #101

Open samirski opened 6 years ago

samirski commented 6 years ago

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)
                        }
                    });
endeffects commented 5 years ago

@ra0o0f @jjchiw @jmcdaniel83 please merge and create new release package