Пример #1
0
        public static Models.Logs GetPrivateLog(string mobileServiceName, string continuationToken)
        {
            MobileDbContext ctx                 = new MobileDbContext();
            var             sub                 = ctx.MobileServices.Where(m => m.Name == mobileServiceName).First().subscription;
            string          subscriptionId      = sub.Id.ToString();
            string          certString64Encoded = sub.Cert;

            var topCount = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["topCount"]);

            Uri requestUri = new Uri(GetSubscriptionUri(subscriptionId)
                                     + getLogUri(mobileServiceName, null, null, continuationToken, topCount));

            HttpWebRequest request = GetRequest(requestUri, certString64Encoded);

            var resultType = typeof(Models.Logs);

            try
            {
                return(getResponseRequest <Models.Logs>(request));
            }
            catch (Exception)
            {
                return(null);
            }
        }
Пример #2
0
        private static String GetCertFromSubscription(string subscriptionId)
        {
            MobileDbContext ctx   = new MobileDbContext();
            var             subId = Guid.Parse(subscriptionId);
            var             sub   = ctx.Subscriptions.Where(s => s.Id == subId).First();
            string          certString64Encoded = sub.Cert;

            return(certString64Encoded);
        }