【发布时间】:2011-01-20 06:40:33
【问题描述】:
请参阅下面的代码。我想检查一些属性(例如在 IsActive 上)。你能告诉我在我的情况下如何在 GetList() 中实现它吗?
谢谢,
public interface ILookup
{
int Id { get; set; }
string FR { get; set; }
string NL { get; set; }
string EN { get; set; }
bool IsActive { get; set; }
}
public class LookupA : ILookup
{
}
public class LookupB : ILookup
{
}
public interface ILookupRepository<T>
{
IList<T> GetList();
}
public class LookupRepository<T> : ILookupRepository<T>
{
public IList<T> GetList()
{
List<T> list = Session.Query<T>().ToList<T>();
return list;
}
}
【问题讨论】: