Update mongodb

This commit is contained in:
sunkaixuan
2025-05-04 14:02:50 +08:00
parent 1c55ba1929
commit f32f86ad35
9 changed files with 284 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
using Npgsql;
using SqlSugar.MongoDbCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace MongoDbTest
{
public class ExpTest
{
public static void Init()
{
Expression<Func<Order, bool>> exp = it=>it.Id==1||it.Name=="a";
var json=MongoNestedTranslator.Translate(exp);
var Order = new Order() { Id = 1 };
Expression<Func<Order, bool>> exp2 = it => it.Id == Order.Id || it.Name == "a";
var json2 = MongoNestedTranslator.Translate(exp2);
}
}
public class Order
{
public int Id { get; set; }
public string Name { get; set; }
public bool IsValidate { get; set; }
}
}

View File

@@ -9,6 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\MongoDb.Ado.data\MongoDb.Ado.data.csproj" />
<ProjectReference Include="..\SqlSugar.MongoDbCore\SqlSugar.MongoDbCore.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,4 +1,5 @@
using MongoDbTest;
//开发中
AdoTest.Init();
ExpTest.Init();
Console.WriteLine("执行完成");