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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:16:29+00:00 2026-05-30T14:16:29+00:00

Simple question for I bet a not so simple answer. Think of a project

  • 0

Simple question for I bet a not so simple answer.

Think of a project like WordPress. The base of WordPress is great and the developers built it to be extended with widgets or plugins etc.

Now think NHibernate, specifically with Fluent Mappings.

Put them together and you have a great and stable “base” system BUT how do you load mappings presented from external assemblies? I realize that the system would have to load the Assemblies on the fly using reflection but how do you configure nHibernate, Fluently, at first run to realize that there are extra entities to be loaded from those assemblies? How do you reference them?

I know you can;t add Mappings at run-time after the configurations is made, well you have to recreate the SessionFactory. This is why I want to load all required entities at runtime.

I also know that this can be somewhat accomplished with Dependancy Injection but I do not wish to go that route nor want the extreme baggage that comes with it.

If the plain old nHiberante config file can be modified and then referenced at runtime to reflect new Entities I can only assume there has to be a way to do it Fluently.

Also, based on answers: do you make the configuration from the base project or a DATA ACCESS assembly?

Thanks for your help.

  • 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-30T14:16:30+00:00Added an answer on May 30, 2026 at 2:16 pm

    You can pass an NHibernate Configuration object to Fluently.Configure(). That way you can update the configuration. You need to re-create the session factory when you do that, like you said.

    You can scan the assemblies in the bin folder for assemblies that contain fluent mapping classes (Assembly.Load, then check

    Assembly.GetExportedTypes()
            .Any(x => x.IsClass
                   && !x.IsAbstract
                   && typeof(IMappingProvider).IsAssignabledFrom(type))
    

    or similar) and add the assembly. When all assemblies are scanned, (re-)create the session factory.

    I’m doing something similar in an extensible application framework I have written (although I’ve moved to from Fluent NHibernate to NHibernate mapping by code, but the principles are similar).

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

Sidebar

Related Questions

Simple question, the answer may not be... I'm going to be developing a web
A really simple question with (I bet) a very simple answer... I want to
Simple question, but could somehow not find any answer on google (maybe it's just
Simple question, hopefully with a simple answer. I was under the impression I should
I bet this is a simple question. Im trying to style my xml file
Simple question but I can't seem to find the answer - can someone tell
Simple question, but I'll bet that asking on here will probably be more straight
Simple question really, I just can't seem to find an answer. How do I
Simple question: Will this hierarchy cause a DP? //Abstract base class class A {
simple question: I have input fields with inside-labels! Just like the search-box on this

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.