public void DeleteUsers(Users users) { if ((users.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(users, EntityState.Deleted); } else { this.ObjectContext.Users.Attach(users); this.ObjectContext.Users.DeleteObject(users); } }
public void UpdateUsers(Users currentUsers) { this.ObjectContext.Users.AttachAsModified(currentUsers, this.ChangeSet.GetOriginal(currentUsers)); }
public void InsertUsers(Users users) { if ((users.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(users, EntityState.Added); } else { this.ObjectContext.Users.AddObject(users); } }
/// <summary> /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUsers(Users users) { base.AddObject("Users", users); }
/// <summary> /// Create a new Users object. /// </summary> /// <param name="id">Initial value of the Id property.</param> public static Users CreateUsers(global::System.Int32 id) { Users users = new Users(); users.Id = id; return users; }
private bool FilterUsers(Users entity) { return (entity.Id == this.UserId); }