
EntityFrameworkCore
EntityFrameworkCore
easyboot
愿断一切恶,愿修一切善。
展开
-
DBContext设置SQLServer连接字符串
1.修改构造函数using Microsoft.EntityFrameworkCore;using Microsoft.Extensions.Configuration;using System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;namespace WEBAPI.EF{ public class LabelContext:DbContext {...原创 2021-10-13 16:11:17 · 945 阅读 · 0 评论 -
efcore的迁移命令
在包管理控制台输入 get-help about_entityframeworkcore可以查看迁移命令信息原创 2021-03-25 08:10:41 · 195 阅读 · 0 评论 -
.net core 3.1 使用EntityFrameworkcore
首先安装EntityFrameworkcore注意版本5.0.0的不兼容必须装用于运行命令,同样注意版本使用最新版就好使用最新版就好这里可以运行命令执行命令Scaffold-DbContext "server=192.168.1.1;port=3306;user=test;password=123456;database=cloud;" Pomelo.EntityFrameworkCore.MySql -OutputDir Models -Forc...原创 2020-11-13 10:56:18 · 978 阅读 · 0 评论 -
C# 使用EntityFrameworkCore
using com.aaa.Helper;using Microsoft.EntityFrameworkCore;using System.Collections.Generic;using System.ComponentModel.DataAnnotations;namespace com.aaa.Db { public class xcContext : DbContext { public DbSet<xcEquipment> Equipme.原创 2020-09-24 16:52:52 · 515 阅读 · 0 评论