Made a generic repository to use !minor

This commit is contained in:
Jamie.Rees 2017-10-17 15:03:00 +01:00
parent ba04a9d1b1
commit 894945f652
8 changed files with 99 additions and 149 deletions

View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Query;
using Ombi.Store.Entities;
namespace Ombi.Store.Repository
{
public interface IRepository<T> where T : Entity
{
Task<T> Find(object key);
IQueryable<T> GetAll();
Task<T> FirstOrDefaultAsync(Expression<Func<T, bool>> predicate);
Task AddRange(IEnumerable<T> content);
IIncludableQueryable<TEntity, TProperty> Include<TEntity, TProperty>(
IQueryable<TEntity> source, Expression<Func<TEntity, TProperty>> navigationPropertyPath)
where TEntity : class;
}
}