本文整理汇总了C#中IKey.WithoutVersion方法的典型用法代码示例。如果您正苦于以下问题:C# IKey.WithoutVersion方法的具体用法?C# IKey.WithoutVersion怎么用?C# IKey.WithoutVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IKey
的用法示例。
在下文中一共展示了IKey.WithoutVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SparkException
//public FhirResponse Search(string type, IEnumerable<Tuple<string, string>> parameters, int pageSize, string sortby)
//{
// Validate.TypeName(type);
// Uri link = localhost.Uri(type);
// IEnumerable<string> keys = store.List(type);
// var snapshot = pager.CreateSnapshot(Bundle.BundleType.Searchset, link, keys, );
// Bundle bundle = pager.GetFirstPage(snapshot);
// return Respond.WithBundle(bundle, localhost.Base);
// DSTU2: search
/*
Query query = FhirParser.ParseQueryFromUriParameters(collection, parameters);
ICollection<string> includes = query.Includes;
SearchResults results = index.Search(query);
if (results.HasErrors)
{
throw new SparkException(HttpStatusCode.BadRequest, results.Outcome);
}
Uri link = localhost.Uri(type).AddPath(results.UsedParameters);
Bundle bundle = pager.GetFirstPage(link, keys, sortby);
/*
if (results.HasIssues)
{
var outcomeEntry = BundleEntryFactory.CreateFromResource(results.Outcome, new Uri("outcome/1", UriKind.Relative), DateTimeOffset.Now);
outcomeEntry.SelfLink = outcomeEntry.Id;
bundle.Entries.Add(outcomeEntry);
}
return Respond.WithBundle(bundle);
*/
//}
//public FhirResponse Update(IKey key, Resource resource)
//{
// Validate.HasTypeName(key);
// Validate.HasNoVersion(key);
// Validate.ResourceType(key, resource);
// Interaction original = store.Get(key);
// if (original == null)
// {
// return Respond.WithError(HttpStatusCode.MethodNotAllowed,
// "Cannot update resource {0}/{1}, because it doesn't exist on this server",
// key.TypeName, key.ResourceId);
// }
// Interaction interaction = Interaction.PUT(key, resource);
// interaction.Resource.AffixTags(original.Resource);
// transfer.Internalize(interaction);
// Store(interaction);
// // todo: does this require a response?
// transfer.Externalize(interaction);
// return Respond.WithEntry(HttpStatusCode.OK, interaction);
//}
public FhirResponse VersionSpecificUpdate(IKey versionedkey, Resource resource)
{
Validate.HasTypeName(versionedkey);
Validate.HasVersion(versionedkey);
Key key = versionedkey.WithoutVersion();
Interaction current = fhirStore.Get(key);
Validate.IsSameVersion(current.Key, versionedkey);
return this.Put(key, resource);
}