Skip to content

ColumnPrefix only applied to first Component mapping inside a ComponentMap #261

Open
@charlbrink

Description

@charlbrink

When nesting Components, the ColumnPrefix is only applied to the first nested Component.

Example Mapping follows:
ClassMap

Component(x => x.Invoice).ColumnPrefix("Invoice");

and

public class InvoiceMap : ComponentMap<Invoice>
{
  public InvoiceMap()
  {
        Map(x => x.Guid);
        Component<Text>(x => x.IssueLocation, n =>
        {
            n.Map(x => x.Content).Column("IssueLocation");
            n.Component<Code>(x => x.Language, c =>
            {
                c.Map(x => x.CodeListGuid).Column("IssueLocationLanguageCodeList");
                c.Map(x => x.Content).Column("IssueLocationLanguageContent").Length(2);
            });
        });
        Component<Text>(x => x.AuthenticationLocationName, n =>
        {
            n.Map(x => x.Content).Column("AuthLocationName");
            n.Component<Code>(x => x.Language, c =>
            {
                c.Map(x => x.CodeListGuid).Column("AuthLocationNameLanguageCodeList");
                c.Map(x => x.Content).Column("AuthLocationNameLanguage").Length(2);
            });
        });

The mapping above will result in database table column names:
InvoiceGuid
InvoiceIssueLocation
InvoiceIssueLocationLanguageCodeList
InvoiceIssueLocationLanguageContent
AuthLocationName
AuthLocationNameLanguageCodeList
AuthLocationNameLanguage

AuthLocationName* should also be prefixed with "Invoice"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions