111,093
社区成员




public IQueryable<T> getList()
{
//...
}
public override IQueryable<JS_Country> getCountries<JS_Country>()
{
TBullionDbEntities db = new TBullionDbEntities();
var q = from r in db.JS_Country
select r;
return q as IQueryable<JS_Country>;
}
没有任何参数,类型是凭空冒出来的,如果你写成这样也是可以确定类型的 public override IQueryable<JS_Country> getCountries<JS_Country>(IQueryable<JS_Country> query)
{
var q = from r in query
select r;
return q as IQueryable<JS_Country>;
}
XXX.getCountries(new TBullionDbEntities().JS_Country);
MarshalAsAttribute a = new MarshalAsAttribute();
IQueryable<MarshalAsAttribute> c = a.getList();
[/quote]
额 发现你这个不行 我是用父类去实例化子类 你这个都静态的了 毋须实例化了 我怎么调用子类哦。。
MarshalAsAttribute a = new MarshalAsAttribute();
IQueryable<MarshalAsAttribute> c = a.getList();
[/quote]
你这个方法初步看来符合我的要求 待我试试能否使用