Abpvnext笔记
1,依赖注入
EntityframeworkDemoSchemaDbMigrator : IDemoSchemaDbMigrator, ITransientDependency 约定:实现类后面的命令必须包含DemoSchemaDbMigrator2,appsettings.json
①始终复制
"appsettings.json"> PreserveNewest Always
②嵌入的资源
"Templates\Files\Hello.tpl" /> "Templates\Files\Hello.tpl" />
"Localization\Files\*.json" /> "Localization\Files\*.json" />
3,迁移程序执行流程
4,Hw_ScheduDbContextModelCreatingExtensions
builder.Entity(b=>{ b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "TaskInfos"); b.ConfigureByConvention(); b.Property(x=>x.Name).HasMaxLength(TaskInfoConsts.MaxNameLength).IsRequired(); b.Property(x=>x.Remark).HasMaxLength(TaskInfoConsts.MaxRemarkLength); b.Property(x=>x.Api).HasMaxLength(TaskInfoConsts.MaxApiLength).IsRequired(); b.Property(x=>x.Cron).HasMaxLength(TaskInfoConsts.MaxCronLength).IsRequired(); b.Property(x=>x.Status).IsRequired(); b.Property(x=>x.SystemInfoId).IsRequired(); b.Property(x=>x.CreationTime).HasColumnType("datetime").HasDefaultValueSql("now()").IsRequired(); b.Property(x=>x.LastModificationTime).HasColumnType("datetime").HasDefaultValueSql("now()").IsRequired(); b.Property(x=>x.DeletionTime).HasColumnType("datetime").HasDefaultValueSql("now()").IsRequired(); b.HasIndex(x=>x.SystemInfoId); });