Пример #1
0
        /// <summary>
        /// Create a new UserProfileLogin object.
        /// </summary>
        /// <param name="uniqueIdentifier">Initial value of the UniqueIdentifier property.</param>
        public static UserProfileLogin CreateUserProfileLogin(global::System.String uniqueIdentifier)
        {
            UserProfileLogin userProfileLogin = new UserProfileLogin();

            userProfileLogin.UniqueIdentifier = uniqueIdentifier;
            return(userProfileLogin);
        }
Пример #2
0
 private void AddUserProfile(User user)
 {
     using (var dc = new LessThanDatabase())
     {
         var userProfileLogin = dc.UserProfileLogins.FirstOrDefault(a => a.UniqueIdentifier == user.ClaimedIdentifier);
         if (userProfileLogin == null)
         {
             var userProfile = new UserProfile
                               {
                                   EmailAddress = user.EmailAddress,
                                   FullName = user.Name,
                                   UserName = user.EmailAddress
                               };
             dc.UserProfiles.AddObject(userProfile);
             userProfileLogin = new UserProfileLogin
             {
                 UniqueIdentifier = user.ClaimedIdentifier,
                 UserProfile = userProfile
             };
             dc.UserProfileLogins.AddObject(userProfileLogin);
             dc.SaveChanges();
         }
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the UserProfileLogins EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUserProfileLogins(UserProfileLogin userProfileLogin)
 {
     base.AddObject("UserProfileLogins", userProfileLogin);
 }
 /// <summary>
 /// Create a new UserProfileLogin object.
 /// </summary>
 /// <param name="uniqueIdentifier">Initial value of the UniqueIdentifier property.</param>
 public static UserProfileLogin CreateUserProfileLogin(global::System.String uniqueIdentifier)
 {
     UserProfileLogin userProfileLogin = new UserProfileLogin();
     userProfileLogin.UniqueIdentifier = uniqueIdentifier;
     return userProfileLogin;
 }
Пример #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the UserProfileLogins EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUserProfileLogins(UserProfileLogin userProfileLogin)
 {
     base.AddObject("UserProfileLogins", userProfileLogin);
 }
Пример #6
0
 private void AddUserProfileLogin(User user)
 {
     using (var dc = new LessThanDatabase())
     {
         var userProfileLogin = dc.UserProfileLogins.FirstOrDefault(a => a.UniqueIdentifier == user.ClaimedIdentifier);
         if (userProfileLogin == null)
         {
             userProfileLogin = new UserProfileLogin
                                    {
                                        UniqueIdentifier = user.ClaimedIdentifier,
                                        UserProfile = dc.UserProfiles.First(a => a.UserProfileLogins.Any(b=>b.UniqueIdentifier == User.Identity.Name))
                                    };
             dc.UserProfileLogins.AddObject(userProfileLogin);
             dc.SaveChanges();
         }
     }
 }