コード例 #1
0
        public ActionResult QueryByRowKey(string rowKey)
        {
            var sw = new Stopwatch();
            sw.Start();

            var account = GetAccountInfo();
            var context = new TestContext(account.TableEndpoint.AbsoluteUri, account.Credentials);
            var query = context.CreateQuery<TestEntity>(TABLE_NAME);

            var entity = query.Where(e => e.RowKey== rowKey).ToList();

            //var entity = (from e in context.CreateQuery<TestEntity>(TABLE_NAME) where e.RowKey==rowKey select e);

            ViewData["Data"] = entity;
            ViewData["Elapsed"] = sw.ElapsedMilliseconds;
            return View("Index");
        }
コード例 #2
0
        public ActionResult QueryByRowkeyAndPartitionKey(string partitionKey, string rowKey)
        {
            var sw = new Stopwatch();
            sw.Start();

            var account = GetAccountInfo();
            var context = new TestContext(account.TableEndpoint.AbsoluteUri, account.Credentials);
            var query = context.CreateQuery<TestEntity>(TABLE_NAME);

            var entity = query.Where(e => e.PartitionKey.Equals(partitionKey) && e.RowKey.Equals(rowKey)).ToList();

            ViewData["Data"] = entity;
            ViewData["Elapsed"] = sw.ElapsedMilliseconds;
            return View("Index");
        }
コード例 #3
0
        public ActionResult QueryByLastNameColumn(string lastName)
        {
            var sw = new Stopwatch();
            sw.Start();

            var account = GetAccountInfo();
            var context = new TestContext(account.TableEndpoint.AbsoluteUri, account.Credentials);
            var query = context.CreateQuery<TestEntity>(TABLE_NAME);

            var entity = query.Where(e => e.LastName == lastName).ToList();

            ViewData["Data"] = entity;
            ViewData["Elapsed"] = sw.ElapsedMilliseconds;
            return View("Index");
        }