Synchronization code

This commit is contained in:
sunkaixuan
2023-11-30 04:37:34 +08:00
parent 56e26baac3
commit 88ab4255f8
3 changed files with 32 additions and 1 deletions

View File

@@ -24,7 +24,16 @@ namespace SqlSugar
foreach (PropertyMetadata property in properties)
{
EmitTool.CreateProperty(typeBuilder, property.Name, property.Type, property.CustomAttributes);
var type = property.Type;
if (type == typeof(DynamicOneselfType))
{
type = typeBuilder;
}
else if (type == typeof(DynamicOneselfTypeList))
{
type = typeof(List<>).MakeGenericType(typeBuilder);
}
EmitTool.CreateProperty(typeBuilder, property.Name, type, property.CustomAttributes);
}
Type dynamicType = typeBuilder.CreateTypeInfo().AsType();

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace SqlSugar
{
/// <summary>
/// Dynamically construct Type, the property is self, with this type
/// </summary>
public class DynamicOneselfType
{
}
/// <summary>
/// Dynamically construct Type, the property is List self , with this type
/// </summary>
public class DynamicOneselfTypeList
{
}
}

View File

@@ -91,6 +91,7 @@
<Compile Include="Abstract\DeleteProvider\SplitTableDeleteProvider.cs" />
<Compile Include="Abstract\DeleteProvider\DeleteablePage.cs" />
<Compile Include="Abstract\DynamicBuilder\CommonMethodInfo.cs" />
<Compile Include="Abstract\DynamicBuilder\DynamicOneselfType.cs" />
<Compile Include="Abstract\DynamicBuilder\DynamicProperyBuilder.cs" />
<Compile Include="Abstract\DynamicBuilder\Helper.cs" />
<Compile Include="Abstract\DynamicBuilder\EmitTool.cs" />