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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:26:33+00:00 2026-05-21T11:26:33+00:00

I have a custom domain service with a single [Invoke] operation that returns a

  • 0

I have a custom domain service with a single [Invoke] operation that returns a List of User objects.

In order to get it to compile, I have to stump out the User object in a property (highlighted as ‘DONOTUSE’ below) or method outside of the [Invoke] operation otherwise I am met with the following compile time error:

Operation named ‘GetUsers’ does not conform to the required signature. Return types must be an entity or complex type, a collection of entities or complex types, or one of the predefined serializable types.

Once I stump out the property it compiles and executes as intended, but the hack annoys the heck out of me.

I do not wish to use the [Query] attribute so please do not suggest that I do. I say this because if I do switch to [Query] it compiles fine, however, I do not want to deal with the EntityQuery result set or its deferred execution.

Due to the way I have the designed the architecture, the needs of the use case in this example and MSDN documentation, [Invoke] is the most appropriate means.

[EnableClientAccess()]
public class UserDomainService : DomainService
{

    private IUserService userService;
    public UserDomainService(IUserService service)
    {
        userService = service;
    }

    [Invoke, RequiresAuthentication]
    public List<User> GetUsers()
    {
        return userService.GetUsers();
    }

    //HOW CAN I REMOVE THE FOLLOWING AND STILL COMPILE?
    public User DONOTUSE()
    {
        return null;
    }

}

I’ll leave you with this… I have another project that has custom DomainServices with single [Invoke] operations and it compiles fine. I cannot, for the life of me, figure out why one would compile over the other.

UPDATE

See comments in the selected answer below.

  • 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-21T11:26:34+00:00Added an answer on May 21, 2026 at 11:26 am

    Have you tried exposing users like this ?

    IQueryable<User> GetUsers() { throw new NotImplementedException(); }
    

    That’s a way of forcing the WCF Ria code generator to expose your entity client-side. You might try using shared code too, Class.shared.cs, look it up in the WCF Ria docs

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

Sidebar

Related Questions

I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a few models that need to have custom find conditions placed on
I have a custom validation function in JavaScript in a user control on a
I have a custom installer action that updates the PATH environment, and creates an
We have a custom-built Flash-based video player that I maintain, and it needs to
I have a working custom UserNamePasswordValidator that calls into my Oracle DB. This class
I have a database that have quite a bit relational user information that would
I get a error message while updating my service reference: Custom tool warning: Unable
We have a basic service that some people use but most people want their
I have a situation where I am accessing repositories within my custom Domain Services

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.