PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 0ms 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
Possible License(s): CC-BY-SA-3.0
  1. using Bifrost.Events;
  2. using Bifrost.Time;
  3. namespace Bifrost.Samples.Blog.Events.Posts
  4. {
  5. public class PostCreatedToBlogPostCreatedMigrator : IEventMigrator<PostCreated, BlogPostCreated>
  6. {
  7. public BlogPostCreated Migrate(PostCreated source)
  8. {
  9. return new BlogPostCreated(source.Id, source.BlogId, source.Title)
  10. {
  11. PublishedDate = source.PublishedDate,
  12. CreatedAt = SystemClock.GetCurrentTime()
  13. };
  14. }
  15. }
  16. }