public async Task<ApiJsonResult> UpdateJobSeekerProfile(JobSeekerProfileUpdatedInterestInParams 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(JobSeekerProfileUpdatedInterestInParams 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.InterestIn = param.InterestIn;
                jobSeeker.UpdatedDateUtc = DateTime.UtcNow;
                await context.SaveChangesAsync();
            }
        }