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); } }
public void UpdateUserProfile(UserProfile currentUserProfile) { this.ObjectContext.UserProfile.AttachAsModified(currentUserProfile, this.ChangeSet.GetOriginal(currentUserProfile)); }
public void InsertUserProfile(UserProfile userProfile) { if ((userProfile.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(userProfile, EntityState.Added); } else { this.ObjectContext.UserProfile.AddObject(userProfile); } }
/// <summary> /// Deprecated Method for adding a new object to the UserProfile EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUserProfile(UserProfile userProfile) { base.AddObject("UserProfile", userProfile); }
/// <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); }