コード例 #1
0
ファイル: NewsFeedStorage.cs プロジェクト: prktkn/gateway
        public async Task <NewsFeedPublication> CreateAsync(string content, string author)
        {
            var model  = new CreatePublicationModel(content, author);
            var entity = await publicationsApi.CreateAsync(model);

            return(new NewsFeedPublication(entity.Id, entity.Content, new CommentsShort(Enumerable.Empty <PublicationComment>(), 0),
                                           new ReactionShort(new Dictionary <ReactionType, int>(), new UserReaction(new ReactionType()))));
        }
コード例 #2
0
        public async Task <NewsFeedPublication> PublishAsync(string content, string userId)
        {
            var model  = new CreatePublicationModel(content, userId);
            var entity = await publicationsApi.CreateAsync(model);

            return(new NewsFeedPublication(
                       entity.Id,
                       entity.Content,
                       entity.CreatedOn,
                       entity.UpdatedOn,
                       new CommentsShort(Enumerable.Empty <PublicationComment>(), 0),
                       new ReactionShort(new Dictionary <ReactionType, int>(), null),
                       ToUser(entity.Author)));
        }