public IActionResult UpdateCandidate(CandidateRequestModel requestModel, int CandidateId)
        {
            var user = HttpContext.User;

            if (user.HasClaim(c => c.Type == "Typetoken"))
            {
                if (user.Claims.FirstOrDefault(c => c.Type == "Typetoken").Value == "Login")
                {
                    var result = candidateBL.UpdateCandidate(requestModel, CandidateId);
                    if (result != null)
                    {
                        var success = true;
                        var message = "Candidate Update successfully";
                        return(Ok(new { success, message, result }));
                    }
                    else
                    {
                        var success = false;
                        var message = "candidate Updation failed";
                        return(Ok(new { success, message, result }));
                    }
                }
            }
            return(BadRequest("Used Invalid Token"));
        }
Exemplo n.º 2
0
 /// <summary>
 /// This is the method for Update candidate.
 /// </summary>
 /// <param name="requestModel"></param>
 /// <returns></returns>
 public CandidateResponseModel UpdateCandidate(CandidateRequestModel requestModel, int CandidateId)
 {
     try
     {
         if (requestModel != null)
         {
             return(candidateRL.UpdateCandidate(requestModel, CandidateId));
         }
         else
         {
             return(null);
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }