예제 #1
0
 public static Post To(RawPost value)
 {
     return(new Post
     {
         Id = value.Id,
         AuthorId = value.AuthorId,
         Category = AcBlog.Data.Models.Category.Parse(value.Category),
         CreationTime = value.CreationTime,
         ModificationTime = value.ModificationTime,
         Title = value.Title,
         Type = value.Type,
         Keywords = AcBlog.Data.Models.Keyword.Parse(value.Keywords),
         Content = JsonSerializer.Deserialize <Document>(value.Content),
     });
 }
예제 #2
0
 public static Post To(RawPost value)
 {
     return(new Post
     {
         Id = value.Id,
         Author = value.Author,
         Category = CategoryBuilder.FromString(value.Category),
         CreationTime = value.CreationTime,
         ModificationTime = value.ModificationTime,
         Title = value.Title,
         Type = value.Type,
         Keywords = KeywordBuilder.FromString(value.Keywords),
         Content = JsonSerializer.Deserialize <Document>(value.Content),
     });
 }