INNER CODE UNIT · C#
Account
mongodb/mongo-efcore-provider · benchmarks/MongoDB.EntityFrameworkCore.Benchmarks/Model.Extended.cs:5
public class Account // principal for Order's reference navigation
{
public ObjectId Id { get; set; }
public string Name { get; set; } = "";
public string Tier { get; set; } = "";
}
public class Order
{
public ObjectId Id { get; set; }
public string Code { get; set; } = "";
public ObjectId AccountId { get; set; } // FK to Account
public Account? Account { get; set; } // reference navigation (Case A Include)
public ShippingInfo Shipping { get; set; } = new();// owned
public List<LineItem> Lines { get; set; } = new(); // owned collection
}
public class ShippingInfo // owned