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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:28:05+00:00 2026-05-31T19:28:05+00:00

What is the best way to access a remote object model over WCF? I

  • 0

What is the best way to access a remote object model over WCF?

I have one system layer (A) with an object-oriented model and want to access this model from another layer (B)

The required objects should be loaded by B on-demand. As an example, suppose I have classes C1 and C2 with C1 holding a List of C2. This list should be loaded only when it is accessed.

Since data contracts cannot hold operation contracts, I would implement this with one service contract with two methods “getC1” and “getListC2(C1)”

But, what I actually want is to access an object-oriented model, e.g. call a function on C1: C1.getListC2

How can I work with WCF in a more object-oriented way?

  • 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-31T19:28:07+00:00Added an answer on May 31, 2026 at 7:28 pm

    One way to approach this is to wrap the proxy objects with your own lazy loading (and other) business logic. In other words, let’s say you have a WCF proxy called Order and a service method GetOrderLineItems().

    public class Order
    {
        private Proxies.Order _order;
        private List<OrderLineItem> _lineItems;
    
        public string Name 
        {
            get { return _order.Name; }
        }
    
        public List<OrderLineItem> LineItems
        { 
            if (_lineItems == null)
            {
                 _lineItems = //Make the service call to get these objects
            }
        }
    }
    

    Another way to synthesize this is to add extension methods to your proxy objects:

    public static List<Proxies.OrderLineItem> GetLineItems(this Proxies.Order order)
    {
         //Make the service call to get the line items
    }
    

    Which would allow you to do:

    var lineItems = order.GetLineItems();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

VS2010: What is the best way to access a remote database over the internet
the best way to explain is with example so: this is the model public
The best way of describing this is I have a table of people with
What is the best way to check database access from remote machine. Here is
I have a question on the best way of exposing an asynchronous remote interface.
Greetings, Trying to sort through the best way to provide access to my Entity
Would following the table below be the best way of determining the access type
The best way I can think of to ask this is by example... In
I have a web application in asp.net and C# that must access a remote
i have a production server that does not have ftp access. Possible way to

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.