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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:00:46+00:00 2026-05-27T15:00:46+00:00

I have a ServiceOperation to query items available to a certain user at a

  • 0

I have a ServiceOperation to query items available to a certain user at a certain time.
In short this methode does:

var fullResult = from i in Items where ... select i; //get ALL possible items where..., 

Lets say this returns items {A, B, C, D}.
A second query filters out which of those items the calling user has access to.

var clientResult = from ci in fullResult where (privilege's and schedule's are true)

This mite result in {A, C } and is returned.
The result on the client side is: only the list of items the client has access to is displayed. This can be annoying since you don’t know if you made a mistake in searching, or the item is just not available right now.

What I would like to be able to do is show all possible results to the client {A, B, C, D} yet FLAG B and D in this case as unavailable.

My entity has already a property isReadOnly I could use.

Can I write a query to not just filter out, but also flag any remaining results as read only? An ideal result would be {A, B.isREadOnly=true, C, D.isReadOnly=true}

Or did I reach the limit of what is doable and do I have to write a traditional WCF web method, creating a separate class, returning a list of results?

PS: this ‘isReadOnly’ property is only used for this, I don’t mind it being changed in the DB at all

Thanx for any pointers

Andreas

  • 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-27T15:00:47+00:00Added an answer on May 27, 2026 at 3:00 pm

    If I were you I would consider not returning the entity directly out of your service and instead map it to something that has the ReadOnly property. For example, if your entity is:

    public class A
    {
        public string Name { get; set; }
    }
    

    Then you could have a data contract like this:

    [DataContract]
    public class AExtra
    {
        [DataMember]
        public string Name { get; set; }
    
        [DataMember]
        public bool IsReadOnly { get; set; }
    }
    

    what this means is that you could do this in your query:

    var res = from a 
              in Items 
              where (...whatever your original logic is) 
              select new AExtra
                {
                    Name = a.Name,
                    IsReadOnly = (...put your logic for determining ReadOnly in here)
                };
    

    And then return res from your service operation.

    Just an opinion really but I like to do things like this rather than send the entities directly out of the service – it always gives me a bit more freedom to change things without having too many knock-on effects.

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

Sidebar

Related Questions

I have the following returned to client from ServiceOperation (of a WCF Data Service):
I have a simple web service operation like this one: [WebMethod] public string HelloWorld()
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have this issue: I have WebSite with asp.net pages. http://desiis:90/WebSite1 In this webSite,
I have to call a secure WCF service from java using mutual authentication. Everything
I have WCF service to get users from the ActiveDirectory. I receive parameter from
Have written all the code in a silverlight class library (dll) and linked this
I have a MS Access query ProductDetailsAll that is queried using an ASP.net web
I have the following Soap Request I receive from the client, where basically I
I'm trying to implement a fire-and-forget pattern in a WCF method. I have this

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.