public void Test2() { var cont = new ProductCatalogContainer(new Uri(@"http://localhost:2691/ProductCatalog.svc/")); var infos = cont.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public). Where( x => x.PropertyType.IsGenericType && x.PropertyType.GetGenericArguments().FirstOrDefault(t => t == typeof(ProductDetailViewModel)) != null). First(); }
//todo: make Cache for fast access private IQueryable <T> FindSet() { PropertyInfo first = _container.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public). Where( x => x.PropertyType.IsGenericType && x.PropertyType.GetGenericArguments().FirstOrDefault(t => t == typeof(ProductDetailViewModel)) != null). First(); return((IQueryable <T>)first.GetValue(_container, null)); }