mirror of https://github.com/abpframework/abp.git
19 changed files with 232 additions and 15 deletions
@ -0,0 +1,14 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.ObjectExtending; |
||||
|
|
||||
|
namespace Volo.Abp.EntityFrameworkCore.Modeling |
||||
|
{ |
||||
|
public static class AbpModelBuilderExtensions |
||||
|
{ |
||||
|
public static void TryConfigureObjectExtensions<TDbContext>(this ModelBuilder modelBuilder) |
||||
|
where TDbContext : DbContext |
||||
|
{ |
||||
|
ObjectExtensionManager.Instance.ConfigureEfCoreDbContext<TDbContext>(modelBuilder); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
using System; |
||||
|
using JetBrains.Annotations; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
||||
|
|
||||
|
namespace Volo.Abp.ObjectExtending |
||||
|
{ |
||||
|
public class ObjectExtensionInfoEfCoreMappingOptions |
||||
|
{ |
||||
|
[NotNull] |
||||
|
public ObjectExtensionInfo ObjectExtension { get; } |
||||
|
|
||||
|
[CanBeNull] |
||||
|
public Action<EntityTypeBuilder> EntityTypeBuildAction { get; set; } |
||||
|
|
||||
|
[CanBeNull] |
||||
|
public Action<ModelBuilder> ModelBuildAction { get; set; } |
||||
|
|
||||
|
public ObjectExtensionInfoEfCoreMappingOptions( |
||||
|
[NotNull] ObjectExtensionInfo objectExtension, |
||||
|
[NotNull] Action<EntityTypeBuilder> entityTypeBuildAction) |
||||
|
{ |
||||
|
ObjectExtension = Check.NotNull(objectExtension, nameof(objectExtension)); |
||||
|
EntityTypeBuildAction = Check.NotNull(entityTypeBuildAction, nameof(entityTypeBuildAction)); |
||||
|
|
||||
|
EntityTypeBuildAction = entityTypeBuildAction; |
||||
|
} |
||||
|
|
||||
|
public ObjectExtensionInfoEfCoreMappingOptions( |
||||
|
[NotNull] ObjectExtensionInfo objectExtension, |
||||
|
[NotNull] Action<ModelBuilder> modelBuildAction) |
||||
|
{ |
||||
|
ObjectExtension = Check.NotNull(objectExtension, nameof(objectExtension)); |
||||
|
ModelBuildAction = Check.NotNull(modelBuildAction, nameof(modelBuildAction)); |
||||
|
|
||||
|
ModelBuildAction = modelBuildAction; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue