Entity Framework Core生成的存储过程在MySQL中需要进行处理及PMC中的常用命令
在使用Entity Framework Core生成MySQL数据库脚本,对于生成的存储过程,在执行的过程中出现错误,需要在存储过程前面添加
delimiter //
附:可以使用Visual Studio中的程序包管理器控制台执行Entity Framework Core中的迁移命令。
| PMC Command | Usage |
|---|---|
| Get-Help entityframework | 显示有关实体框架命令的信息。 |
| Add-migraion <migration name> | 通过添加迁移快照来创建迁移。 |
| Remove-Migration | 删除最后一个迁移快照。 |
| Update-Database | 根据上一个迁移快照更新数据库架构。 |
| Script-Migration | 使用所有迁移快照生成SQL脚本。 |
| Scaffold-DbContext | 为指定的数据库生成DbContext和实体类型类。这称为逆向工程。 |
| Get-DbContext | 获取有关DbContext类型的信息。 |
| Drop-Database | 删除数据库。 |
命令详解:
Get-Help
PM> get-help entityframework
_/\__
---==/ \\
___ ___ |. \|\
| __|| __| | ) \\\
| _| | _| \_/ | //|\\
|___||_| / \\\/\\
TOPIC
about_EntityFrameworkCore
SHORT DESCRIPTION
Provides information about the Entity Framework Core Package Manager Console Tools.
LONG DESCRIPTION
This topic describes the Entity Framework Core Package Manager Console Tools.
See https://docs.efproject.net for information on Entity Framework Core.
The following Entity Framework Core commands are available.
Cmdlet Description
-------------------------- ---------------------------------------------------
Add-Migration Adds a new migration.
Drop-Database Drops the database.
Get-DbContext Gets information about a DbContext type.
Remove-Migration Removes the last migration.
Scaffold-DbContext Scaffolds a DbContext and entity types for a database.
Script-Migration Generates a SQL script from migrations.
Update-Database Updates the database to a specified migration.
SEE ALSO
Add-Migration
Drop-Database
Get-DbContext
Remove-Migration
Scaffold-DbContext
Script-Migration
Update-Database
Add-Migration
NAME
Add-Migration
SYNOPSIS
Adds a new migration.
SYNTAX
Add-Migration [-Name] <String> [-OutputDir <String>] [-Context <String>] [-Project <String>]
[-StartupProject <String>] [<CommonParameters>]
DESCRIPTION
Adds a new migration.
REMARKS
To see the examples, type: "get-help Add-Migration -examples".
For more information, type: "get-help Add-Migration -detailed".
For technical information, type: "get-help Add-Migration -full".
Remove-Migration
NAME
Remove-Migration
SYNOPSIS
Removes the last migration.
SYNTAX
Remove-Migration [-Force] [-Context <String>] [-Project <String>] [-StartupProject <String>]
[<CommonParameters>]
DESCRIPTION
Removes the last migration.
RELATED LINKS
Add-Migration
about_EntityFrameworkCore
REMARKS
To see the examples, type: "get-help Remove-Migration -examples".
For more information, type: "get-help Remove-Migration -detailed".
For technical information, type: "get-help Remove-Migration -full".
Update-Database
NAME
Update-Database
SYNOPSIS
Updates the database to a specified migration.
SYNTAX
Update-Database [[-Migration] <String>] [-Context <String>] [-Project <String>]
[-StartupProject <String>] [<CommonParameters>]
DESCRIPTION
Updates the database to a specified migration.
RELATED LINKS
Script-Migration
about_EntityFrameworkCore
REMARKS
To see the examples, type: "get-help Update-Database -examples".
For more information, type: "get-help Update-Database -detailed".
For technical information, type: "get-help Update-Database -full".
Script-migration
NAME
Script-Migration
SYNOPSIS
Generates a SQL script from migrations.
SYNTAX
Script-Migration [-From] <String> [-To] <String> [-Idempotent] [-Output <String>]
[-Context <String>] [-Project <String>] [-StartupProject <String>]
[<CommonParameters>]
Script-Migration [[-From] <String>] [-Idempotent] [-Output <String>] [-Context <String>]
[-Project <String>] [-StartupProject <String>] [<CommonParameters>]
DESCRIPTION
Generates a SQL script from migrations.
RELATED LINKS
Update-Database
about_EntityFrameworkCore
REMARKS
To see the examples, type: "get-help Script-Migration -examples".
For more information, type: "get-help Script-Migration -detailed".
For technical information, type: "get-help Script-Migration -full".
scaffold-dbcontext
NAME
Scaffold-DbContext
SYNOPSIS
Scaffolds a DbContext and entity types for a database.
SYNTAX
Scaffold-DbContext [-Connection] <String> [-Provider] <String> [-OutputDir <String>]
[-Context <String>] [-Schemas <String[]>] [-Tables <String[]>]
[-DataAnnotations] [-Force] [-Project <String>] [-StartupProject <String>]
[<CommonParameters>]
DESCRIPTION
Scaffolds a DbContext and entity types for a database.
RELATED LINKS
about_EntityFrameworkCore
REMARKS
To see the examples, type: "get-help Scaffold-DbContext -examples".
For more information, type: "get-help Scaffold-DbContext -detailed".
For technical information, type: "get-help Scaffold-DbContext -full".
Get-DbContext
NAME
Get-DbContext
SYNOPSIS
Gets information about a DbContext type.
SYNTAX
Get-DbContext [-Context <String>] [-Project <String>] [-StartupProject <String>]
[<CommonParameters>]
DESCRIPTION
Gets information about a DbContext type.
RELATED LINKS
about_EntityFrameworkCore
REMARKS
To see the examples, type: "get-help Get-DbContext -examples".
For more information, type: "get-help Get-DbContext -detailed".
For technical information, type: "get-help Get-DbContext -full".
Drop-Database
NAME
Drop-Database
SYNOPSIS
Drops the database.
SYNTAX
Drop-Database [-Context <String>] [-Project <String>] [-StartupProject <String>]
[-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
Drops the database.
RELATED LINKS
Update-Database
about_EntityFrameworkCore
REMARKS
To see the examples, type: "get-help Drop-Database -examples".
For more information, type: "get-help Drop-Database -detailed".
For technical information, type: "get-help Drop-Database -full".
get-help命令执行结果:

分享一个关于Entity Framework的网站,希望对大家有帮助:
https://www.entityframeworktutorial.net/
Entity Framework Core生成的存储过程在MySQL中需要进行处理及PMC中的常用命令的更多相关文章
- Entity Framework Core 生成跟踪列
本文翻译自<Entity Framework Core: Generate tracking columns>,由于水平有限,故无法保证翻译完全正确,欢迎指出错误.谢谢! 注意:我使用的是 ...
- entity framework core 生成 postgresql 数据库实体
.net core 2.0 使用db first 方式生成 表 和context PM 控制台运行命令出错 Scaffold-DbContext "Host=localhost;Databa ...
- Entity Framework Core 生成跟踪列-阴影属性
摘自:https://www.cnblogs.com/tdfblog/p/entity-framework-core-generate-tracking-columns.html Ef Core 官方 ...
- 被Entity Framework Core的细节改进震撼了一下
今天用 SQL Server Profiler 查看 Entity Framework Core 生成的 SQL 语句时,突然发现一个细节改进,并且被它震撼了一下: exec sp_executesq ...
- 创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表
创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表 创建数据模型类(POCO类) 在Models文件夹下添 ...
- Entity Framework Core 执行SQL语句和存储过程
无论ORM有多么强大,总会出现一些特殊的情况,它无法满足我们的要求.在这篇文章中,我们介绍几种执行SQL的方法. 表结构 在具体内容开始之前,我们先简单说明一下要使用的表结构. public clas ...
- Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制
将通用的序列号生成器库 从SQL Server迁移到Mysql 遇到的一个问题,就是TimeStamp/RowVersion并发控制类型在非Microsoft SQL Server数据库中的实现.SQ ...
- 全球首发免费的MySql for Entity Framework Core
from:http://www.1234.sh/post/pomelo-data-mysql?utm_source=tuicool&utm_medium=referral Source 源代码 ...
- Entity Framework Core 使用HiLo生成主键
#cnblogs_post_body.cnblogs-markdown p img { max-width: 95%; } HiLo是在NHiernate中生成主键的一种方式,不过现在我们可以在Ent ...
随机推荐
- 你绝对不知道的head标签
先来梳理一下本文的目录结构 现在我将详解head标签和它六个子标签的属性和作用,请耐心看完,会有很大的收获哦! 一.head标签 可选属性: 属性 值 描述 profile URL 一个由空格分隔的 ...
- Delphi - Indy 创建邮件自动发送服务
服务器自动邮件线程 功能:此程序主要实现对Oracle数据库表tableName(存放需要发送邮件的相关信息)里面相关信息的邮件发送. 优点:开发人员可以直接再数据库后台对tableName表进行插入 ...
- Requests方法 -- 参数关联与JSESSION(上一个接口的返回数据作为下一个接口的请求参数)
前言 参数关联是接口测试和性能测试最为重要的一个步骤,很多接口的请求参数是动态的,并且需要从上一个接口的返回值里面取出来,一般只能用一次就失效了.最常见的案例就是网站的登录案例,很多网站的登录并不仅仅 ...
- 【故障公告】升级阿里云 RDS SQL Server 实例故障经过
昨天晚上,我们使用的阿里云 RDS SQL Server 2008 R2 实例突然出现持续 CPU 100% 问题,后来我们通过重启实例恢复了正常(详见故障公告).但是在恢复正常后发现了新问题,这台 ...
- 2019 Multi-University Training Contest 5
2019 Multi-University Training Contest 5 A. fraction upsolved 题意 输入 \(x,p\),输出最小的 \(b\) 使得 \(bx\%p&l ...
- POJ 1002 487-3279 map
487-3279 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 287874 Accepted: 51669 Descr ...
- poj 1661 Help Jimmy(记忆化搜索)
题目链接:http://poj.org/problem?id=1661 一道还可以的记忆化搜索题,主要是要想到如何设dp,记忆化搜索是避免递归过程中的重复求值,所以要得到dp必须知道如何递归 由于这是 ...
- 牛客小白月赛5 D 阶乘 数学
链接:https://www.nowcoder.com/acm/contest/135/D来源:牛客网 题目描述 输入描述: 输入数据共一行,一个正整数n,意义如“问题描述”. 输出描述: 输出一行描 ...
- SPOJ - QTREE(树链剖分+单点更新+区间最大值查询)
题意:给出n个点n-1条边的树,有两个操作,一个是查询节点l到r的边的最大值,然后指定边的更改权值. 题解:差不多是树链剖分的模版题,注意每个点表示的边是连向其父亲节点的边. #include < ...
- 【Offer】[23] 【链表中环的入口结点】
题目描述 思路分析 测试用例 Java代码 代码链接 题目描述 一个链表中包含环,如何找出环的入口结点?  思路分析 判断链表中是否有环:用快慢指针的方法,慢指针走一步,快指针走两步,如果快指针追上 ...