Skip to content

Instantly share code, notes, and snippets.

@caferrari
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save caferrari/56212ef8b5324b55a8bc to your computer and use it in GitHub Desktop.

Select an option

Save caferrari/56212ef8b5324b55a8bc to your computer and use it in GitHub Desktop.
BaseRepository interface
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using PixelAzul.CrossCutting.Pagination;
namespace PixelAzul.Domain.Interfaces.Repositories
{
public interface IBaseRepository<TEntity, TKey>
where TEntity: Entity
where TKey : IComparable
{
Task<TEntity> Find(TKey id);
Task<List<U>> SelectBy<U>(Expression<Func<TEntity, bool>> exp, Expression<Func<TEntity, U>> columns);
Task<List<TEntity>> SelectBy(Expression<Func<TEntity, bool>> exp);
Task<List<U>> Select<U>(Expression<Func<TEntity, U>> columns);
Task<PagedResult<U>> SelectPagedBy<U>(PaginationSettings settings, Expression<Func<TEntity, bool>> exp, Expression<Func<TEntity, U>> columns);
Task<PagedResult<TEntity>> SelectPagedBy(PaginationSettings settings, Expression<Func<TEntity, bool>> exp);
Task<PagedResult<U>> SelectPaged<U>(PaginationSettings settings, Expression<Func<TEntity, U>> columns);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment