我想使用下面的代码查询DocumentDB,但是获得异常
"未处理的类型' System.TypeInitializationException'"
的例外
有人能提出一些建议吗?感谢
private const string EndpointUrl = @"myEndpointUrl";
private const string PrimaryKey = "myKey";
private DocumentClient client;
static void Main(string[] args)
{
try
{
DocumentClient client = new DocumentClient(new Uri(EndpointUrl), PrimaryKey);
var query = client.CreateDocumentQuery(
"dbs/myDB/colls/myColl",
"SELECT c.TestRun.dateFinish FROM c order by c.TestRun.dateFinish desc").ToList();
Console.ReadLine();
}
catch (Exception)
{
throw;
}
}