我使用 EntityCollection 作为组合框的数据源作为具有 ria 服务的 silverlight 应用程序的下拉列表。如果我知道集合中选择的项目,说它的 ID=123,那么我可以使用这个 ID 来找出 EntityCollection 中的选择。如何为此编写通用函数?
像这样说:
public Entity<T> GetEntity(EntityCollection<T> collection, string ID)
{
}
我使用 EntityCollection 作为组合框的数据源作为具有 ria 服务的 silverlight 应用程序的下拉列表。如果我知道集合中选择的项目,说它的 ID=123,那么我可以使用这个 ID 来找出 EntityCollection 中的选择。如何为此编写通用函数?
像这样说:
public Entity<T> GetEntity(EntityCollection<T> collection, string ID)
{
}