Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace EasyWay.Samples.Databases
{
public class SampleAggragateRootRepository : ISampleAggragateRootRepository, IAsyncDisposable
{
private readonly IGenericRepository<SampleAggregateRoot> _repository;
private readonly IWriteGenericRepository<SampleAggregateRoot> _repository;

public SampleAggragateRootRepository(IGenericRepository<SampleAggregateRoot> repository)
public SampleAggragateRootRepository(IWriteGenericRepository<SampleAggregateRoot> repository)
{
_repository = repository;
}
Expand Down
2 changes: 1 addition & 1 deletion source/EasyWay.EntityFrameworkCore/Extnsions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void AddEntityFrameworkCore<TContext>(
services.AddScoped<IAggregateRootsContext, EntityFrameworkAggregateRootsContext>();
services.AddTransient<IDomainEventsContext, DomainEventsAccessor>();

services.AddScoped(typeof(IGenericRepository<>), typeof(GenericRepository<>));
services.AddScoped(typeof(IWriteGenericRepository<>), typeof(WriteGenericRepository<>));

services.AddTransactions();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace EasyWay
{
public interface IGenericRepository<TAggregateRoot>
public interface IWriteGenericRepository<TAggregateRoot>
where TAggregateRoot : AggregateRoot
{
Task Add(TAggregateRoot aggregateRoot);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace EasyWay.Internals.Repositories
{
internal sealed class GenericRepository<TAggregateRoot> : IGenericRepository<TAggregateRoot>
internal sealed class WriteGenericRepository<TAggregateRoot> : IWriteGenericRepository<TAggregateRoot>
where TAggregateRoot : AggregateRoot
{
private readonly DbSet<TAggregateRoot> _aggregateRoots;

public GenericRepository(DbContext dbContext)
public WriteGenericRepository(DbContext dbContext)
{
_aggregateRoots = dbContext.Set<TAggregateRoot>();
}
Expand Down
Loading