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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:00:35+00:00 2026-06-03T02:00:35+00:00

I have a Client Server app in the following way. In the domain some

  • 0

I have a Client Server app in the following way.

enter image description here

In the domain some classes have collections of children. Some children reference their parent.

The problem with the is when a request is made to the server for a child object, all other children are returned with the response. In many circumstances it’s very helpful to have access to the parent object from the child and I would prefer not to have to make a seperate request for the parent since that would result in more round trips.

Normally Nhibernates Lazy-Loading would take care of this but the interaction with protobuf-net (or any other serialization) means all the fields are accessed to be serialised. The client has no direct access to the database.

Is it possible to limit the object reference depth in either protobuf-net or Nhibernate in such a way that I can include in the request to the server a flag saying don’t load more than 2 objects deep.

e.g.
Order – Order Item – Delivery Information.

A limit of one on a request for an order would mean don’t load the delivery information. A limit of 0 would mean don’t load the order items.

Altenatively is it possible to optionally stop references being loaded (the limit is either 0 or unlimited) this is more restrictive but possibly more viable to implement.

  • 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-03T02:00:37+00:00Added an answer on June 3, 2026 at 2:00 am

    protobuf-net supports the ShouldSerialize* pattern (in common with several BCL implementations, including the IDE/PropertyGrid, and XmlSerializer).

    If you have:

    [ProtoMember(1)]
    public int Whatever { get; set; }
    

    And a corresponding:

    public bool ShouldSerializeWhatever() {
        ...
    }
    

    Then Whatever is only serialized if ShouldSerializeWhatever returns true. This pattern is entirely name-based. The method can be public or non-public (but XmlSerializer only accepts public methods for this, so keep it public if you are using multiple serializers).

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

Sidebar

Related Questions

I'm writing chat client/server app with c# and I have problem with threading. I
i have client-server app, I'm managing connections with Threads and handlers inside app, but
I have client-server app. Client on C++, server on Java. I am sending byte-stream
We have client server based app which saves user related data into a zip
I have a simple client-server app on android. the android service communicates with the
I have client/server application where the client app will open files. Those files get
I have a client and a server app on Android (that uses ZeroC -
I'm developing a new client-server app (.Net) and have up until now been using
I have a client app and a server app. The client calls a wcf
I have a DDE client app which connects to the DDE server app by

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.