/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
- using Bifrost.Events;
- using Bifrost.Time;
-
- namespace Bifrost.Samples.Blog.Events.Posts
- {
- public class PostCreatedToBlogPostCreatedMigrator : IEventMigrator<PostCreated, BlogPostCreated>
- {
- public BlogPostCreated Migrate(PostCreated source)
- {
- return new BlogPostCreated(source.Id, source.BlogId, source.Title)
- {
- PublishedDate = source.PublishedDate,
- CreatedAt = SystemClock.GetCurrentTime()
- };
- }
- }
- }