Updated IRepository<TEntity> to remove generic type parameters from CreateAsync methods, now directly accepting TEntity. Corresponding changes made in DbRepository to align method signatures. Implementations still throw NotImplementedException.
44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using DigitalData.Core.Abstractions.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using System.Linq.Expressions;
|
|
|
|
namespace DigitalData.Core.Infrastructure;
|
|
|
|
public class DbRepository<TDbContext, TEntity> : IRepository<TEntity> where TDbContext : DbContext where TEntity : class
|
|
{
|
|
protected TDbContext Context;
|
|
|
|
protected DbSet<TEntity> Entities;
|
|
|
|
public DbRepository(TDbContext context, Func<TDbContext, DbSet<TEntity>> queryFactory)
|
|
{
|
|
Context = context;
|
|
Entities = queryFactory(context);
|
|
}
|
|
|
|
public Task<TEntity> CreateAsync(TEntity dto, CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<TEntity> CreateAsync(IEnumerable<TEntity> dtos, CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<IEnumerable<TEntity>> DeleteAsync<TDto>(Expression expression, CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<IEnumerable<TEntity>> ReadAsync(Expression? expression = null, CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<IEnumerable<TEntity>> UpdateAsync<TDto>(TDto dto, Expression expression, CancellationToken ct = default)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|