using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Pasted.DataAccess
{
public interface IRepository
{
///
/// Gets all.
///
/// The type of the entity.
///
IEnumerable GetAll() where TEntity : class;
///
/// Finds entities based on provided criteria.
///
/// The type of the entity.
/// The criteria.
///
IEnumerable Find(Expression> criteria) where TEntity : class;
///
/// Finds one entity based on provided criteria.
///
/// The type of the entity.
/// The criteria.
///
TEntity FindOne(Expression> criteria) where TEntity : class;
///
/// Adds the specified entity.
///
/// The type of the entity.
/// The entity.
void Add(TEntity entity) where TEntity : class;
///
/// Updates changes of the existing entity.
/// The caller must later call SaveChanges() on the repository explicitly to save the entity to database
///
/// The type of the entity.
/// The entity.
void Update(TEntity entity) where TEntity : class;
///
/// Deletes the specified entity.
///
/// The type of the entity.
/// The entity.
void Delete(TEntity entity) where TEntity : class;
}
}