/// <summary> /// Oldest first, order by sequence number ascending /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <SnapshotItem[]> Load(string id) { using (var context = new AkkaSqlPersistenceContext(_options)) { return(await context.Snapshots.Where(j => j.PersistenceId == id).OrderBy(i => i.SequenceNr).ToArrayAsync()); } }
public int TotalCount() { using (var context = new AkkaSqlPersistenceContext(_dbOptions)) { return((from x in context.Journal select x).Count()); } }
public async Task <JournalItem[]> Load(string id) { using (var context = new AkkaSqlPersistenceContext(_dbOptions)) { return(await context.Journal.Where(j => j.PersistenceId == id).OrderBy(j => j.SequenceNr).ToArrayAsync()); } }
public JournalItem[] Load(string id) { using (var context = new AkkaSqlPersistenceContext(_connectionString)) { return(context.Journal.Where(j => j.PersistenceId == id) .OrderBy(j => j.SequenceNr) .ToArray()); } }
/// <summary> /// Oldest first, order by sequence number ascending /// </summary> /// <param name="id"></param> /// <returns></returns> public SnapshotItem[] Load(string id) { using (var context = new AkkaSqlPersistenceContext(_connectionString)) { return(context.Snapshots.Where(j => j.PersistenceId == id) .OrderBy(i => i.SequenceNr) .ToArray()); } }
public void Save(string id, params JournalItem[] messages) { foreach (var m in messages) { m.PersistenceId = id; } using (var context = new AkkaSqlPersistenceContext(_connectionString)) { context.Journal.AddOrUpdate(messages); context.SaveChanges(); } }
public async Task Save(string id, params SnapshotItem[] messages) { foreach (var m in messages) { m.PersistenceId = id; } using (var context = new AkkaSqlPersistenceContext(_options)) { context.Snapshots.AddRange(messages); await context.SaveChangesAsync(); } }