对比新文件 |
| | |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore.Extensions; |
| | | using CMS.Plugin.HIAWms.Domain; |
| | | using CMS.Plugin.HIAWms.EntityFrameworkCore; |
| | | using Microsoft.EntityFrameworkCore; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.EntityFrameworkCore; |
| | | using Volo.Abp.EntityFrameworkCore.Modeling; |
| | | |
| | | namespace CMS.Plugin.HIAWms.MySQL; |
| | | |
| | | /// <summary> |
| | | /// 鏁版嵁搴撲笂涓嬫枃 |
| | | /// </summary> |
| | | [ConnectionStringName(CMSPluginDbProperties.ConnectionStringName)] |
| | | public class CMSPluginDbContext : AbpDbContext<CMSPluginDbContext>, ICMSPluginDbContext |
| | | { |
| | | /* Add DbSet properties for your Aggregate Roots / Entities here. */ |
| | | |
| | | /// <summary> |
| | | /// Initializes a new instance of the <see cref="CMSPluginDbContext"/> class. |
| | | /// </summary> |
| | | /// <param name="options">The options.</param> |
| | | public CMSPluginDbContext(DbContextOptions<CMSPluginDbContext> options) |
| | | : base(options) |
| | | { |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | protected override void OnModelCreating(ModelBuilder builder) |
| | | { |
| | | base.OnModelCreating(builder); |
| | | |
| | | /* Include modules to your migration db context */ |
| | | |
| | | builder.ConfigureWmsContainer(); |
| | | builder.ConfigureWmsStore(); |
| | | builder.ConfigureWmsArea(); |
| | | builder.ConfigureWmsPlace(); |
| | | builder.ConfigureWmsMaterial(); |
| | | |
| | | /* Configure your own tables/entities inside here */ |
| | | |
| | | //builder.Entity<YourEntity>(b => |
| | | //{ |
| | | // b.ToTable(CMSPluginDbProperties.DbTablePrefix + "YourEntities", CMSPluginDbProperties.DbSchema); |
| | | // b.ConfigureByConvention(); //auto configure for the base class props |
| | | // //... |
| | | //}); |
| | | |
| | | builder.TryConfigureObjectExtensions<CMSPluginDbContext>(); |
| | | } |
| | | } |