Esempio n. 1
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),
     });
 }
Esempio n. 2
0
        public async Task <KeywordCollection> GetKeywords(CancellationToken cancellationToken = default)
        {
            var cates = DbSet.AsQueryable().Select(x => x.Keywords).Distinct().AsAsyncEnumerable();

            return(await KeywordCollectionBuilder.Build(cates.Select(x => KeywordBuilder.FromString(x)), cancellationToken));
        }