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); } }
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(); } }