Consider the following class. It tries to protect the access to the _assignedTrays.
Actually, it works perfectly, since EF automatically links the backing f
The documentation does not reflect the actual rules, because <camel-cased property name>
(the "standard" C# backing field naming convention) is definitely supported, and probably even with highest priority.
But let say your naming convention is not supported. You can still map the backing field, but you can't do that with Property
fluent API, because by EF Core terminology navigation properties are not "properties", but "navigations". This applies to all fluent, change tracking etc. APIs.
In order to configure navigation, you need to get access to the relationship builder. Then you can use the PrincipalToDependent
and DependentToPrrncipal
properties of the associated metadata to access/configure the two ends of the relationship.
Or use directly the metadata APIs (currently there is no dedicated fluent API for that anyway).
For instance:
modelBuilder.Entity<Rack>()
.FindNavigation(nameof(Rack.AssignedTrays))
.SetField("assignedTrays");