Skip to content

Commit 05dbdb9

Browse files
committed
wip
1 parent 4254609 commit 05dbdb9

26 files changed

Lines changed: 2343 additions & 756 deletions

File tree

Core/Cleipnir.ResilientFunctions.Tests/TestTemplates/StateStoreTests.cs

Lines changed: 0 additions & 246 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.Threading.Tasks;
2+
3+
namespace Cleipnir.ResilientFunctions.Storage;
4+
5+
public interface IStoreCommandExecutor
6+
{
7+
public Task<IStoreCommandReader> Execute(StoreCommands commands);
8+
Task<int> ExecuteNonQuery(StoreCommands commands);
9+
}

Core/Cleipnir.ResilientFunctions/Storage/StoreCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
namespace Cleipnir.ResilientFunctions.Storage;
66

7+
public record StoreCommands(List<StoreCommand> Commands)
8+
{
9+
public static StoreCommands Create(params List<StoreCommand> commands) => new(commands);
10+
};
11+
712
public record StoreCommand(string Sql, List<ParameterValueAndName> Parameters)
813
{
914
public void AddParameter(string name, object value) => Parameters.Add(new ParameterValueAndName(name, value));
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
4+
namespace Cleipnir.ResilientFunctions.Storage;
5+
6+
public interface IStoreCommandReader : IAsyncDisposable
7+
{
8+
int AffectedRows { get; }
9+
Task<bool> MoveToNextResults();
10+
Task<bool> ReadAsync();
11+
12+
Task<bool> IsDbNullAsync(int ordinal);
13+
Guid GetGuid(int ordinal);
14+
object GetValue(int ordinal);
15+
bool GetBoolean(int ordinal);
16+
int GetInt32(int ordinal);
17+
long GetInt64(int ordinal);
18+
string GetString(int ordinal);
19+
bool IsDbNull(int ordinal);
20+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System.Collections.Generic;
2+
3+
namespace Cleipnir.ResilientFunctions.Storage;
4+
5+
public interface IStoreReader<T>
6+
{
7+
public List<T> Read();
8+
}

0 commit comments

Comments
 (0)