Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3872580
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:56:28+00:00 2026-05-19T21:56:28+00:00

When mapping a HasMany or HasManyToMany in fluent nhibernate, you can specify the column

  • 0

When mapping a HasMany or HasManyToMany in fluent nhibernate, you can specify the column name to use for the list as a parameter to the AsList() method as follows:

HasMany(c => c.Customers)
    .AsList(c => c.Column("PositionIndex"));

I would prefer to be able to set this using a Fluent NHibernate convention (either a pre-existing one, or a custom one), especially since the default name appears to be “Index” which is a reserved word in MSSQL.

I’ve tried using a custom convention implementing IHasManyConvention, but the instance parameter does not seem to contain the information about whether its a list, a bag, or a set, and also does not contain the column details for the index column.

public void Apply(IOneToManyCollectionInstance instance)
{

}

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:56:29+00:00Added an answer on May 19, 2026 at 9:56 pm

    When the convention is being applied, the underlying mapping has already been generated. There is currently no way to change this mapping to an ordered collection (or any other type) through convention.

    However, you can still change the type of collection through an IAutoMappingOverride<> as they are applied prior to the conventions.

    Even if this is not supported yet, it looks like quite high on the Todo list for the next release. See this thread for further details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this Fluent NHibernate mapping: public LossMap() { Table(losses); Id(x => x.Id).Column(id); References(x
For following class mapping: <class name=Person table=Person discriminator-value=null> <id name=ID column=ID > <generator class=identity/>
My filter mapping in web.xml is as follows: <filter> <filter-name>LoginCheckFilter</filter-name> <filter-class>com.tutorial.filter.LoginCheckFilter</filter-class> </filter> <filter-mapping> <filter-name>LoginCheckFilter</filter-name>
Is there a way in Fluent NHibernate to specify that a foreign key should
I'm getting a mapping error in Fluent NHibernate. Why is it still looking for
In Fluent NHibernate you are able to set the cascade settings for a mapping
In order to use my Fluent NHibernate mappings on SQL Azure, I need to
I have the following HasMany convention: instance.Key.Column( instance.EntityType.Name + Fk ); instance.Inverse(); instance.Cascade.All(); That
I have dictionary which I'm mapping using Fluent NHibernate. The dictionary has a complex
I have a Fluent NHibernate mapping override that I am using to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.