Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Blog.Domain.Entities;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Linq.Expressions;
- using System.Threading;
- using System.Threading.Tasks;
- namespace Blog.Domain.RepositoryContracts
- {
- public interface IRepositoryBase<TEntity, TKey>
- where TEntity : class, IEntity<TKey>
- where TKey : IComparable
- {
- void Add(TEntity entity);
- Task AddAsync(TEntity entity);
- void Edit(TEntity entityToUpdate);
- Task EditAsync(TEntity entityToUpdate);
- IList<TEntity> GetAll();
- Task<IList<TEntity>> GetAllAsync();
- TEntity GetById(TKey id);
- Task<TEntity> GetByIdAsync(TKey id);
- int GetCount(Expression<Func<TEntity, bool>> filter = null);
- Task<int> GetCountAsync(Expression<Func<TEntity, bool>> filter = null);
- void Remove(Expression<Func<TEntity, bool>> filter);
- void Remove(TEntity entityToDelete);
- void Remove(TKey id);
- Task RemoveAsync(Expression<Func<TEntity, bool>> filter);
- Task RemoveAsync(TEntity entityToDelete);
- Task RemoveAsync(TKey id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement