public async Task <List <string> > ExecuteAsync() { var key = KeyUtils.GetBlogListKey(); var state = await _db.GetObjectAsync <BlogListState>(key); return(state.Blogs.ToList()); }
public void Handle(BlogClosedEvent evnt) { var key = KeyUtils.GetBlogListKey(); var state = _db.GetObject <BlogListState>(key); if (state != null) { throw new Exception("There is a blog with the same host name in the store."); } state.Blogs.Remove(evnt.AggregateId); _db.SetObject(key, state); }