From becd37e6cf8233fac8a4f898d44d4b20e1d5666e Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 5 Oct 2017 11:57:29 +0200 Subject: [PATCH] fixes the comment dates --- Yavsc/ApiControllers/CommentsApiController.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Yavsc/ApiControllers/CommentsApiController.cs b/Yavsc/ApiControllers/CommentsApiController.cs index db9789e1..c0360c38 100644 --- a/Yavsc/ApiControllers/CommentsApiController.cs +++ b/Yavsc/ApiControllers/CommentsApiController.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Http; using Microsoft.AspNet.Mvc; @@ -64,7 +65,7 @@ namespace Yavsc.Controllers try { - await _context.SaveChangesAsync(); + await _context.SaveChangesAsync(User.GetUserId()); } catch (DbUpdateConcurrencyException) { @@ -93,7 +94,7 @@ namespace Yavsc.Controllers _context.Comment.Add(comment); try { - await _context.SaveChangesAsync(); + await _context.SaveChangesAsync(User.GetUserId()); } catch (DbUpdateException) { @@ -126,7 +127,7 @@ namespace Yavsc.Controllers } _context.Comment.Remove(comment); - await _context.SaveChangesAsync(); + await _context.SaveChangesAsync(User.GetUserId()); return Ok(comment); }