无法创建类型为"DatabaseContext"的对象.对于设计时支持的不同模式错误 [英] Unable to create an object of type 'DatabaseContext'. For the different patterns supported at design time error

查看:81
本文介绍了无法创建类型为"DatabaseContext"的对象.对于设计时支持的不同模式错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ubuntu OS中的docker中使用sqlserver2017创建asp.netcore 3 Web应用程序运行dotnet ef时出现错误,请先添加迁移firstmigrate

I'm using sqlserver2017 in docker in ubuntu os create asp.netcore 3 web app error in run dotnet ef add migrations firstmigrate

无法创建类型为'DatabaseContext'的对象.对于设计时支持的不同模式,

Unable to create an object of type 'DatabaseContext'. For the different patterns supported at design time,

推荐答案

您只需要将默认构造函数添加到上下文中即可.

You just have to add your default constructor to your context.

这篇关于无法创建类型为"DatabaseContext"的对象.对于设计时支持的不同模式错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆