c# - Codefirst 的实体框架迁移错误
问题描述
我正在尝试使用 postgresql 在我的项目中启用迁移,但是当我在包管理器控制台中运行 Enable-Migrations 时遇到此错误。我已经尝试卸载并重新安装实体框架。
Enable-Migrations : Cannot bind argument to parameter 'Path' because it is null.
At line:1 char:1
+ Enable-Migrations
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Enable-Migrations], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Enable-Migrations
数据库上下文:
using System.Data.Entity;
namespace HalfPugg.Models
{
public class HalfPuggContext : DbContext
{
public HalfPuggContext() : base("Half-Pugg")
{
}
public DbSet<Gamer> Gamers { get; set; }
public DbSet<Game> Games { get; set; }
public DbSet<Classification_Gamer> Classification_Gamers { get; set; }
public DbSet<Match> Matches { get; set; }
public DbSet<Classification_Game> Classification_Games { get; set; }
public DbSet<Classification_Match> Classification_Matchs { get; set; }
public DbSet<Filter> Filters { get; set; }
public DbSet<Group> Groups { get; set; }
public DbSet<Hall> Halls { get; set; }
public DbSet<HashTag> HashTags { get; set; }
public DbSet<Label> Labels { get; set; }
public DbSet<MessageGamer> MessageGamers { get; set; }
public DbSet<MessageGroup> MessageGroups { get; set; }
public DbSet<MessageHall> MessageHalls { get; set; }
public DbSet<Numbered> Numbereds { get; set; }
public DbSet<Range> Ranges { get; set; }
public DbSet<RequestedGroup> RequestedGroups { get; set; }
public DbSet<RequestedHall> RequestedHalls { get; set; }
public DbSet<RequestedMatch> RequestedMatchs { get; set; }
public DbSet<Template> Templates { get; set; }
}
}
解决方案
推荐阅读
- javascript - 响应来自 express 的响应的 JSON.parse 语法错误
- powershell - Powershell 中的 Export-Csv 格式 - 意外的列顺序
- javascript - 使用 Mongo 的内部时钟设置 Unix 时间戳
- logstash - 解析 Java 日志并将其发送到 ELK 7.3
- python - python类的类型提示
- vue.js - 使用任何类型的部署部署 Vue 应用程序时出错
- macos - 如何正确杀死 NSWindow?
- django - Django Rest Framework - 如何设置序列化程序以使用相关模型创建 APIView
- python - 从 g.user 设置的 Flask-appbuilder 模型列默认值不起作用
- css - 如何在使用 grid 或 flex 时实现这种风格?