mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 02:32:50 +08:00
update
This commit is contained in:
parent
e3c0f615f9
commit
6c64eac419
@ -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"":""泰州"",
|
||||||
|
@ -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>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user