点这里进入ABP入门教程目录 

在基础设施层(即JD.CRS.EntityFrameworkCore)打开数据库环境设置

JD.CRS.EntityFrameworkCore/EntityFrameworkCore/CRSDbContext.cs
添加一行

public DbSet<Course> Course { get; set; } //创建数据表Course

 1 using Microsoft.EntityFrameworkCore;
 2 using Abp.Zero.EntityFrameworkCore;
 3 using JD.CRS.Authorization.Roles;
 4 using JD.CRS.Authorization.Users;
 5 using JD.CRS.MultiTenancy;
 6 using JD.CRS.Entitys;
 7 
 8 namespace JD.CRS.EntityFrameworkCore
 9 {
10     public class CRSDbContext : AbpZeroDbContext<Tenant, Role, User, CRSDbContext>
11     {
12         /* Define a DbSet for each entity of the application */
13         
14         public CRSDbContext(DbContextOptions<CRSDbContext> options)
15             : base(options)
16         {
17         }
18 
19         public DbSet<Course> Course { get; set; }
20     
21     }
22 }
View Code

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-06-30
  • 2022-01-10
  • 2021-05-08
猜你喜欢
  • 2022-01-12
  • 2021-08-04
  • 2021-07-10
  • 2021-09-29
  • 2021-07-23
  • 2021-12-10
  • 2021-11-04
相关资源
相似解决方案