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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:15:47+00:00 2026-05-16T15:15:47+00:00

Using Microsoft’s designer for the Entity Framework (v3.5), I have created an Entity Model

  • 0

Using Microsoft’s designer for the Entity Framework (v3.5), I have created an Entity Model (*.edmx) with a generated *.Designer.cs class. I can persist my objects to MS SQL Server using the model without any problems.


I am new to NHibernate, and out of curiosity, I now would like to use my model with Fluent NHibernate and SQLite as database. I have read the Auto mapping article on the Fluent NHibernate wiki. I did adapt the Examples.FirstAutomappedProject and have adapted the ExampleAutomappingConfiguration to map my entities. (I used only the ShouldMap and IsId overrides). My entities are rather simple and do not contain explicit references to each other in the model.

Now, when I build the Session Factory, i get the following exception:

An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.

with an inner exception with the message

An association from the table XXX refers to an unmapped class: System.Data.EntityKey

None of my entities’ properties are of type System.Data.EntityKey.

[global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="MyStorageModel", Name="XXX")]
[global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
[global::System.Serializable()]
public partial class XXX: global::System.Data.Objects.DataClasses.EntityObject
{
  //...
     [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
     [global::System.Runtime.Serialization.DataMemberAttribute()]
     public global::System.Guid XXXID
     {
        //...
     }
  //...
}

As you see, my entity classes are heavily decorated (by the used designer of course) with a attributes that probably refer to this type. Can this cause these troubles?

  • 1 1 Answer
  • 2 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-16T15:15:47+00:00Added an answer on May 16, 2026 at 3:15 pm

    The problem probably is that your entity is inherited from EntityObject. EntityObject declares two public properties: EntityKey and EntityState. EntityKey is of type EntityKey and it is handled like association to class which you didn’t provide to NHibernate. I think you will not be able to do this unless you use EF 4.0 and POCO which didn’t inherit from EntityObject.

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

Sidebar

Related Questions

I'm using Microsoft's Entity Framework as an ORM and am wondering how to solve
using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; namespace proj { public class game
Using Microsoft SQL Server Management Studio, I have created a view, which pulls in
Using Microsoft Visual Studio 2010: Can I write this type of macro in C?
Using Microsoft SQL server 2008 I have a query that is in need of
Using Microsoft Spy++, I can see that the following windows that belong to a
Using Microsoft SQL Server 2005 - wondering how can I escape parenthesis in my
I'm using Microsoft Activity Library Designer; For some reasons I need to use ListBox
We have been using Microsoft Enterprise Lib for data access, some old legacy code
Using Microsoft SQL 2008. I have two tables that I want to select from

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.