Solved

WCF Data Service Linq select with where condition

Posted on 2012-03-15
5
799 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
  • 3
5 Comments
 
LVL 20

Expert Comment

by:BuggyCoder
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
We eliminate the WCF service
0
 

Author Closing Comment

by:Syberye
Comment Utility
not a true solution
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now