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 9115351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:24:38+00:00 2026-06-17T04:24:38+00:00

simple question for real gurus. I lost a lot of time figuring how to

  • 0

simple question for real gurus.
I lost a lot of time figuring how to map collection in nhib. mapping by code and I now I have question, why my mapping work with collection of type IList and not with List?

Here’s the code

public class Account {
    private IList<Term> Terms; // When I use List it does not work
    public Account()
    {
       Terms = new List<Terms>(); 
    }
    public virtual IList<Term> Terms // When I use List it does not work
    {
       get { return _Terms; }
       set 
       { if (_Terms == value) return;
           _Terms = value;
       }
    }
}

AccountMap.cs (One account have many terms)

Bag(x => x.Terms,
         m =>{},
         x => x.OneToMany()
);
  • 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-06-17T04:24:40+00:00Added an answer on June 17, 2026 at 4:24 am

    Documentation says: 6.1. Persistent Collections:

    NHibernate requires that persistent collection-valued fields be
    declared as an interface type

    And the list of supported interfaces:

    The actual interface might be Iesi.Collections.ISet,
    System.Collections.ICollection, System.Collections.IList,
    System.Collections.IDictionary,
    System.Collections.Generic.ICollection<T>,
    System.Collections.Generic.IList<T>,
    System.Collections.Generic.IDictionary<K, V>,
    Iesi.Collections.Generic.ISet<T>

    or … anything you like! (Where “anything you like” means you will have to write an implementation of NHibernate.UserType.IUserCollectionType.)

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

Sidebar

Related Questions

This is a real newbie question. I have simple app that selects a picture
I have probably simple question: /the code: http://jsfiddle.net/FZufj/8/ / I have a simple code
This is going to be a very simple question, I have code that looks
I have what should be a real simple regex question. I'm making a makefile
I have a real simple question here. I only want to know if there
I have created a 2-to-1 simple element called ntoone. My question now is how
Got a real simple question but can't figure out the solution. Got following code.
Simple question I hope.... I have a Win Form with a Tab Control and
This is probably a very simple question. I am new to Rails and have
Real simple question. According to my man-page, these two will do the same: time_t

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.