/Source/Samples/Blog/Bifrost.Samples.Blog.Views/Posts/PostTagEventSubscriber.cs
C# | 24 lines | 21 code | 3 blank | 0 comment | 0 complexity | eee68f13479715975eaed56ffcf98f89 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using Bifrost.Events;
- using Bifrost.Samples.Blog.Events.Tags;
-
- namespace Bifrost.Samples.Blog.Views.Posts
- {
- public class PostTagEventSubscriber : EventSubscriber<PostTag>
- {
- public void Process(TagCreated @event)
- {
- var postTag = new PostTag {Id = @event.EventSourceId};
- InsertEntity(postTag);
- }
-
- public void Process(TagNameSet @event)
- {
- UpdateProperty(@event, p => p.Name = @event.TagName);
- }
-
- public void Process(TagDeleted @event)
- {
- DeleteEntity(@event);
- }
- }
- }