在使用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中的常用命令的更多相关文章

  1. Entity Framework Core 生成跟踪列

    本文翻译自<Entity Framework Core: Generate tracking columns>,由于水平有限,故无法保证翻译完全正确,欢迎指出错误.谢谢! 注意:我使用的是 ...

  2. entity framework core 生成 postgresql 数据库实体

    .net core 2.0 使用db first 方式生成 表 和context PM 控制台运行命令出错 Scaffold-DbContext "Host=localhost;Databa ...

  3. Entity Framework Core 生成跟踪列-阴影属性

    摘自:https://www.cnblogs.com/tdfblog/p/entity-framework-core-generate-tracking-columns.html Ef Core 官方 ...

  4. 被Entity Framework Core的细节改进震撼了一下

    今天用 SQL Server Profiler 查看 Entity Framework Core 生成的 SQL 语句时,突然发现一个细节改进,并且被它震撼了一下: exec sp_executesq ...

  5. 创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表

    创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表 创建数据模型类(POCO类) 在Models文件夹下添 ...

  6. Entity Framework Core 执行SQL语句和存储过程

    无论ORM有多么强大,总会出现一些特殊的情况,它无法满足我们的要求.在这篇文章中,我们介绍几种执行SQL的方法. 表结构 在具体内容开始之前,我们先简单说明一下要使用的表结构. public clas ...

  7. Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制

    将通用的序列号生成器库 从SQL Server迁移到Mysql 遇到的一个问题,就是TimeStamp/RowVersion并发控制类型在非Microsoft SQL Server数据库中的实现.SQ ...

  8. 全球首发免费的MySql for Entity Framework Core

    from:http://www.1234.sh/post/pomelo-data-mysql?utm_source=tuicool&utm_medium=referral Source 源代码 ...

  9. Entity Framework Core 使用HiLo生成主键

    #cnblogs_post_body.cnblogs-markdown p img { max-width: 95%; } HiLo是在NHiernate中生成主键的一种方式,不过现在我们可以在Ent ...

随机推荐

  1. 单选多选(CocosCreator)

    推荐阅读:  我的CSDN  我的博客园  QQ群:704621321 1.前沿       首先来说说我们的需求吧:随机出现单选题或者多选题,完全回答正确才算正确(多选题中少选错选算错),核实答案的 ...

  2. Spring框架入门之Spring4.0新特性——泛型注入

    Spring框架入门之Spring4.0新特性——泛型注入 一.为了更加快捷的开发,为了更少的配置,特别是针对 Web 环境的开发,从 Spring 4.0 之后,Spring 引入了 泛型依赖注入. ...

  3. String类的intern()方法,随常量池发生的变化

    JVM的知识这里总结的很详细:https://github.com/doocs/jvm/blob/master/README.md,因此在本博客也不会再对其中的东西重复总结了. intern的作用 简 ...

  4. CF980C Posterized 贪心 二十五

    Posterized time limit per test 1 second memory limit per test 256 megabytes input standard input out ...

  5. 【JavaScript】吃饱了撑的系列之JavaScript模拟多线程并发

    前言 最近,明学是一个火热的话题,而我,却也想当那么一回明学家,那就是,把JavaScript和多线程并发这两个八竿子打不找的东西,给硬凑了起来,还写了一个并发库concurrent-thread-j ...

  6. android CTS 介绍

    [转]http://blog.csdn.net/pugongying1988/article/details/6976091 一.为什么需要兼容性测试(以下称CTS)? 1.1.让APP提供更好的用户 ...

  7. MicroPython TPYBoard v102 无线红外遥控舵机(基于红外解/编码模块)

    转载请注明文章来源,更多教程可自助参考docs.tpyboard.com,QQ技术交流群:157816561,公众号:MicroPython玩家汇 红外解码/编码模块介绍 模块上搭载了红外接收头.红外 ...

  8. R:ggplot2数据可视化——进阶(1)

    ,分为三个部分,此篇为Part1,推荐学习一些基础知识后阅读~ Part 1: Introduction to ggplot2, 覆盖构建简单图表并进行修饰的基础知识 Part 2: Customiz ...

  9. 环境变量_JAVA_LAUNCHER_DEBUG,它能给你更多的JVM信息

    关于环境: 本文中的实战都是在docker容器中进行的,容器的出处请参照<在docker上编译openjdk8>一文,里面详细的说明了如何构造镜像和启动容器. 在上一篇文章<修改,编 ...

  10. 相同类中方法间调用时日志Aop失效处理

    本篇分享的内容是在相同类中方法间调用时Aop失效处理方案,该问题我看有很多文章描述了,不过大多是从事务角度分享的,本篇打算从日志aop方面分享(当然都是aop,失效和处理方案都是一样),以下都是基于s ...