/Source/Samples/Blog/Bifrost.Samples.Blog.Views/Posts/CommentEventSubscriber.cs
C# | 24 lines | 23 code | 1 blank | 0 comment | 0 complexity | a6a530ea15d1ae9d674cf85ea262d69c MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using System;
- using Bifrost.Events;
- using Bifrost.Samples.Blog.Events.Posts;
-
- namespace Bifrost.Samples.Blog.Views.Posts
- {
- public class CommentEventSubscriber : EventSubscriber<Comment>
- {
- public void Process(CommentAdded @event)
- {
- var comment = new Comment
- {
- Id = Guid.NewGuid(),
- Author = @event.Author,
- EMail = @event.EMail,
- Url = @event.Url,
- Occured = @event.Occured,
- PostId = @event.EventSourceId,
- Body = @event.Comment
- };
- InsertEntity(comment);
- }
- }
- }