示例#1
0
 public ActionResult<Keep> Post([FromBody] Keep value)
 {
   try
   {
     var id = HttpContext.User.FindFirstValue("Id"); // THIS IS HOW YOU GET THE ID of the currently logged in user
     value.UserId = id;
     return Ok(_repo.Create(value));
   }
   catch (Exception e)
   {
     return BadRequest(e);
   }
 }
示例#2
0
 public ActionResult <Keep> Post([FromBody] Keep value)
 {
     try
     {
         var id = HttpContext.User.FindFirstValue("Id");
         value.UserId = id;
         return(Ok(_repo.Create(value)));
     }
     catch (Exception e)
     {
         return(BadRequest(e));
     }
 }
示例#3
0
 internal Keep Create(Keep newKeep)
 {
     return(_repo.Create(newKeep));
 }
示例#4
0
 public Keep Create(Keep newKeep)
 {
     newKeep.Id = _repo.Create(newKeep);
     return(newKeep);
 }
示例#5
0
 public Keep Create(Keep newKeep)
 {
     return(_kr.Create(newKeep));
 }