|
|
|
@ -3,27 +3,33 @@ |
|
|
|
@using Volo.Abp.ObjectExtending |
|
|
|
@using Volo.Abp.Localization |
|
|
|
@using Volo.Abp.Data |
|
|
|
@using Newtonsoft.Json |
|
|
|
|
|
|
|
@foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<TEntityType>()) |
|
|
|
{ |
|
|
|
if (!propertyInfo.Name.EndsWith("_Text")) |
|
|
|
@{ |
|
|
|
Entity.SetDefaultsForExtraProperties(); |
|
|
|
|
|
|
|
foreach (var propertyInfo in ObjectExtensionManager.Instance.GetProperties<TEntityType>()) |
|
|
|
{ |
|
|
|
if (propertyInfo.Type.IsEnum) |
|
|
|
{ |
|
|
|
<SelectExtensionProperty PropertyInfo="@propertyInfo" Entity="@Entity" TEntity="TEntityType" TResourceType="TResourceType" /> |
|
|
|
} |
|
|
|
else if (!propertyInfo.Lookup.Url.IsNullOrEmpty()) |
|
|
|
{ |
|
|
|
<LookupExtensionProperty PropertyInfo="@propertyInfo" Entity="@Entity" TEntity="TEntityType" TResourceType="TResourceType" /> |
|
|
|
} |
|
|
|
else |
|
|
|
if (!propertyInfo.Name.EndsWith("_Text")) |
|
|
|
{ |
|
|
|
var inputType = propertyInfo.GetInputType(); |
|
|
|
if (propertyInfo.Type.IsEnum) |
|
|
|
{ |
|
|
|
<SelectExtensionProperty PropertyInfo="@propertyInfo" Entity="@Entity" TEntity="TEntityType" TResourceType="TResourceType" /> |
|
|
|
} |
|
|
|
else if (!propertyInfo.Lookup.Url.IsNullOrEmpty()) |
|
|
|
{ |
|
|
|
<LookupExtensionProperty PropertyInfo="@propertyInfo" Entity="@Entity" TEntity="TEntityType" TResourceType="TResourceType" /> |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var inputType = propertyInfo.GetInputType(); |
|
|
|
|
|
|
|
__builder.OpenComponent(0, inputType.MakeGenericType(new[] { typeof(TEntityType), typeof(TResourceType) })); |
|
|
|
__builder.AddAttribute(1, "PropertyInfo", propertyInfo); |
|
|
|
__builder.AddAttribute(2, "Entity", Entity); |
|
|
|
__builder.CloseComponent(); |
|
|
|
Console.WriteLine(JsonConvert.SerializeObject(propertyInfo)); |
|
|
|
__builder.OpenComponent(0, inputType.MakeGenericType(new[] { typeof(TEntityType), typeof(TResourceType) })); |
|
|
|
__builder.AddAttribute(1, "PropertyInfo", propertyInfo); |
|
|
|
__builder.AddAttribute(2, "Entity", Entity); |
|
|
|
__builder.CloseComponent(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|