diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom01.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom01.cs index 6f10d2255..1673b6fae 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom01.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom01.cs @@ -55,6 +55,14 @@ namespace OrmTest var x4 = db.Queryable().Where(it =>SqlFunc.HasValue(it.name) == true).ToList(); var x5 = db.Queryable().Where(it => SqlFunc.HasValue(it.name) ).ToList(); var x6 = db.Queryable().Select(it => new { x=SqlFunc.HasValue(it.name)}).ToList(); + db.CurrentConnectionConfig.MoreSettings = new ConnMoreSettings() + { + IsWithNoLockQuery=true + }; + var sql=db.Queryable().LeftJoin((z, y) => z.Id == y.Id).ToSql().Key; + if (!sql.Contains(SqlWith.NoLock)) { throw new Exception("unit error"); } + var sql2=db.SqlQueryable("select * from [Order]").With(SqlWith.Null).LeftJoin((z, y) => z.Id == y.OrderId).ToSql().Key; + if (sql2.Contains(SqlWith.NoLock)) { throw new Exception("unit error"); } db.DbMaintenance.DropTable("BoolTest12313"); }