Orderby clause automatically added

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Posts: 1
Joined: Thu 02 Aug 2012 10:11

Orderby clause automatically added

Post by migus » Thu 02 Aug 2012 12:10


I have the following statement:

Code: Select all

var query = from lck in dataContext.EntityLockSet
                            select new Lock
                                LockId = lck.Id,                              
                                LockDescr = lck.Description,

that generates the following sql:

Code: Select all

		1 AS C1
	)  "Project1"
	[b]ORDER BY "Project1".ID ASC[/b]
)  "top"
Please note the ORDER BY clause that is added automatically at the end of the SQL statement, even the initial statement doesn't have any ORDER BY.

The ORDER BY value is the key property of the entity(defined using DataServiceKey attribute) that the query creates(e.g Lock)

Code: Select all

    public class Lock
        public Guid LockId { get; set; } //key

My question is if there is a setting somewhere in order to disable this "feature"?

I'm using Entity Framework Entity Framework 4.1 and Devart.Data.Oracle 6.80.

Thank you in advance for your answer.

Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: Orderby clause automatically added

Post by Shalex » Tue 07 Aug 2012 10:12

The ORDER BY clause is added by WCF Data Service: http://social.msdn.microsoft.com/Forums ... dcf324075/.

Post Reply