This commit is contained in:
sunkaixuan 2023-03-18 14:15:33 +08:00
parent 9efde36f3b
commit 05cabec728
3 changed files with 22 additions and 2 deletions

View File

@ -61,6 +61,12 @@ namespace OrmTest
names = $"as{it.Id}fd{it.Id}a" names = $"as{it.Id}fd{it.Id}a"
}) })
.ToList(); .ToList();
db.CodeFirst.InitTables<BoolTest>();
db.Queryable<BoolTest>().OrderBy(it => it.bb ).ToList();
db.Queryable<BoolTest>().OrderByDescending(it => it.bb).ToList();
db.Queryable<BoolTest>().OrderBy(it => new { it.bb }).ToList();
db.Queryable<BoolTest>().OrderBy(it => new { x=SqlFunc.Desc(it.bb) }).ToList();
db.Queryable<BoolTest>().OrderByDescending(it => new { it.bb }).ToList();
Console.WriteLine("#### Examples End ####"); Console.WriteLine("#### Examples End ####");
} }

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OrmTest
{
public class BoolTest
{
public bool bb { get; set; }
}
}

View File

@ -67,6 +67,7 @@
<Compile Include="Demo\DemoJ_Report.cs" /> <Compile Include="Demo\DemoJ_Report.cs" />
<Compile Include="Demo\DemoN_SplitTable.cs" /> <Compile Include="Demo\DemoN_SplitTable.cs" />
<Compile Include="Models\AttributeTable.cs" /> <Compile Include="Models\AttributeTable.cs" />
<Compile Include="Models\BoolTest.cs" />
<Compile Include="Models\CarType.cs" /> <Compile Include="Models\CarType.cs" />
<Compile Include="Models\Custom.cs" /> <Compile Include="Models\Custom.cs" />
<Compile Include="Models\EntityMapper.cs" /> <Compile Include="Models\EntityMapper.cs" />