示例#1
0
 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);
     }
 }
示例#2
0
 public void UpdateUsers(Users currentUsers)
 {
     this.ObjectContext.Users.AttachAsModified(currentUsers, this.ChangeSet.GetOriginal(currentUsers));
 }
示例#3
0
 public void InsertUsers(Users users)
 {
     if ((users.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(users, EntityState.Added);
     }
     else
     {
         this.ObjectContext.Users.AddObject(users);
     }
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsers(Users users)
 {
     base.AddObject("Users", users);
 }
示例#5
0
 /// <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);
 }