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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:43:30+00:00 2026-05-18T06:43:30+00:00

Help me, please, solve one problem. I have project, which uses Nhibernate and Fluent

  • 0

Help me, please, solve one problem.

I have project, which uses Nhibernate and Fluent Nhibernate. There I created one base class
(it is not real classes, but they describe my situation):

public class Document
{
    public virtual int Id { get; private set; }
    public virtual Account Acc { get; private set; }
}

And mapping for it:

public class DocumentMap: ProfileEntityMap<Document>
{
    public DocumentMap()
    {
        Id(m => m.Id);
        References(m => m.Acc);
        DiscriminateSubClassesOnColumn("Type");
    }
}

Then I implemented subclass:

public class PaymentDocument: Document
{
    public virtual Card AccountCard { get; set;}
}

Mapping for class PaymentDocument:

public class PaymentDocumentMap : SubclassMap<PaymentDocument>
{
    public PaymentDocumentMap()
    {
        References(t => t.AccountCard);
    }
}

And after that I try execute this query:

payments = session.Query<PaymentDocument>()
    .Fetch(t => t.Acc)
    .Fetch(t => t.AccountCard)
    .ToList();

And when I insert first fetch I get next exception:

Object reference not set to an instance of an object.

Can somebody answer me where is a problem?

  • 1 1 Answer
  • 5 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-18T06:43:30+00:00Added an answer on May 18, 2026 at 6:43 am

    Actually it was a bug fixed in 3.0.0.Alpha2. Right now it works with the trunk.

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

Sidebar

Related Questions

Please help me solve my big problem. in my on-line shopping project i created
Please help me solve this problem with capybara I have a button like this
I have a long string, ex: Please help me to solve this problem. This
I have no idea how to solve this: http://acm.sgu.ru/problem.php?contest=0&problem=311 Please help me with this
Can any one please help me solve this. I am resizing some flash object/embed
I have a problem to solve like this. there is time interval, and each
Please any one help to solve, how to get hoptoad/airbrake Error Notification in Development
Help me please with the following problem: - (NSDictionary *)getGamesList { NSMutableDictionary *gamesDictionary =
help me please. There is a list of nodes. <list> <item>1</item> <item>2</item> <item>3</item> <item>4</item>
I have one problem while adding multiple events more than 70 events repeatedly again

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.