これはmvc4の私のクラスです:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
namespace xxx.Areas.admin.Models
{
public interface IGenericRepository<T> : where T : class
{
IQueryable<T> AsQueryable();
IEnumerable<T> GetAll();
IEnumerable<T> Find(Expression<Func<T, bool>> predicate);
T Single(Expression<Func<T, bool>> predicate);
T SingleOrDefault(Expression<Func<T, bool>> predicate);
T First(Expression<Func<T, bool>> predicate);
T GetById(int id);
void Add(T entity);
void Delete(T entity);
void Attach(T entity);
}
}
しかし、いくつかのエラーがあります:
- タイプまたは名前空間の名前'where'が見つかりませんでした(usingディレクティブまたはアセンブリ参照がありませんか?)
- タイプまたは名前空間の名前「T」が見つかりませんでした(usingディレクティブまたはアセンブリ参照がありませんか?)
それを修正する方法は?ありがとう。