public async Task <TQueryModel> CreateAsync(TQueryModel model) { var existing = await FindAsync(model.Id); if (existing != null) { throw new StorageException(); } storage.Add(model); model.Timestamp = DateTimeOffset.UtcNow; model.ETag = Unified.NewCode(); return(model); }
/// <inheritdoc /> public async Task <TQueryModel> CreateAsync(TQueryModel model) { var existingModel = await FindAsync(model.Id, model.Version); if (existingModel != null) { throw new StorageException(); } storage.Add(model); model.Timestamp = DateTimeOffset.UtcNow; return(model); }