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

  • Home
  • SEARCH
  • 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 4013080
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:19:37+00:00 2026-05-20T09:19:37+00:00

I know that join is not supported on client side with WCF DS thats

  • 0

I know that “join” is not supported on client side with WCF DS thats why i decided to add a method on server side to do the “join” and return the result as custom type object.
Service looks like this:

 public class CWcfDataService : DataService<CEntities>
    {
        // This method is called only once to initialize service-wide policies.
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.UseVerboseErrors = true;
            config.RegisterKnownType(typeof(CASE_STAGE_HISTORY_EXTENDED));
            config.SetEntitySetAccessRule("*", EntitySetRights.All);
            config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }

        [WebGet]
        public IQueryable<CASE_STAGE_HISTORY_EXTENDED> GetCASE_STAGE_HISTORY_EXTENDEDByDocId(int docId)
        {
            CEntities context = new CEntities();
            return (from c in context.CASE_STAGE_HISTORY
                    join a in context.USRs on c.CREATOR_ID equals a.USRID
                    select new CASE_STAGE_HISTORY_EXTENDED()
                    {
                        CASE_STAGE_ID = c.CASE_STAGE_HISTORY_ID,
                        CASE_STAGE_NAME = c.CASE_STAGE_NAME,
                        CREATE_DATE = c.CREATE_DATE,
                        CREATOR_ID = c.CREATOR_ID,
                        DOC_ID = c.DOC_ID,
                        LAST_VARIANT_DOCUMENT_ID = c.LAST_VARIANT_DOCUEMENT_ID,
                        CREATOR_FULLNAME = a.FULLNAME
                    });
        }    
    }

And custom class is:

   [DataServiceKey("CASE_STAGE_ID")]
    public class CASE_STAGE_HISTORY_EXTENDED
    {
        public int CASE_STAGE_ID { get; set; }
        public int DOC_ID { get; set; }
        public string CASE_STAGE_NAME { get; set; }
        public int? LAST_VARIANT_DOCUMENT_ID { get; set; }
        public DateTime? CREATE_DATE { get; set; }
        public int? CREATOR_ID { get; set; }
        public string CREATOR_FULLNAME { get; set; }
    }

When i try to update service reference in Visual Studio i constantly get error:

The server encountered an error
processing the request. The exception
message is ‘Unable to load metadata
for return type
‘System.Linq.IQueryable1[CWcf.Code.CASE_STAGE_HISTORY_EXTENDED]'
of method
'System.Linq.IQueryable
1[CWcf.Code.CASE_STAGE_HISTORY_EXTENDED]
GetCASE_STAGE_HISTORY_EXTENDEDByDocId(Int32)’.’.
See server logs for more details.

If i remove the public IQueryable<CASE_STAGE_HISTORY_EXTENDED> GetCASE_STAGE_HISTORY_EXTENDEDByDocId(int docId) part – on updating service reference i get another error:

The server encountered an error
processing the request. The exception
message is ‘Internal Server Error. The
type
‘CourtWcf.Code.CASE_STAGE_HISTORY_EXTENDED’
is not a complex type or an entity
type.’.

Environment: Visual Studio 2010, .NET 4.

  • 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-20T09:19:37+00:00Added an answer on May 20, 2026 at 9:19 am

    Added foreign keys and implemented LoadProperty. See the article from which i took this solution: http://thedatafarm.com/blog/data-access/the-cost-of-eager-loading-in-entity-framework/
    Still if i have NO relations in database(for example i have no foreign keys)-i have another solution: create stored procedure and map it with import in your DB model. After that create complex type that will work in client too(tho you will have to access it by URI, not with lambda extensions). See example here.
    Many thanks for other answerers in this thread, you have made me look deeper into the subject.

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

Sidebar

Related Questions

I know that I can do something like $int = (int)99; //(int) has a
I know that default cron's behavior is to send normal and error output to
I know that you can insert multiple rows at once, is there a way
I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is
I know that the MsNLB can be configured to user mulitcast with IGMP. However,
I know that .NET is JIT compiled to the architecture you are running on
I know that the following is true int i = 17; //binary 10001 int
I know that just using rand() is predictable, if you know what you're doing,
I know that IList is the interface and List is the concrete type but
I know that we shouldn't being using the registry to store Application Data anymore,

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.