我有以下内容,它产生一个错误,说我需要指定参数SearchCriteria,这是存储过程的唯一参数,我在这里遗漏了什么?
public async Task<List<T>> SqlQueryAsync<T>(string sql, params object[] parameters) where T : class
{
return await _context.Database.SqlQuery<T>(sql, parameters).ToListAsync();
}
调用代码有这个
object[] args = new object[] { searchQuery };
var list = await _repository.SqlQueryAsync<Landlord>(StoredProcedures.LandlordSearch, args);
public static readonly string LandlordSearch = "LandlordSearch @SearchCriteria";