Esempio n. 1
0
        public async Task <List <string> > ExecuteAsync()
        {
            var key = KeyUtils.GetBlogListKey();

            var state = await _db.GetObjectAsync <BlogListState>(key);

            return(state.Blogs.ToList());
        }
Esempio n. 2
0
        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);
        }