public void TestBuildPartitionKey() { const string city = "city"; const string date = "2015-05-21"; Assert.AreEqual(string.Format("{0};{1}", city, date), NewsEntity.BuildPartitionkey(city, DateTime.Parse(date))); }
public async Task DeleteNews(string city, DateTime date, Guid id) { await this.tableStore.DeleteTableEntity <NewsEntity>(NewsEntity.BuildPartitionkey(city, date), id.ToString()); }
public async Task <bool> ContainsAnyHotNews(string city, DateTime date) { List <NewsEntity> newsList = (await this.tableStore.ListTableEntityByPartitionKey <NewsEntity>(NewsEntity.BuildPartitionkey(city, date))).ToList(); return(newsList.Any()); }
public async Task <IEnumerable <NewsBll> > ListNews(string city, DateTime date) { return ((await this.tableStore.ListTableEntityByPartitionKey <NewsEntity>(NewsEntity.BuildPartitionkey(city, date))) .Select(NewsEntity.ToNewsBll)); }
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()))); }