Exemplo n.º 1
0
 public void Update(BloggerData data)
 {
     using (ISession session = NHibernateHelper.OpenSession())
         using (ITransaction transaction = session.BeginTransaction())
         {
             session.Update(data);
             transaction.Commit();
         }
 }
Exemplo n.º 2
0
        public BloggerData GetBlog(string blogID)
        {
            var result = new BloggerData();

            using (var wc = new WebClient())
            {
                wc.Encoding = Encoding.UTF8;
                string tmp = wc.DownloadString("https://" + $"www.googleapis.com/blogger/v3/blogs/{blogID}/?key={this.auth.ApiKey}");
                if (!string.IsNullOrWhiteSpace(tmp))
                {
                    result = this.Deserialize <BloggerData>(tmp);
                }
            }

            return(result);
        }