EF Core 3: Configure backing field of navigation property
问题 Consider the following class. It tries to protect the access to the _assignedTrays . Actually, it works perfectly, since EF automatically links the backing field _assignedTrays to the property AssignedTrays - by convention (msdn) public class Rack { private List<Tray> _assignedTrays = new List<Tray>(); private Rack() { } public Rack(string rackId) { this.Id = rackId; } public string Id { get; private set; } public IReadOnlyList<Tray> AssignedTrays => this._assignedTrays.AsReadOnly(); public