db access tracking
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
@ -64,7 +65,7 @@ namespace Yavsc.Controllers
|
||||
|
||||
try
|
||||
{
|
||||
_context.SaveChanges();
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
@ -93,7 +94,7 @@ namespace Yavsc.Controllers
|
||||
_context.Services.Add(service);
|
||||
try
|
||||
{
|
||||
_context.SaveChanges();
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
{
|
||||
@ -126,7 +127,7 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
|
||||
_context.Services.Remove(service);
|
||||
_context.SaveChanges();
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
|
||||
return Ok(service);
|
||||
}
|
||||
|
Reference in New Issue
Block a user