DotNetNext / SqlSugar

.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
https://www.donet5.com/Home/Doc
MIT License
5.24k stars 1.33k forks source link

Why .First() adding ORDER BY DATETIME('now') in query? #1158

Closed zxcvqwerasdf closed 1 year ago

zxcvqwerasdf commented 1 year ago

Question in subject. Example

scope.Queryable<User>().Where(x => x.Name.Length > 5).First()

will be

SELECT `Id`,`Name`,`Password`,`FloatValue`,`DoubleValue`,`IntValue` FROM `User`   WHERE (LENGTH(`Name`)> @Length1 )  ORDER BY DATETIME('now')    LIMIT 0,1

How to properly select only one without ORDER BY?

DotNetNext commented 1 year ago

The source code has been updated and removed order by now(). Nuget will be released soon

DotNetNext commented 1 year ago

Have released , There are still problems to issue a new issue