Skip to content

Commit

Permalink
Merge pull request #25 from Byndyusoft/wip
Browse files Browse the repository at this point in the history
Wip
  • Loading branch information
govorovvs committed Sep 3, 2023
2 parents af13276 + 5c76c79 commit fa17e00
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: dotnet build

- name: publish Byndyusoft.Data.Relational.Abstractions
uses: alirezanet/publish-nuget@v3.0.0
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/Byndyusoft.Data.Relational.Abstractions/Byndyusoft.Data.Relational.Abstractions.csproj
VERSION_FILE_PATH: Directory.Build.props
Expand All @@ -32,7 +32,7 @@ jobs:
INCLUDE_SYMBOLS: true

- name: publish Byndyusoft.Data.Relational
uses: alirezanet/publish-nuget@v3.0.0
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/Byndyusoft.Data.Relational/Byndyusoft.Data.Relational.csproj
VERSION_FILE_PATH: Directory.Build.props
Expand All @@ -42,7 +42,7 @@ jobs:
INCLUDE_SYMBOLS: true

- name: publish Byndyusoft.Data.Relational.OpenTelemetry
uses: alirezanet/publish-nuget@v3.0.0
uses: alirezanet/publish-nuget@v3.1.0
with:
PROJECT_FILE_PATH: src/Byndyusoft.Data.Relational.OpenTelemetry/Byndyusoft.Data.Relational.OpenTelemetry.csproj
VERSION_FILE_PATH: Directory.Build.props
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>0.12.0-rc1</Version>
<Version>0.12.0-rc2</Version>
<Authors>Byndyusoft</Authors>
<PackageTags>Byndyusoft;Data;Relational</PackageTags>
<RepositoryUrl>https://github.com/Byndyusoft/Byndyusoft.Data.Relational</RepositoryUrl>
Expand Down
9 changes: 8 additions & 1 deletion src/Byndyusoft.Data.Relational/DbSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Byndyusoft.Data.Sessions;
using CommunityToolkit.Diagnostics;
using Microsoft.Extensions.Options;

namespace Byndyusoft.Data.Relational
{
public class DbSession : ICommittableDbSession
public class DbSession : ICommittableDbSession, IDependentSession
{
private static readonly ActivitySource _activitySource = DbSessionInstrumentationOptions.CreateActivitySource();

Expand Down Expand Up @@ -144,6 +145,12 @@ public async Task CommitAsync(CancellationToken cancellationToken = default)
_activity?.AddEvent(new ActivityEvent(DbSessionEvents.Commited));
}

ValueTask IDependentSession.RollbackAsync(CancellationToken cancellationToken) =>
new(RollbackAsync(cancellationToken));

ValueTask IDependentSession.CommitAsync(CancellationToken cancellationToken) =>
new (CommitAsync(cancellationToken));

public async Task RollbackAsync(CancellationToken cancellationToken = default)
{
ThrowIfDisposed();
Expand Down

0 comments on commit fa17e00

Please sign in to comment.