public async Task<ConcurrentObject> TryUpdateRepresentationAsync(string representationId) { if (string.IsNullOrWhiteSpace(representationId)) { throw new ArgumentNullException(nameof(representationId)); } var concurrentObject = new ConcurrentObject { Etag = "\""+ Guid.NewGuid().ToString() + "\"", DateTime = DateTime.UtcNow }; await _options.Storage.SetAsync(representationId, concurrentObject); return concurrentObject; }
public async Task <ConcurrentObject> TryUpdateRepresentationAsync(string representationId) { if (string.IsNullOrWhiteSpace(representationId)) { throw new ArgumentNullException(nameof(representationId)); } var concurrentObject = new ConcurrentObject { Etag = "\"" + Guid.NewGuid().ToString() + "\"", DateTime = DateTime.UtcNow }; await _options.Storage.SetAsync(representationId, concurrentObject); return(concurrentObject); }
private void SetHeaders(Controller controller, ConcurrentObject concurrentObject) { controller.SetEtag(concurrentObject.Etag); controller.SetLastModifiedDate(concurrentObject.DateTime.ToUniversalTime().ToString("R")); }