本文整理汇总了C#中FhirClient.VRead方法的典型用法代码示例。如果您正苦于以下问题:C# FhirClient.VRead方法的具体用法?C# FhirClient.VRead怎么用?C# FhirClient.VRead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FhirClient
的用法示例。
在下文中一共展示了FhirClient.VRead方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read()
{
FhirClient client = new FhirClient(testEndpoint);
var loc = client.Read<Location>("1");
Assert.IsNotNull(loc);
Assert.AreEqual("Den Burg", loc.Resource.Address.City);
string version = new ResourceLocation(loc.SelfLink).VersionId;
Assert.AreEqual("1", version);
string id = new ResourceLocation(loc.Id).Id;
Assert.AreEqual("1", id);
try
{
var random = client.Read<Location>("45qq54");
Assert.Fail();
}
catch (FhirOperationException)
{
Assert.IsTrue(client.LastResponseDetails.Result == HttpStatusCode.NotFound);
}
var loc2 = client.VRead<Location>("1", version);
Assert.IsNotNull(loc2);
Assert.AreEqual(FhirSerializer.SerializeBundleEntryToJson(loc),
FhirSerializer.SerializeBundleEntryToJson(loc2));
var loc3 = client.Fetch<Location>(loc.SelfLink);
Assert.IsNotNull(loc3);
Assert.AreEqual(FhirSerializer.SerializeBundleEntryToJson(loc),
FhirSerializer.SerializeBundleEntryToJson(loc3));
}