EF Core 2.1中数据库视图的Scaffold-DbContext(查询类型)

问题描述:

EF Core 2.1具有新功能-查询类型.

EF Core 2.1 has new feature - Query Types.

查询类型的一些主要使用方案是:

Some of the main usage scenarios for query types are:

  • 用作临时FromSql()查询的返回类型.
  • 映射到数据库视图.
  • 映射到未定义主键的表.
  • 映射到模型中定义的查询.
  • Serving as the return type for ad hoc FromSql() queries.
  • Mapping to database views.
  • Mapping to tables that do not have a primary key defined.
  • Mapping to queries defined in the model.

我将项目升级到Core 2.1,但是Scaffold-DbContext仍然不会生成数据库视图.我必须使用特殊参数,还是Scaffold-DbContext不支持它?

I upgrade project to Core 2.1, but Scaffold-DbContext still does not generate database views. I have to use a special parameter or the Scaffold-DbContext does not support it?

2.1不支持.参见问题#1679 .

Not supported in 2.1. See issue #1679.