public static async Task <bool> RequireETag(this IConformanceProvider conformanceProvider, string resourceType, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await conformanceProvider.SatisfiesAsync(
                new[]
     {
         new CapabilityQuery($"CapabilityStatement.rest.resource.where(type = '{resourceType}').where(versioning = 'versioned-update').exists()"),
     },
                cancellationToken));
 }
 public static async Task <bool> CanReadHistory(this IConformanceProvider conformanceProvider, string resourceType, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(await conformanceProvider.SatisfiesAsync(
                new[]
     {
         new CapabilityQuery($"CapabilityStatement.rest.resource.where(type = '{resourceType}').readHistory"),
     },
                cancellationToken));
 }
Ejemplo n.º 3
0
 public async Task Process(TRequest request, CancellationToken cancellationToken)
 {
     if (request is IRequireCapability provider)
     {
         if (!await _conformanceProvider.SatisfiesAsync(provider.RequiredCapabilities(), cancellationToken))
         {
             throw new MethodNotAllowedException(Core.Resources.RequestedActionNotAllowed);
         }
     }
 }