Esempio n. 1
0
 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();
 }
Esempio n. 2
0
        //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));
        }