update DbRepository
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.Core.Abstraction.Application.Repository;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace DigitalData.Core.Infrastructure;
|
||||
@@ -35,7 +34,7 @@ public class DbRepository<TDbContext, TEntity> : IRepository<TEntity> where TDbC
|
||||
return entities;
|
||||
}
|
||||
|
||||
public IQueryable<TEntity> Where() => Entities.AsQueryable();
|
||||
public IQueryable<TEntity> Where(Expression<Func<TEntity, bool>> expression) => Entities.AsQueryable().Where(expression);
|
||||
|
||||
public IQueryable<TEntity> Get() => Entities.AsNoTracking();
|
||||
|
||||
@@ -86,5 +85,5 @@ public class DbRepository : IRepository
|
||||
_factory = factory;
|
||||
}
|
||||
|
||||
public IRepository<TEntity> Entity<TEntity>() => _factory.Get<TEntity>();
|
||||
public IRepository<TEntity> Entity<TEntity>() where TEntity : IEntity => _factory.Get<TEntity>();
|
||||
}
|
||||
Reference in New Issue
Block a user