Page 1 of 1

Could EntityFramework provider generate parameterized query?

Posted: Thu 28 Apr 2011 04:24
by sip
Are there any configuration options for Entity Framework provider to customize query generation? Example: for my details queries I'm getting fully defined query in both Prepare/Execute steps (I'm using dbMonitor)

SELECT "GroupBy1".A1 AS C1
FROM ( SELECT Count(1) AS A1
FROM SW_MAIN_DEV.AGENCY_PHONE "Extent1"
WHERE "Extent1".AGENCY_ID = 528
) "GroupBy1"

I want to get query like this in Prepare step:

SELECT "GroupBy1".A1 AS C1
FROM ( SELECT Count(1) AS A1
FROM SW_MAIN_DEV.AGENCY_PHONE "Extent1"
WHERE "Extent1".AGENCY_ID = :pAgencyId
) "GroupBy1"

with the following parameter value substitution on Execute.

Posted: Thu 28 Apr 2011 12:48
by AndreyR
If you are using LINQ to Entities, it is enough to create a variable in your code instead of using a constant in the LINQ query Where clause.

Posted: Thu 28 Apr 2011 18:37
by sip
As I said I'm using EntityFramework and RIA Services. I cannot control how Linq queries are constructed, because it's done automatically by DomainDataSource component. That why I'm asking how sql generated by DevArt EF provider can be customized. Actually it's very important for me, because we have a pretty strict policy in our company regarding what kind of query could be run on Oracle. But I definitely don't want to skip using DomainDataSource, because it improves speed of development.

Posted: Fri 29 Apr 2011 13:56
by AndreyR
We have added a suggestion on our Entity Framework support UserVoice.
Please vote for this and other suggestions, we appreciate feedback provided by our users.