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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:43:23+00:00 2026-05-31T05:43:23+00:00

In Fluent Nhibernate I can map a multiple entity references 1-M as a list

  • 0

In Fluent Nhibernate I can map a multiple entity references 1-M as a list of int ids :

    public class User{
     List<int> LicensesIds{
      get;
      set;
    }

Instead of

Public class User{
 ICollectoin<License> Licenses{
  get;
  set;
 }
}

Which is how Entity Framework maps it.
In the fluent mapping when I query the DB I get it with a list of ids instead of a list of entities.

Is there away I can map this the same way in Entity Framework ?

The reason I need it is because I am using the Repository pattern and have created a repository for each entity in the domain : Repository and I do not want to define what relations to query and get with an entity when I query the DB by using LINQ or by lazy binding in the middle of a property call without me being aware that this property call is now going to fetch data from the DB.
I want to bring the entities manually by querying the relevant repository.

Thx ,

James

  • 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-31T05:43:24+00:00Added an answer on May 31, 2026 at 5:43 am

    It is not possible. You must always have list of licences in your entity if you want EF to handle loading for you (you can than expose second property doing just projection to list of integers). If you want just list of int implement custom logic in your repository which will execute additional query and fill it.

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

Sidebar

Related Questions

I'm trying to get Fluent NHibernate 1.0 RTM to map a User entity for
How can I map to a private field with fluent NHibernate AutoPersistenceModel? public class
with Fluent NHibernate i can map a one to many relationship against my User
I am trying to get Fluent nHibernate to generate mappings so I can take
I'm having a problem with Fluent NHibernate mappings, I think, and can't quite get
I have this class: public class MyEntity { public virtual int Id { get;
I'm trying to adopt Fluent NHibernate with my project, currently I can get data
Can you map the following scenario with fluent nhibernate, and if so how: The
We're using Fluent Nhibernate and I can't seem to map a component. My component
Is it possible to map entities from multiple assemblies in Fluent NHibernate? I tried

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.