Friday, March 6, 2015

What is category in Event Store?

 If put dash into stream name, the first part will be saved as category name

Source code from Event Store 

  _handler = new CategorizeEventsByStreamPath("-", Console.WriteLine);

        public override string GetCategoryByStreamId(string streamId)
        {
            string category = null;
            if (!streamId.StartsWith("$"))
            {
                var lastSeparatorPosition = streamId.IndexOf(_separator);
                if (lastSeparatorPosition > 0)
                    category = streamId.Substring(0, lastSeparatorPosition);
            }
            return category;

        }



http://codeofrob.com/entries/creating-a-projection-per-stream-in-the-eventstore.html

No comments:

Post a Comment