PageRenderTime 31ms CodeModel.GetById 23ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Samples/Blog/Bifrost.Samples.Blog.Events/Posts/PostCreatedToBlogPostCreatedMigrator.cs

#
C# | 17 lines | 16 code | 1 blank | 0 comment | 0 complexity | 4d6c72d06c2fa7b9f996ee5d2e1d77fc MD5 | raw file
 1using Bifrost.Events;
 2using Bifrost.Time;
 3
 4namespace Bifrost.Samples.Blog.Events.Posts
 5{
 6    public class PostCreatedToBlogPostCreatedMigrator : IEventMigrator<PostCreated, BlogPostCreated>
 7    {
 8        public BlogPostCreated Migrate(PostCreated source)
 9        {
10            return new BlogPostCreated(source.Id, source.BlogId, source.Title)
11                       {
12                           PublishedDate = source.PublishedDate,
13                           CreatedAt = SystemClock.GetCurrentTime()
14                       };
15        }
16    }
17}