Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WCF Data Service Linq select with where condition

Posted on 2012-03-15
5
Medium Priority
?
869 Views
Last Modified: 2012-09-04
Hi

We have WCF Data Service over an huge database. We have problem with performace on select query across WCF Data Service.

How can we create a select using Linq to join two tables (product and category) and also to put filter condition (where) over both tables (where product.name like 'p' and category.name like 'c') and also to provide faster response on selection.

Or a other solution to select data across WCF Data Service with faster response.

Thanks
Petre
0
Comment
Question by:Syberye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 20

Expert Comment

by:BuggyCoder
ID: 37723828
share the query, its always nice to build queries rather than asking LINQ to help you out with that since it will take its own time processing the query and building it for you.

Share the query so that we can fix the performance issue if possible....

For the time bieng here is example of join using LINQ to SQL:-
http://code.msdn.microsoft.com/Linq-to-SQL-Join-Example-02180bee
0
 

Author Comment

by:Syberye
ID: 37724070
Sorry

Now we use like this:

var eData = dataServiceContext.platform_encoding_profiles.Expand("encoding_profiles").Where(finalWhere);

dataServiceContext - is WCF Data Service
finalWhere - is some lamba expresion use "p => p.platform_id == platformID"

the problem is that we have a wery slow answer from a table with 1000 rows

I read tha if I use Linq espresion like, look down, will be more faster.
var a = from p in platforms
      join pe in platform_encoding_profiles on p.id equals pe.platform_id
                where p.name.Contains("a") && pe.active.Equals(1) select new {p.name, pe.active }
I test this Linq select using LinqPad and I get this error: "The method 'Join' is not supported "

What can I do, or how can I do to use this kind of select ower WCF Data Service

Best regards
Petre
0
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 37725263
Can you try this query and see if it works.

var a  = (from p in platforms
            join pe in platform_encoding_profiles
            on p.id equals pe.platform_id
            into pg
           from pe in pg.DefaultifEmpty()
           select new {
                    Name = p.name,
                    State = pe.active
                    }).Where (p.name.Contains("a") && pe.active.Equals(1));
0
 

Accepted Solution

by:
Syberye earned 0 total points
ID: 38349672
We eliminate the WCF service
0
 

Author Closing Comment

by:Syberye
ID: 38362787
not a true solution
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question