|
|
@ -7,7 +7,6 @@ using Volo.Abp.Data; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.EntityFrameworkCore.ValueComparers; |
|
|
using Volo.Abp.EntityFrameworkCore.ValueComparers; |
|
|
using Volo.Abp.EntityFrameworkCore.ValueConverters; |
|
|
using Volo.Abp.EntityFrameworkCore.ValueConverters; |
|
|
using Volo.Abp.MultiLingualObject; |
|
|
|
|
|
using Volo.Abp.MultiTenancy; |
|
|
using Volo.Abp.MultiTenancy; |
|
|
using Volo.Abp.ObjectExtending; |
|
|
using Volo.Abp.ObjectExtending; |
|
|
|
|
|
|
|
|
@ -29,7 +28,6 @@ namespace Volo.Abp.EntityFrameworkCore.Modeling |
|
|
b.TryConfigureLastModificationTime(); |
|
|
b.TryConfigureLastModificationTime(); |
|
|
b.TryConfigureModificationAudited(); |
|
|
b.TryConfigureModificationAudited(); |
|
|
b.TryConfigureMultiTenant(); |
|
|
b.TryConfigureMultiTenant(); |
|
|
b.TryConfigureEntityTranslation(); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void ConfigureConcurrencyStamp<T>(this EntityTypeBuilder<T> b) |
|
|
public static void ConfigureConcurrencyStamp<T>(this EntityTypeBuilder<T> b) |
|
|
@ -304,25 +302,6 @@ namespace Volo.Abp.EntityFrameworkCore.Modeling |
|
|
b.As<EntityTypeBuilder>().TryConfigureConcurrencyStamp(); |
|
|
b.As<EntityTypeBuilder>().TryConfigureConcurrencyStamp(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void ConfigureMultiLingual<T, TTranslation>(this EntityTypeBuilder<T> b) |
|
|
|
|
|
where T : class, IHasMultiLingual<TTranslation> |
|
|
|
|
|
where TTranslation : class, IMultiLingualTranslation |
|
|
|
|
|
{ |
|
|
|
|
|
b.As<EntityTypeBuilder>().TryConfigureEntityTranslation(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void TryConfigureEntityTranslation(this EntityTypeBuilder b) |
|
|
|
|
|
{ |
|
|
|
|
|
if (b.Metadata.ClrType.IsAssignableTo<IMultiLingualTranslation>()) |
|
|
|
|
|
{ |
|
|
|
|
|
b.HasIndex(nameof(IMultiLingualTranslation.Language)) |
|
|
|
|
|
.IsUnique(); |
|
|
|
|
|
b.Property(nameof(IMultiLingualTranslation.Language)) |
|
|
|
|
|
.IsRequired() |
|
|
|
|
|
.HasColumnName(nameof(IMultiLingualTranslation.Language)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//TODO: Add other interfaces (IAuditedObject<TUser>...)
|
|
|
//TODO: Add other interfaces (IAuditedObject<TUser>...)
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|