Beispiel #1
0
 /// <summary>
 /// Add a user to the database
 /// </summary>
 /// <param name="owner">The user to add</param>
 public static bool AddUser(Owner owner)
 {
     try
     {
         using (var context = new OOADEntities())
         {
             user u = new user();
             u.name = owner.Name;
             context.users.AddObject(u);
             context.SaveChanges();
             return true;
         }
     }
     catch (Exception) { return false; }
 }
 /// <summary>
 /// Create a new user object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static user Createuser(global::System.Int32 id)
 {
     user user = new user();
     user.id = id;
     return user;
 }
 /// <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(user user)
 {
     base.AddObject("users", user);
 }