コード例 #1
0
        public async Task <IActionResult> AddExperience([FromBody] ExperienceViewModel experience)
        {
            try
            {
                var result = await _profileService.AddNewExperience(experience);

                if (result == false)
                {
                    return(Json(new { Success = false, data = "can not add the experience." }));
                }
                return(Json(new { Success = true, data = "add successful" }));
            }
            catch (Exception e)
            {
                return(Json(new { Success = false, data = "error" }));
            }
        }
コード例 #2
0
 public ActionResult AddExperience([FromBody] ExperienceViewModel experience)
 {
     //Your code here;
     _profileService.AddNewExperience(experience);
     return(Json(new { Success = true }));
 }