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

Projections inherited from a base class that hides the Id property, projects to an empty Id. #1369

Closed
ddivita opened this issue Oct 16, 2019 · 0 comments · Fixed by #1371
Closed
Assignees
Milestone

Comments

@ddivita
Copy link

ddivita commented Oct 16, 2019

We ran into an issue where our base class contains a property named Id. Our projections are inheriting from that base class. When querying the projection the Id property is empty.

public class Root {
     public Guid Id {get;set;}
}

public class Employee: Root {
     public string Name {get;set;}
     public string EmployeeId {get;set;}
}

var emp = _session.Query<Employee>().FirstOrDefault(e => e.Id = Guid.Parse("df0916ac-c00d-4843-8b58-fbb8325e0aeb"));

The employee object does come back, but the Id is an empty Guid.

@ddivita ddivita changed the title Projections inherited from base classes that hides the Id property is empty. Projections inherited from a base classes that hides the Id property, projects to an empty Id. Oct 16, 2019
@ddivita ddivita changed the title Projections inherited from a base classes that hides the Id property, projects to an empty Id. Projections inherited from a base class that hides the Id property, projects to an empty Id. Oct 16, 2019
@oskardudycz oskardudycz added this to the 3.10.0 milestone Oct 17, 2019
@oskardudycz oskardudycz self-assigned this Oct 17, 2019
oskardudycz added a commit that referenced this issue Oct 17, 2019
…ted to allow eg. having private or protected setter for ID
oskardudycz added a commit that referenced this issue Oct 19, 2019
…ted to allow eg. having private or protected setter for ID
oskardudycz added a commit that referenced this issue Nov 2, 2019
…ted to allow eg. having private or protected setter for ID
oskardudycz added a commit that referenced this issue Nov 3, 2019
…ted to allow eg. having private or protected setter for ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants