• Abpvnext笔记


    1,依赖注入

    EntityframeworkDemoSchemaDbMigrator : IDemoSchemaDbMigrator, ITransientDependency
    约定:实现类后面的命令必须包含DemoSchemaDbMigrator

    2,appsettings.json

    ①始终复制

      <ItemGroup>
        <Content Include="appsettings.json">
          <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
          <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </Content>
      </ItemGroup>

    ②嵌入的资源

      <ItemGroup>
        <None Remove="TemplatesFilesHello.tpl" />
        <EmbeddedResource Include="TemplatesFilesHello.tpl" />
      </ItemGroup>
      <ItemGroup>
        <EmbeddedResource Include="LocalizationFiles*.json" />
        <Content Remove="LocalizationFiles*.json" />
      </ItemGroup>

    3,迁移程序执行流程

    4,Hw_ScheduDbContextModelCreatingExtensions

                 builder.Entity<TaskInfo>(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);
                });
    学习永不止境,技术成就梦想。
  • 相关阅读:
    P2018 消息传递[dp]
    P1436 棋盘分割[dp]
    一条线段引发的思考
    浅谈树上差分
    P2680 运输计划[二分+LCA+树上差分]
    P1600 天天爱跑步[桶+LCA+树上差分]
    P4560 [IOI2014]Wall 砖墙
    P1311 选择客栈[模拟]
    P1314 聪明的质监员[二分答案]
    Linux snmp导入MIB库
  • 原文地址:https://www.cnblogs.com/zd1994/p/14329307.html
Copyright © 2020-2023  润新知