Exemple #1
0
        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()))));
        }
        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)));
        }