77using Cleipnir . ResilientFunctions . Helpers ;
88using Cleipnir . ResilientFunctions . Messaging ;
99using Cleipnir . ResilientFunctions . Storage ;
10+ using Cleipnir . ResilientFunctions . Storage . Session ;
1011using Cleipnir . ResilientFunctions . Storage . Utils ;
1112using Npgsql ;
1213
@@ -76,11 +77,11 @@ public async Task<IReadOnlyList<StoredEffect>> ReadEffects(NpgsqlDataReader read
7677
7778 return functions ;
7879 }
79- public async Task < Dictionary < StoredId , List < StoredEffect > > > ReadEffectsForIds ( NpgsqlDataReader reader , IEnumerable < StoredId > storedIds )
80+ public async Task < Dictionary < StoredId , List < StoredEffectWithPosition > > > ReadEffectsForIds ( NpgsqlDataReader reader , IEnumerable < StoredId > storedIds )
8081 {
81- var effects = new Dictionary < StoredId , List < StoredEffect > > ( ) ;
82+ var effects = new Dictionary < StoredId , List < StoredEffectWithPosition > > ( ) ;
8283 foreach ( var storedId in storedIds )
83- effects [ storedId ] = new List < StoredEffect > ( ) ;
84+ effects [ storedId ] = new List < StoredEffectWithPosition > ( ) ;
8485
8586 while ( await reader . ReadAsync ( ) )
8687 {
@@ -92,16 +93,16 @@ public async Task<Dictionary<StoredId, List<StoredEffect>>> ReadEffectsForIds(Np
9293 var effectId = reader . GetString ( 5 ) ;
9394
9495 var se = new StoredEffect ( EffectId . Deserialize ( effectId ) , status , result , JsonHelper . FromJson < StoredException > ( exception ) ) ;
95- effects [ id ] . Add ( se ) ;
96+ effects [ id ] . Add ( new StoredEffectWithPosition ( se , position ) ) ;
9697 }
9798
9899 return effects ;
99100 }
100101
101- public IEnumerable < StoreCommand > UpdateEffects ( IReadOnlyList < StoredEffectChange > changes )
102+ public IEnumerable < StoreCommand > UpdateEffects ( IReadOnlyList < StoredEffectChange > changes , PositionsStorageSession session )
102103 {
103104 var commands = new List < StoreCommand > ( changes . Count ) ;
104-
105+
105106 // INSERT
106107 {
107108 var sql = $@ "
@@ -112,6 +113,7 @@ INSERT INTO {tablePrefix}_effects
112113
113114 foreach ( var ( storedId , _, _, storedEffect ) in changes . Where ( s => s . Operation == CrudOperation . Insert ) )
114115 {
116+
115117 var command = StoreCommand . Create ( sql ) ;
116118 command . AddParameter ( storedId . AsGuid ) ;
117119 command . AddParameter ( storedEffect ! . StoredEffectId . Value . ToLong ( ) ) ;
0 commit comments