public async Task<bool> CheckRepresentationHasChangedAsync( Controller controller, string representationId) { if (controller == null) { throw new ArgumentNullException(nameof(controller)); } if (string.IsNullOrWhiteSpace(representationId)) { throw new ArgumentNullException(nameof(representationId)); } // Check the http request contains the header "If-None-Match" var concatenatedEtags = controller.GetIfNoneMatch(); var modifiedSince = controller.GetModifiedSince(); 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.All(etag => { if (etag.IsWeak) { // Weak etag if (c.Etag.Contains(etag.Tag)) { return false; } } else { if (etag.Tag == c.Etag) { return false; } } return true; }); }); return await ContinueExecution(concatenatedEtags, modifiedSince, representationId, checkDateCallback, checkEtagCorrectCallback); }