Skip to content

UseMappingTables doesn't work for TemplateType.FileBasedEf6 #864

@savornicesei

Description

@savornicesei

Behaviour
Given EF.Reverse.POCO v3.10 .tt file:

Settings.DatabaseType            = DatabaseType.SqlServer;
Settings.TemplateType            = TemplateType.FileBasedEf6;
Settings.GeneratorType           = GeneratorType.Ef6;
// ...
Settings.UseMappingTables     = true;

with a Sql server database containing the classic partner -> partner address <- address many-to-many relation, the entity for PartnerAddress (mapping table) is generated when running the template.

Looks like an oversight for FE6 case, while the FileBased-templates are counted for EFCore

Image

create table dbo.Address
(
    Id int identity
        constraint PK_Address_Id
			primary key,
    Name     nvarchar(1024) not null,
    Address  nvarchar(500)  not null,
    IsActive bit not null,
)
go

create table dbo.Partner
(
    Id int identity
		constraint [PK_dbo.Partner]
			primary key,
    Name     nvarchar(500) not null,
    Contact  nvarchar(500),
    IsActive bit not null,
)
go

create table dbo.PartnerAddress
(
    PartnerId int not null
        constraint PartnerAddress_Partner_Id_fk
            references dbo.Partner,
    AddressId int not null
        constraint PartnerAddress_Address_Id_fk
            references dbo.Address
)
go

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions