public async Task SaveLinkedInUserBasicProfileData( string identityId, string accessToken, LinkedInBasicUserProfileData userInfo ) { await _context.JwtAuthUsers.AddAsync( new JwtAuthUser { IdentityId = identityId, Location = (userInfo.Location != null) ? userInfo.Location.Name : string.Empty, CurrentPosition = (userInfo.Positions != null && userInfo.Positions.Total > 0) ? userInfo.Positions.Values .Where(p => p.IsCurrent == true) .Select(p => { return($"{p.Title} at {p.Company.Name}"); }) .SingleOrDefault() : string.Empty, Headline = userInfo.Headline, PublicProfileUrl = userInfo.PublicProfileUrl, Summary = userInfo.Summary } ); }
private bool _linkedInDataNeedsUpdate(ApplicationUser localUser, LinkedInBasicUserProfileData user) { return ((string.IsNullOrEmpty(localUser.LinkedInId)) || (!string.IsNullOrEmpty(localUser.LinkedInId) && localUser.LinkedInId != user.Id) || (string.IsNullOrEmpty(localUser.PictureUrl)) || (!string.IsNullOrEmpty(localUser.PictureUrl) && localUser.PictureUrl != user.PictureUrl)); }