refactor: replace local dal abstractions with hrynco-ef packages
Remove duplicate IEntity, Entity, ITransaction, IUnitOfWork, EfRepository, EfUnitOfWork, EfTransactionAdapter — now consumed from HrynCo.DAL.Abstract and HrynCo.DAL.EF packages (1.0.1). Ref: IT-0
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
namespace HrynCo.NotificationService.DAL.Abstract.Entities;
|
||||
|
||||
public abstract class Entity<TId> : IEntity<TId> where TId : struct
|
||||
{
|
||||
public TId Id { get; set; }
|
||||
public DateTimeOffset Created { get; set; }
|
||||
public DateTimeOffset? Updated { get; set; }
|
||||
}
|
||||
|
||||
public abstract class Entity : Entity<Guid>
|
||||
{
|
||||
protected Entity()
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
Created = DateTimeOffset.UtcNow;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace HrynCo.NotificationService.DAL.Abstract.Entities;
|
||||
|
||||
public interface IEntity<TId> where TId : struct
|
||||
{
|
||||
TId Id { get; set; }
|
||||
DateTimeOffset Created { get; set; }
|
||||
DateTimeOffset? Updated { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="HrynCo.DAL.Abstract" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace HrynCo.NotificationService.DAL.Abstract;
|
||||
|
||||
public interface ITransaction : IAsyncDisposable
|
||||
{
|
||||
Task CommitAsync(CancellationToken cancellationToken = default);
|
||||
Task RollbackAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace HrynCo.NotificationService.DAL.Abstract;
|
||||
|
||||
public interface IUnitOfWork
|
||||
{
|
||||
Task SaveChangesAsync(CancellationToken cancellationToken = default);
|
||||
Task<ITransaction> BeginTransactionAsync(CancellationToken cancellationToken = default);
|
||||
ITransaction? GetCurrentTransaction();
|
||||
|
||||
Task ExecuteInTransactionAsync(Func<Task> action);
|
||||
Task<TResult> ExecuteInTransactionAsync<TResult>(Func<Task<TResult>> action);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using HrynCo.NotificationService.DAL.Abstract.Entities;
|
||||
using HrynCo.DAL.Abstract.Entities;
|
||||
|
||||
namespace HrynCo.NotificationService.DAL.Abstract.Providers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using HrynCo.NotificationService.DAL.Abstract.Entities;
|
||||
using HrynCo.DAL.Abstract.Entities;
|
||||
|
||||
namespace HrynCo.NotificationService.DAL.Abstract.Providers;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using HrynCo.NotificationService.DAL.Abstract.Entities;
|
||||
using HrynCo.DAL.Abstract.Entities;
|
||||
|
||||
namespace HrynCo.NotificationService.DAL.Abstract.Templates;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user