mxmissile
mxmissile

Reputation: 11673

Why Does Fluent-NHibernate Generate Inconsistent Column Names

I'm using Fluent Mapping for a project with this ClassMap:

    public class PricingMap : ClassMap<Pricing>
    {
            public PricingMap()
            {
                Init();
            }

            private void Init()
            {
                Table("distributership_pricing");

                ...

                References(x => x.Product);
                References(x => x.Distributor);
            }
 }

For the References, why does it generate ProductId for the Product relation, and Distributor_Id for the Distributor?

Upvotes: 0

Views: 79

Answers (1)

Dylan Beattie
Dylan Beattie

Reputation: 54130

It doesn't - I suspect there's a bug in one of your class maps; FluentNH will use the _Id suffix unless explicitly overridden by one of your class mappings or by a custom naming convention.

Upvotes: 2

Related Questions