public async Task<ApiJsonResult> UpdateJobSeekerProfile(JobSeekerProfileUpdatedAdditionInfoParam param)
 {
     try {
         Guid userId = GetCurrentUserId();
         await new AccountManager(userId).UpdateJobSeekerProfile(param);
         return new ApiJsonResult { Success = true, Data = null };
     }
     catch (Exception ex) {
         return ProcessException(ex);
     }
 }
Пример #2
0
        public async Task UpdateJobSeekerProfile(JobSeekerProfileUpdatedAdditionInfoParam param)
        {
            using (AppDbContext context = new AppDbContext())
            {
                JobSeeker jobSeeker = await context.JobSeekers.FirstOrDefaultAsync(p => p.UserId == param.UserId);
                if (jobSeeker == null)
                {
                    throw new UserException(ErrorCode.INVALID_SESSION.ToString());
                }

                jobSeeker.AdditionalInfo = param.AdditionalInfo;
                jobSeeker.UpdatedDateUtc = DateTime.UtcNow;
                await context.SaveChangesAsync();
            }
        }