Exemplo n.º 1
0
 /// <summary>
 /// Create a new User object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="username">Initial value of the Username property.</param>
 /// <param name="password">Initial value of the Password property.</param>
 /// <param name="type">Initial value of the Type property.</param>
 /// <param name="email">Initial value of the Email property.</param>
 public static User CreateUser(global::System.Int32 id, global::System.String username, global::System.String password, global::System.Int32 type, global::System.String email)
 {
     User user = new User();
     user.ID = id;
     user.Username = username;
     user.Password = password;
     user.Type = type;
     user.Email = email;
     return user;
 }
Exemplo n.º 2
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(User user)
 {
     base.AddObject("Users", user);
 }
Exemplo n.º 3
0
 public static void RegisterUser(string username, string password, string email)
 {
     using (TopCoderPrototypeEntities model = new TopCoderPrototypeEntities())
     {
         User user = new User();
         user.Username = username;
         user.Password = password;
         user.Email = email;
         user.Type = 1;
         model.Users.AddObject(user);
         model.SaveChanges();
     }
 }