6 changed files with 82 additions and 8 deletions
@ -0,0 +1,11 @@ |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace LINGYUN.Abp.AIManagement; |
|||
public static class AbpAIManagementDbProperties |
|||
{ |
|||
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; |
|||
|
|||
public static string? DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; |
|||
|
|||
public const string ConnectionStringName = "AbpAIManagement"; |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.AIManagement; |
|||
|
|||
public class AbpAIManagementDomainSharedModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.AIManagement.EntityFrameworkCore; |
|||
|
|||
[ConnectionStringName(AbpAIManagementDbProperties.ConnectionStringName)] |
|||
public class AIManagementDbContext : AbpDbContext<AIManagementDbContext>, IAIManagementDbContext |
|||
{ |
|||
public AIManagementDbContext( |
|||
DbContextOptions<AIManagementDbContext> options) : base(options) |
|||
{ |
|||
} |
|||
|
|||
protected override void OnModelCreating(ModelBuilder builder) |
|||
{ |
|||
base.OnModelCreating(builder); |
|||
|
|||
builder.ConfigureAIManagement(); |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using JetBrains.Annotations; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Volo.Abp; |
|||
using Volo.Abp.EntityFrameworkCore.Modeling; |
|||
|
|||
namespace LINGYUN.Abp.AIManagement.EntityFrameworkCore; |
|||
public static class AIManagementDbContextModelBuilderExtensions |
|||
{ |
|||
public static void ConfigureAIManagement( |
|||
[NotNull] this ModelBuilder builder) |
|||
{ |
|||
Check.NotNull(builder, nameof(builder)); |
|||
|
|||
if (builder.IsTenantOnlyDatabase()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
builder.TryConfigureObjectExtensions<AIManagementDbContext>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace LINGYUN.Abp.AIManagement.EntityFrameworkCore; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpAIManagementDomainModule), |
|||
typeof(AbpEntityFrameworkCoreModule))] |
|||
public class AbpAIManagementEntityFrameworkCoreModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAbpDbContext<AIManagementDbContext>(options => |
|||
{ |
|||
options.AddDefaultRepositories<IAIManagementDbContext>(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
|
|||
namespace LINGYUN.Abp.AIManagement.EntityFrameworkCore; |
|||
|
|||
[ConnectionStringName(AbpAIManagementDbProperties.ConnectionStringName)] |
|||
public interface IAIManagementDbContext : IEfCoreDbContext |
|||
{ |
|||
|
|||
} |
|||
Loading…
Reference in new issue