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

@ -55,12 +55,18 @@ namespace OrmTest
{
names = SqlFunc.Subqueryable<Order>().Where(z => z.Id == it.Id).SelectStringJoin(z => z.Name, ",")
})
.ToList();
.ToList();
var test08 = db.Queryable<Order>().Select(it => new
{
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 ####");
}

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\DemoN_SplitTable.cs" />
<Compile Include="Models\AttributeTable.cs" />
<Compile Include="Models\BoolTest.cs" />
<Compile Include="Models\CarType.cs" />
<Compile Include="Models\Custom.cs" />
<Compile Include="Models\EntityMapper.cs" />