System.ArgumentOutOfRangeException: '提供的 resourceId 不是有效的 Socrata (4x4) 资源标识符
System.ArgumentOutOfRangeException: 'The provided resourceId is not a valid Socrata (4x4) resource identifier
我正在尝试从 this dataset. 中提取数据 我从该方法中得到以下异常,“System.ArgumentOutOfRangeException:'提供的 resourceId 不是有效的 Socrata (4x4) 资源标识符. (Parameter 'resourceId')'" 但从 link 可以看出,resourceID 是正确的。我在这里做错了什么?
public static List<Submission> GetSubmissions()
{
var Client = new SodaClient("https://data.cdc.gov/resource/");
var Dataset = Client.GetResource<List<Submission>>("9mfq-cb36");
string[] Columns = new[] { "submission_date", "state", "tot_cases", "conf_cases", "prob_cases", "new_case", "pnew_case", "tot_death", "conf_death", "prob_death", "new_death", "pnew_death", "created_at", "consent_cases", "consent_deaths" };
var SOQL = new SoqlQuery().Select(Columns).Where("submission_date=" + DateTime.Today.Date.ToString());
var Results = Dataset.Query<Submission>(SOQL); //<--- Exception occurs at this line!
List<Submission> SubmissionsList = Results.ToList();
return SubmissionsList;
}
我能够通过向 Soda 客户端初始化添加应用令牌参数来解决此异常。这显然是该数据集所必需的,尽管 Socrata 文档另有说明。
我正在尝试从 this dataset. 中提取数据 我从该方法中得到以下异常,“System.ArgumentOutOfRangeException:'提供的 resourceId 不是有效的 Socrata (4x4) 资源标识符. (Parameter 'resourceId')'" 但从 link 可以看出,resourceID 是正确的。我在这里做错了什么?
public static List<Submission> GetSubmissions()
{
var Client = new SodaClient("https://data.cdc.gov/resource/");
var Dataset = Client.GetResource<List<Submission>>("9mfq-cb36");
string[] Columns = new[] { "submission_date", "state", "tot_cases", "conf_cases", "prob_cases", "new_case", "pnew_case", "tot_death", "conf_death", "prob_death", "new_death", "pnew_death", "created_at", "consent_cases", "consent_deaths" };
var SOQL = new SoqlQuery().Select(Columns).Where("submission_date=" + DateTime.Today.Date.ToString());
var Results = Dataset.Query<Submission>(SOQL); //<--- Exception occurs at this line!
List<Submission> SubmissionsList = Results.ToList();
return SubmissionsList;
}
我能够通过向 Soda 客户端初始化添加应用令牌参数来解决此异常。这显然是该数据集所必需的,尽管 Socrata 文档另有说明。