36 lines
1.6 KiB
C#
36 lines
1.6 KiB
C#
using AutoMapper;
|
|
using IRaCIS.Core.Domain.Models;
|
|
//using AutoMapper.EntityFrameworkCore;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore
|
|
{
|
|
public interface IQueryRepository<TEntity, TKey> where TEntity : Entity
|
|
{
|
|
IQueryable<TResult> Select<TResult>( Expression<Func<TEntity, TResult>> selector);
|
|
|
|
ValueTask<TEntity> FindAsync(TKey id, CancellationToken cancellationToken = default);
|
|
|
|
ValueTask<TEntity> FindAsync(object[] keyValues, CancellationToken cancellationToken);
|
|
|
|
}
|
|
|
|
public interface IQueryRepository<TEntity> : IQueryRepository<TEntity, Guid> where TEntity : Entity
|
|
{
|
|
TEntity ImageFind(Guid id, Type type);
|
|
IQueryable<TEntity> Where(Expression<Func<TEntity, bool>> exp = null, bool isTraking = false, bool ignoreQueryFilters = false);
|
|
IQueryable<TEntity> AsQueryable( bool ignoreQueryFilters = false);
|
|
|
|
IQueryable<TEntity> WhereIf(bool condition, Expression<Func<TEntity, bool>> filter);
|
|
IQueryable<TDestination> ProjectTo<TDestination>(IConfigurationProvider configuration, params Expression<Func<TDestination, object>>[] membersToExpand);
|
|
IQueryable<TDestination> ProjectTo<TDestination>(IConfigurationProvider configuration, IDictionary<string, object> parameters, params string[] membersToExpand);
|
|
IQueryable<TDestination> ProjectTo<TDestination>(IConfigurationProvider configuration, object parameters, params Expression<Func<TDestination, object>>[] membersToExpand);
|
|
|
|
}
|
|
|
|
} |