2023年7月18日发(作者:)
⼆、coreabp数据库迁移⼀、数据库迁移-ABP(库)1、配置链接数据库: 贴以下代码:{ "ConnectionStrings": { "Default": "Server=47.101.53.168;database=ABP_mytest;user=xx;password=vs..127134;" }, "Authentication": { "JwtBearer": { "IsEnabled": "true", "SecurityKey": "CoreABP_C421AAEE0D114E9C", "Issuer": "CoreABP", "Audience": "CoreABP" } }, "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Debug", "System": "Information", "Microsoft": "Information" } }} 2、迁移实践选择程序包源以及类库为.EntityFrameworkCore 执⾏命令:迁移命令:Add-Migration InitialCreat //对⽐当前数据库和模型的差异,⽣成相应的迁移类代码,使数据库和模型匹配的。Update-Database 迁移命令集合:Update-Database -verbose //更新数据库 3、查看数据库是否成功
选中Mvc 点击运⾏账号 admin 密码123qwe
⼆、数据库迁移-项⽬(库)1、创建实体(.Core类库内创建⼀个存放项⽬表的⽂件夹 存放⼀个表⼀个类⽂件)using ng;using es;using System;using c;using ;using ;using ;using ;namespace ic{ [Table("Academic")] [Audited] public class Academic : Entity, IMayHaveTenant { public int? TenantId { get; set; } public virtual string Name { get; set; } }} 2、.EntityFrameworkCore类库->EntityFrameworkCore⽂件夹->Repositories⽂件夹->上下⽂数据库操作类 添加例如: public virtual DbSet
发布者:admin,转转请注明出处:http://www.yc00.com/web/1689643938a273297.html
评论列表(0条)