public void CreateUser() { using (TransactionScope scope = new TransactionScope()) { string email = "*****@*****.**"; User u = new User() { Password = "******", Email = email, IsActive = true, CreatedAt = DateTime.Now }; User.SaveUser(u); Assert.IsNotNull(User.GetByEmail(email)); } }
partial void DeleteUser(User instance);
partial void UpdateUser(User instance);
partial void InsertUser(User instance);
/// <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(User user) { base.AddObject("Users", user); }
/// <summary> /// Create a new User object. /// </summary> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="password">Initial value of the Password property.</param> /// <param name="email">Initial value of the Email property.</param> /// <param name="isActive">Initial value of the IsActive property.</param> /// <param name="createdAt">Initial value of the CreatedAt property.</param> public static User CreateUser(global::System.Int32 userId, global::System.String password, global::System.String email, global::System.Boolean isActive, global::System.DateTime createdAt) { User user = new User(); user.UserId = userId; user.Password = password; user.Email = email; user.IsActive = isActive; user.CreatedAt = createdAt; return user; }