LinqConnect Documentation
In This Topic
    Association Configuration Classes
    In This Topic

    Associations are created with the Association method of the EntityConfiguration class.

    The example of defining an association mapping configuration:

    builder.Entity<Order>()
        .Association()
            .Name(@"Company_Order")
            .ToOne(order => order.Company).ThisKey(order => order.ShipCompanyID)
            .FromMany(company => company.Orders).OtherKey(company => company.CompanyID);

    The following classes are used to help defining association mapping configuration. Reflection-based classes:

    Generic classes:

    Each of these classes performs its own part of configuring the association mapping. All of them are descendants of the AssociationBaseConfiguration class, which implements the IAssociationConfiguration interface.

    AssociationStartConfiguration and AssociationStartConfiguration<TThisEntity>

    The AssociationStartConfiguration class has the following public methods:

    AssociationOneEndConfiguration, AssociationOneEndConfiguration<TThisEntity, TOtherEntity>, AssociationManyEndConfiguration, and AssociationManyEndConfiguration<TThisEntity, TOtherEntity>

    The AssociationOneEndConfiguration and AssociationManyEndConfiguration classes have the following public methods:

    AssociationConfiguration and AssociationConfiguration<TOtherEntity>

    The AssociationConfiguration class has the following public methods:

    ManyToManyAssociationConfiguration and ManyToManyAssociationConfiguration<TOtherEntity>

    The ManyToManyAssociationConfiguration class has the following public methods: