Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

samirski
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants