Exemplo n.º 1
0
 public Board DeleteBoard(string id)
 {
     try
     {
         var userId = HttpContext.User.Claims.Where(c => c.Type == ClaimTypes.Name)
                      .Select(c => c.Value).SingleOrDefault();
         Board board = _boardRepo.GetBoardById(userId, id);
         if (board.UserId == userId)
         {
             return(_boardRepo.DeleteBoard(id));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception e)
     {
         System.Console.WriteLine(e.Message);
         return(null);
     }
 }