You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Only discover properties with public getter and public/private/etc. setter #4314
My understanding from our discussion was that we would go back to the EF6 rules - i.e. only pull in properties with a getter and setter where at least one of them is public. The exception being collection navigations - where a setter is not required.
I also think we decided to keep discovering private properties, but I might be remembering wrong. We've had so many different discussions! Fundamentally, the biggest problem is mapping read-only properties, so we should stop doing that. Also, probably mapping private navigation properties doesn't make much sense.
Yeah I'm pretty sure we decided to "go back to the same rules we had in EF6". The reasons being that we know they worked well in most cases and we now have an easy way to bring private properties into the model (using the string overload of Property), which was hard in EF6.
Triage: Decision is that we map properties with a getter and a setter when the getter is public (the setter does not have to be public). The one exception is that collection navigation properties do not need to have a setter at all. This is slightly simplified from the EF6 rules. The one deviation from the EF6 rules is that we don't just silently ignore properties that we can't find a type mapping for - we continue to throw saying that the property can't be mapped.
changed the title [-]Don't discover read-only properties[/-][+]Only discover properties with public getter and public/private/etc. setter[/+]on Jan 20, 2016
Activity
rowanmiller commentedon Jan 14, 2016
My understanding from our discussion was that we would go back to the EF6 rules - i.e. only pull in properties with a getter and setter where at least one of them is public. The exception being collection navigations - where a setter is not required.
@divega @ajcvickers was that your understanding too?
AndriySvyryd commentedon Jan 14, 2016
I thought we decided that we will keep discovering private properties.
ajcvickers commentedon Jan 15, 2016
I also think we decided to keep discovering private properties, but I might be remembering wrong. We've had so many different discussions! Fundamentally, the biggest problem is mapping read-only properties, so we should stop doing that. Also, probably mapping private navigation properties doesn't make much sense.
rowanmiller commentedon Jan 15, 2016
Yeah I'm pretty sure we decided to "go back to the same rules we had in EF6". The reasons being that we know they worked well in most cases and we now have an easy way to bring private properties into the model (using the string overload of Property), which was hard in EF6.
ajcvickers commentedon Jan 15, 2016
I can go with that. :-)
ajcvickers commentedon Jan 15, 2016
So, EF6 rules, except that we never exclude a property because the type of the property "can't be mapped".
rowanmiller commentedon Jan 15, 2016
Triage: Decision is that we map properties with a getter and a setter when the getter is public (the setter does not have to be public). The one exception is that collection navigation properties do not need to have a setter at all. This is slightly simplified from the EF6 rules. The one deviation from the EF6 rules is that we don't just silently ignore properties that we can't find a type mapping for - we continue to throw saying that the property can't be mapped.
[-]Don't discover read-only properties[/-][+]Only discover properties with public getter and public/private/etc. setter[/+]