public async Task<ApiJsonResult> UpdateJobSeekerProfile(EmployerProfileUpdatedOverviewParams param) { try { Guid userId = GetCurrentUserId(); await new AccountManager(userId).UpdateEmployerProfile(param); return new ApiJsonResult { Success = true, Data = null }; } catch (Exception ex) { return ProcessException(ex); } }
public async Task UpdateEmployerProfile(EmployerProfileUpdatedOverviewParams employerProfileUpdatedOverviewParams) { using (AppDbContext context = new AppDbContext()) { Employer employer = await context.Employers.FirstOrDefaultAsync(p => p.UserId == employerProfileUpdatedOverviewParams.UserId); if (employer == null) { throw new UserException(ErrorCode.INVALID_SESSION.ToString()); } employer.OverView = employerProfileUpdatedOverviewParams.OverView; await context.SaveChangesAsync(); } }