This commit is contained in:
28810 2019-04-19 16:46:55 +08:00
parent e3c0f615f9
commit 6c64eac419
2 changed files with 11 additions and 1 deletions

View File

@ -7,6 +7,7 @@ using System.Linq;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using NpgsqlTypes; using NpgsqlTypes;
using Npgsql.LegacyPostgis; using Npgsql.LegacyPostgis;
using System.Linq.Expressions;
namespace FreeSql.Tests { namespace FreeSql.Tests {
public class UnitTest1 { public class UnitTest1 {
@ -53,6 +54,15 @@ namespace FreeSql.Tests {
[Fact] [Fact]
public void Test1() { public void Test1() {
Expression<Func<TestInfo, object>> orderBy = null;
orderBy = a => a.CreateTime;
var testsql1 = select.OrderBy(orderBy).ToSql();
orderBy = a => a.Title;
var testsql2 = select.OrderBy(orderBy).ToSql();
var testjson = @"[ var testjson = @"[
{ {
""acptNumBelgCityName"":"""", ""acptNumBelgCityName"":"""",

View File

@ -95,7 +95,7 @@ var t5 = fsql.Select<Song>s.OrderBy(a => Guid.NewGuid()).Limit(1).ToList();
> dotnet add package FreeSql.Repository > dotnet add package FreeSql.Repository
```csharp ```csharp
using (var unitOfWork = fsql.CreateUnitOfWork()) { using (var uow = fsql.CreateUnitOfWork()) {
var songRepository = uow.GetRepository<Song, int>(); var songRepository = uow.GetRepository<Song, int>();
var tagRepository = uow.GetRepository<Tag, int>(); var tagRepository = uow.GetRepository<Tag, int>();