mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Add user test
This commit is contained in:
parent
b4e1f03ef6
commit
79757b9438
@ -33,6 +33,7 @@ namespace OrmTest
|
|||||||
}
|
}
|
||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
|
Unitdfaatsd2.Init();
|
||||||
Unityadfasasdfa.Init();
|
Unityadfasasdfa.Init();
|
||||||
Unitsdfaafa.Init();
|
Unitsdfaafa.Init();
|
||||||
Unitadfayyadfa.Init();
|
Unitadfayyadfa.Init();
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OrmTest
|
||||||
|
{
|
||||||
|
internal class Unitdfaatsd2
|
||||||
|
{
|
||||||
|
public static void Init()
|
||||||
|
{
|
||||||
|
var db = NewUnitTest.Db;
|
||||||
|
db.CurrentConnectionConfig.ConfigureExternalServices = new ConfigureExternalServices()
|
||||||
|
{
|
||||||
|
EntityService = (type, entity) =>
|
||||||
|
{
|
||||||
|
if (entity.PropertyInfo.PropertyType == typeof(MyValueObject3))
|
||||||
|
{
|
||||||
|
entity.IsOwnsOne = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var cols=db.EntityMaintenance.GetEntityInfo<UnitMyEntity3>();
|
||||||
|
db.CodeFirst.InitTables<UnitMyEntity3>();
|
||||||
|
}
|
||||||
|
[SugarTable("unityyyzzz")]
|
||||||
|
public class UnitMyEntity3
|
||||||
|
{
|
||||||
|
public Guid Id { get; init; }
|
||||||
|
|
||||||
|
public MyValueObject3 ValueObject { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MyValueObject3
|
||||||
|
{
|
||||||
|
[SugarColumn(ColumnName = "VALUEOBJECTID")]
|
||||||
|
public Guid VOId { get; set; }
|
||||||
|
|
||||||
|
[SugarColumn(ColumnName = "VALUEOBJECTNAME")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user