Пример #1
0
        public ActionResult Index()
        {
            var spContext = SharePointContextProvider.Current.GetSharePointContext(HttpContext);

            ViewBag.Username = SharePointService.GetUserName(spContext);

            CamlQuery queryProducts = new CamlQuery();

            queryProducts.ViewXml = @"<View><ViewFields><FieldRef Name='Title'/>
                                        <FieldRef Name='ProductDescription'/>
                                    <FieldRef Name='Price'/></ViewFields></View>";

            List <Product> products = SharePointService.GetProducts(spContext, queryProducts);

            return(View(products));
        }