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

  • Home
  • SEARCH
  • 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 533623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:31:39+00:00 2026-05-13T09:31:39+00:00

I typed this simplified example without the benefit of an IDE so forgive any

  • 0

I typed this simplified example without the benefit of an IDE so forgive any syntax errors. When I try to automap this I get a FluentConfigurationException when I attempt to compile the mappings –

“Association references unmapped class
IEmployee.”

I imagine if I were to resolve this I’d get a similar error when it encounters the reference to IEmployer as well. I’m not opposed to creating a ClassMap manually but I prefer AutoMapper doing it instead.

public interface IEmployer 
{ 
  int Id{ get; set; } 
  IList<IEmployee> Employees { get; set; } 
} 

public class Employer: IEmployer 
{ 
  public int Id{ get; set; } 
  public IList<IEmployer> Employees { get; set; } 
  public Employer() 
  { 
    Employees = new List<IEmployee>(); 
  } 
} 

public interface IEmployee 
{ 
  int Id { get; set; } 
  IEmployer Employer { get; set; } 
} 

public class Employee: IEmployee 
{ 
  public int Id { get; set;} 
  public IEmployer Employer { get; set;} 
  public Employee(IEmployer employer) 
  { 
    Employer = employer; 
  }
}

I’ve tried using .IncludeBase<IEmployee>() but to no avail. It acts like I never called IncludeBase at all.

Is the only solution to either not use interfaces in my domain entities or fall back on a manually defined ClassMap?

Either option creates a significant problem with the way my application is designed. I ignored persistence until I had finished implementing all the features, a mistake I won’t be repeating again 🙁

  • 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-13T09:31:40+00:00Added an answer on May 13, 2026 at 9:31 am

    It’s not a restriction imposed by Fluent or its AutoMapper, but by NHibernate itself.

    I therefore don’t think you’d get there with the manual class map. You’ll have to lose the interfaces in the property and list definitions. You can keep the interfaces, but mapped properties and collections must use the concrete types of which NHibernate knows.

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

Sidebar

Related Questions

$('input#not-gonna-work').bind({ keyup: function(){ console.log('Typed a key'); $(this).val($(this).val() + '.');// try with any other char
I'm learning OCaml, and this is my first typed language, so try to be
Given this highly simplified example: abstract class Animal { } class Dog : Animal
This is a simplified example, to make sure that there are no asynchronous fading/animation
When I write bash scripts I usually get the verbose mode this way (simplified):
I have a web-page that looks like this (simplified example) <table id=events_results_table> <thead> <tr>
In this simplified example I have a generic class, and a method that returns
I would like to do something like this (example is simplified, but contains all
Given this simplified snippet : <html> <body> <div> <div style='text-align:center;'>asdfaskjdfakjsd</div> <div style='float:right'> <input type='submit'
I typed this into Clojure REPL (using the enclojure Netbeans plugin): user=> hello, world

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.