Exemplo n.º 1
0
 public async Task PostComment(int mediaId, string extension, CommentRequest commentRequest)
 {
     UserInfo user = await GetUserInfoAsync();
     HttpStatusCode result = await UserMediaOperations.AddMediaCommentAsync(
         DbContext, user.UserInfoId, mediaId, commentRequest);
     result.ThrowHttpResponseExceptionIfNotSuccessful();
 }
Exemplo n.º 2
0
        public static async Task<HttpStatusCode> AddTimelineEntryCommentAsync(
            ApplicationDbContext dbContext,
            string userId,
            int entryId,
            CommentRequest comment)
        {
            TimelineEntry entryEntity = await dbContext.TimelineEntries
                .SingleOrDefaultAsync(te => te.TimelineEntryId == entryId);
            if (entryEntity == null)
            {
                // The entry id is part of the URL, so return a 404.
                return HttpStatusCode.NotFound;
            }

            return await CommentOperations.AddCommentAsync(
                dbContext,
                userId,
                new CommentItemIds {  TimelineEntryId = entryId },
                e => e.CommentThread,
                entryEntity,
                comment);
        }
Exemplo n.º 3
0
 public async Task PostComment(int entryId, CommentRequest commentRequest)
 {
     HttpStatusCode result = await TimelineOperations.AddTimelineEntryCommentAsync(
         DbContext, UserId, entryId, commentRequest);
     result.ThrowHttpResponseExceptionIfNotSuccessful();
 }
Exemplo n.º 4
0
        public static async Task<HttpStatusCode> AddAlbumCommentAsync(
            ApplicationDbContext dbContext,
            string userId,
            int albumId,
            CommentRequest comment)
        {
            MediaAlbum albumEntity = await dbContext.MediaAlbums
                .SingleOrDefaultAsync(te => te.MediaAlbumId == albumId);
            if (albumEntity == null)
            {
                // The entry id is part of the URL, so return a 404.
                return HttpStatusCode.NotFound;
            }

            return await CommentOperations.AddCommentAsync(
                dbContext,
                userId,
                new CommentItemIds { AlbumId = albumId },
                e => e.CommentThread,
                albumEntity,
                comment);
        }
Exemplo n.º 5
0
 public async Task PostComment(int albumId, CommentRequest commentRequest)
 {
     HttpStatusCode result = await AlbumOperations.AddAlbumCommentAsync(
         DbContext, UserId, albumId, commentRequest);
     result.ThrowHttpResponseExceptionIfNotSuccessful();
 }