public async Task CreateStorageWithIdWith_SaveOption_ReadCache() { AutoCacheOptions.SaveAll = true; _autoCache = new CrudAutoCache <string, Guid>(_storage, ToGuid, Cache, null, AutoCacheOptions); var id = Guid.NewGuid(); await _autoCache.CreateWithSpecifiedIdAsync(id, "A"); // Will update cache thanks to SaveAll await PrepareStorageAsync(id, "B"); await VerifyAsync(id, "B", "A"); }
public async Task CreateStorageWithId_ReadStorage() { var doGetToUpdate = false; while (true) { AutoCacheOptions.DoGetToUpdate = doGetToUpdate; var id = Guid.NewGuid(); await _autoCache.CreateWithSpecifiedIdAsync(id, "A"); // Will not update cache await PrepareStorageAsync(id, "B"); await VerifyAsync(id, "B", null, "B"); if (doGetToUpdate) { break; } doGetToUpdate = true; } }