CQRS_Simple/CQRS_Simple.Infrastructure/Uow/IRepository.cs

21 lines
574 B
C#
Raw Normal View History

2022-04-07 14:00:58 +08:00
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace CQRS_Simple.Infrastructure.Uow
{
public interface IRepository<T, TC> where T : Entity<TC>
{
IUnitOfWork UnitOfWork { get; }
T GetById(TC id);
Task<T> GetByIdAsync(TC id);
IEnumerable<T> GetAll();
IEnumerable<T> Get(Expression<Func<T, bool>> predicate);
void Add(T entity);
void Delete(T entity);
void Update(T entity);
Task<IEnumerable<T>> GetAllAsync();
}
}