Пример #1
0
        public void CreateUserTest()
        {
            DbUser dbUser = new DbUser();

            try
            {
                User user = new User
                {
                    HashPassword = "",
                    Salt         = "",
                    UserName     = "******",
                    UserType     = new UserType
                    {
                        UserTypeId = 1
                    }
                };

                int userId = dbUser.Create(user);
                Assert.IsTrue(userId > 0);
            }
            catch (FaultException <DbConnectionException> )
            {
                Assert.Fail();
            }
        }
Пример #2
0
 /// <summary>
 /// creates a user in database
 /// </summary>
 /// <param name="user"></param>
 /// <returns>int</returns>
 public int CreateUser(User user)
 {
     return(_dbUser.Create(user));
 }
Пример #3
0
        public async Task CreateAsync(User user)
        {
            await _context.Users.AddAsync(DbUser.Create(user));

            await _context.SaveChangesAsync();
        }