我想在我的控制人员中使用以下模式:
api/{ Controller}/{id}/{ Collection}
但我希望回到<代码>。 IQueryable Of T from the due Get action. 我想这样作(简化):
public IQueryable<????> GetCollection(int id, string collection)
{
switch(collection)
{
case "addresses":
return _addresses.AsQueryable();
break;
case "orders":
return _orders.AsQueryable();
break;
default:
throw new Exception(NotSupported);
}
}
Can this be done?
What would be the recommended approach?