Exemple #1
0
 public static bool IsNotModified(this HttpRequestMessage requestMessage, IHaveVersion versionable)
 {
     if (!requestMessage.Headers.IfNoneMatch.Any()) return false;
     var etag = requestMessage.Headers.IfNoneMatch.First().Tag;
     return string.Format("\"{0}\"", versionable.Version) == etag;
 }
Exemple #2
0
 private static int UpdateVersion(IHaveVersion item, int defaultVersion) => item?.Version + 1 ?? defaultVersion;