Esempio n. 1
0
        public void TestToNewsBll()
        {
            var newsEntity = new NewsEntity
            {
                PartitionKey = "Malaga;2015-05-04",
                RowKey       = string.Format("NEWS;{0}", Guid.NewGuid()),
                Title        = "title",
                Content      = "content",
                Author       = "author"
            };

            NewsBll newsBll = NewsEntity.ToNewsBll(newsEntity);

            Assert.AreEqual(newsEntity.Title, newsBll.Title);
            Assert.AreEqual(newsEntity.Content, newsBll.Content);
            Assert.AreEqual(newsEntity.Author, newsBll.Author);
        }
Esempio n. 2
0
 public async Task <NewsBll> GetNews(string city, DateTime date, Guid id)
 {
     return(NewsEntity.ToNewsBll(await this.tableStore.GetTableEntity <NewsEntity>(NewsEntity.BuildPartitionkey(city, date), id.ToString())));
 }