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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:35:48+00:00 2026-06-02T04:35:48+00:00

I am having the difficulty to understand NHibernate an petapoco loading mechanism. Actually I

  • 0

I am having the difficulty to understand NHibernate an petapoco loading mechanism. Actually I did a test to compare how both behave upon a query.

My class is as follows:

UserTest.cs with the following properties:

private string name;
private int id;
private int customerId;

public int ID
{
    get { return id; }
    set { id = value; }
}

public string Name
{
    get { return name; }
    set { name = value; }
}

public int? CustomerID
{
    get { return customerId; }
    set
    {
        if (value != customerId)
        {
            customerId = value;
            if (this.ID > 0)
            {
                DoSomeOtherWork();
            }
        }
    }
}

When I do a User.Load in NHibernate, I have observed that DoSomeOtherWork is never called whereas in PetaPoco, when I do a query from loading User such as Connection.db.Fetch<UserTest>(...) or Connection.db.Query<UserTest>(...), I can see that DoSomeOtherWork is called.

Why is that so?

Is there a way to avoid calling DoSomeOherWork when using PetaPoco such that it has the same behaviour as NHibernate? I dont want to usePetaPoco.Ignoreas I need to get and set theCustomerID`.

  • 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-06-02T04:35:50+00:00Added an answer on June 2, 2026 at 4:35 am

    PetaPoco it a micro-ORM (much lighter than Nhibernate) and materializes your POCO object when you fetch the record. There is no other magic than that, so the answer is:

    No, you can’t avoid calling the setter of the property.

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

Sidebar

Related Questions

I am having some difficulty locating information of comparing C strings. I understand that
I'm trying to understand some flash animation, and am having difficulty working out the
Being a beginner I am having difficulty to understand the following statement a)If in
I believe I understand TransactionScopeOption.Suppress and TransactionScopeOption.Required but am having difficulty understanding what TransactionScopeOption.RequiresNew
I'm having difficulty understanding the syntax of C++ Template Template parameters. I understand why
first of all I apologize if my question is difficult to understand. I'm having
Im having difficulty trying to design a database structure for the following scenario: My
I am having difficulty using a thirdparty library registration function to register a callback.
I'm having difficulty using MooseX::Declare properly when calling BUILDARGS. I'm trying to create an
I am having difficulty connecting my java code to sql server database. I can

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.