コード例 #1
0
 /// <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());
     }
 }
コード例 #2
0
 public int TotalCount()
 {
     using (var context = new AkkaSqlPersistenceContext(_dbOptions))
     {
         return((from x in context.Journal select x).Count());
     }
 }
コード例 #3
0
 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());
     }
 }
コード例 #4
0
 public JournalItem[] Load(string id)
 {
     using (var context = new AkkaSqlPersistenceContext(_connectionString))
     {
         return(context.Journal.Where(j => j.PersistenceId == id)
                .OrderBy(j => j.SequenceNr)
                .ToArray());
     }
 }
コード例 #5
0
 /// <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());
     }
 }
コード例 #6
0
        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();
            }
        }
コード例 #7
0
        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();
            }
        }