private void CompareAndPrepareProfile( string profileName, string profileValue, string userName, string logoUrl, IQueryable <UserSiteProfile> siteProfiles, string prefix) { var siteProfile = siteProfiles.FirstOrDefault(x => x.Name == profileName); if (siteProfile != null && string.IsNullOrWhiteSpace(profileValue)) { profileRepo.DeleteOnCommit(siteProfile); } if (siteProfile == null && !string.IsNullOrWhiteSpace(profileValue)) { var newSiteProfile = new UserSiteProfile(); newSiteProfile.Username = userName; newSiteProfile.Name = profileName; newSiteProfile.Url = prefix + profileValue; newSiteProfile.Image = logoUrl; profileRepo.InsertOnCommit(newSiteProfile); } if (siteProfile != null && !string.IsNullOrWhiteSpace(profileValue)) { siteProfile.Url = prefix + profileValue; siteProfile.Image = logoUrl; } }
private void CompareAndPrepareProfile(string profileName, string profileValue, string userName, string logoUrl, IQueryable<UserSiteProfile> siteProfiles, string prefix) { var siteProfile = siteProfiles.FirstOrDefault(x => x.Name == profileName); if (siteProfile != null && string.IsNullOrWhiteSpace(profileValue)) { profileRepo.DeleteOnCommit(siteProfile); } if (siteProfile == null && !string.IsNullOrWhiteSpace(profileValue)) { var newSiteProfile = new UserSiteProfile(); newSiteProfile.Username = userName; newSiteProfile.Name = profileName; newSiteProfile.Url = prefix + profileValue; newSiteProfile.Image = logoUrl; profileRepo.InsertOnCommit(newSiteProfile); } if (siteProfile != null && !string.IsNullOrWhiteSpace(profileValue)) { siteProfile.Url = prefix + profileValue; siteProfile.Image = logoUrl; } }