ここには何かがあります。エンティティフレームワークをもたらす方法汎用IQueryableにエクステンションメソッドを含める<TSource>
私はインターフェイスを持っている、と私はいけないが、EntityFrameworkについてを知っている必要があり、私のIRepository
層ウィッヒに、EntityFrameworkライブラリに属しInclude
拡張メソッドを、置くことでしょう。
public interface IRepository<TEntity>
{
IQueryable<TEntity> Entities { get; }
TEntity GetById(long id);
TEntity Insert(TEntity entity);
void Update(TEntity entity);
void Delete(TEntity entity);
void Delete(long id);
}
だから私は、拡張メソッドがあります。
public static class IncludeExtension
{
static IQueryable<TEntity> Include<TEntity>(this IQueryable<TEntity> query,
string path)
{
throw new NotImplementedException();
}
}
をしかし、私はこの層にそれを実装する方法がわからない、と私は考え私のEntityFrameworkに送信する(または誰が実装するものは何でもIRepository)に対処する。
拡張メソッドを持つインタフェースと同じものが必要です。
私はちょうどEFでdepedingしたくありません。私はクライアント層の参照を避けようとしています。 – iuristona