internal static SnapshotWrapper GetInstance() { Snapshot real = default(Snapshot); RealInstanceFactory(ref real); var instance = (SnapshotWrapper)SnapshotWrapper.GetWrapper(real); InstanceFactory(ref instance); if (instance == null) { Assert.Inconclusive("Could not Create Test Instance"); } return(instance); }
public async Task Write(Memento memento) { var collection = mongoDatabase.GetCollection <SnapshotWrapper>("snapshots"); var em = (await(await collection.FindAsync(f => f.AggId == memento.Metadata.AggregateId)) .FirstOrDefaultAsync()); if (em == null) { em = new SnapshotWrapper { Id = ObjectId.GenerateNewId(), AggId = memento.Metadata.AggregateId, Memento = memento } } ; else { em.Memento = memento; } await collection.ReplaceOneAsync(Builders <SnapshotWrapper> .Filter.Eq(u => u.Id, em.Id), em, new UpdateOptions { IsUpsert = true }); }
static partial void InstanceFactory(ref SnapshotWrapper instance, [CallerMemberName] string callerName = "");