我正尝试在mac os webapi上使用asp.net core 2.1调用视图或存储过程。
using System;
using System.Linq;
using Auth.Database;
using Microsoft.EntityFrameworkCore;
public virtual IQueryable<T> ExecuteStoreProcView(string viewProcName)
{
IQueryable<T> queryResult = _entities.Set<T>().FromSql(viewProcName).AsQueryable();
return queryResult;
}
获取以下错误
错误CS1061:“”DbSet“”不包含“”FromSql“”的定义,并且找不到接受“”DbSet“”类型的第一个参数的扩展方法“”FromSql“”(是否缺少using指令或程序集引用?)“(CS1061)
我正在使用mac os上的实体框架开发webapi。
研究以下链接中的一些查询:- Raw SQL Query without DbSet - Entity Framework Core
Raw SQL Query without DbSet - Entity Framework Core
但是不能找到错误的解决方案。有谁能让我知道我错过了什么。
https://stackoverflow.com/questions/51017703
复制相似问题