Exemplo n.º 1
0
 public void DeleteUserProfile(UserProfile userProfile)
 {
     if ((userProfile.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(userProfile, EntityState.Deleted);
     }
     else
     {
         this.ObjectContext.UserProfile.Attach(userProfile);
         this.ObjectContext.UserProfile.DeleteObject(userProfile);
     }
 }
Exemplo n.º 2
0
 public void UpdateUserProfile(UserProfile currentUserProfile)
 {
     this.ObjectContext.UserProfile.AttachAsModified(currentUserProfile, this.ChangeSet.GetOriginal(currentUserProfile));
 }
Exemplo n.º 3
0
 public void InsertUserProfile(UserProfile userProfile)
 {
     if ((userProfile.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(userProfile, EntityState.Added);
     }
     else
     {
         this.ObjectContext.UserProfile.AddObject(userProfile);
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the UserProfile EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUserProfile(UserProfile userProfile)
 {
     base.AddObject("UserProfile", userProfile);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new UserProfile object.
 /// </summary>
 /// <param name="userId">Initial value of the UserId property.</param>
 public static UserProfile CreateUserProfile(global::System.Int32 userId)
 {
     UserProfile userProfile = new UserProfile();
     userProfile.UserId = userId;
     return userProfile;
 }
 private bool FilterUserProfile(UserProfile entity)
 {
     return (entity.UserId == this.Id);
 }