/// <summary> /// Constructor /// </summary> public MemoryStorage() { Person = new CrudMemory <PersonTable, Guid>(); Consent = new CrudMemory <ConsentTable, Guid>(); Address = new ManyToOneMemory <AddressTable, Guid>(item => item.PersonId); PersonConsent = new ManyToManyMemory <PersonConsentTable, PersonTable, ConsentTable, Guid>(item => item.PersonId, item => item.ConsentId, Person, Consent); }
public async Task Initialize() { FulcrumApplicationHelper.UnitTestSetup(typeof(TestMemoryDistributedCache).FullName); var storage = new CrudMemory <CrudMemoryDistributedCache, CrudMemoryDistributedCache, string>(); var factory = new CrudMemoryDistributedCacheFactory(storage); _cache = await factory.GetOrCreateDistributedCacheAsync(typeof(TestMemoryDistributedCache).FullName); }
/// <inheritdoc /> public Cache(IGdprCapability capablity) { _capablity = capablity; // TODO: Change the async calls into AsyncLazy var metaCache = new CrudMemory <DistributedCacheMemory, string>(); var cacheFactory = new DistributedCacheFactoryMemory(metaCache); var personCache = cacheFactory.GetOrCreateDistributedCacheAsync("Person").Result; _personService = new PersonCache(capablity, personCache); var consentCache = cacheFactory.GetOrCreateDistributedCacheAsync("Consent").Result; // ReSharper disable once SuspiciousTypeConversion.Global ConsentService = new ConsentCache(capablity, consentCache); var personConsentCache = cacheFactory.GetOrCreateDistributedCacheAsync("PersonConsent").Result; // ReSharper disable once SuspiciousTypeConversion.Global PersonConsentService = new PersonConsentCache(capablity, personConsentCache); var consentPersonCache = cacheFactory.GetOrCreateDistributedCacheAsync("ConsentPerson").Result; // ReSharper disable once SuspiciousTypeConversion.Global ConsentPersonService = new ConsentPersonCache(capablity, consentPersonCache); }
public void Initialize() { _storage = new CrudMemory <TestItemId <Guid>, TestItemId <Guid>, Guid>(); }