public async Task<bool> CheckRepresentationExistsAsync( Controller controller, string representationId) { if (controller == null) { throw new ArgumentNullException(nameof(controller)); } if (string.IsNullOrWhiteSpace(representationId)) { throw new ArgumentNullException(nameof(representationId)); } var concatenatedEtags = controller.GetIfMatch(); var unmodifiedSince = controller.GetUnmodifiedSince(); var checkDateCallback = new Func<DateTime, ConcurrentObject, bool>((d, c) => { return c.DateTime <= d; }); var checkEtagCorrectCallback = new Func<ConcurrentObject, List<EntityTagHeaderValue>, bool>((c, etags) => { return etags.Any(e => { if (e.IsWeak) { // Weak etag if (c.Etag.Contains(e.Tag)) { return true; } } else { if (e.Tag == c.Etag) { return true; } } return false; }); }); return await ContinueExecution(concatenatedEtags, unmodifiedSince, representationId, checkDateCallback, checkEtagCorrectCallback); }