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(); } }
/// <summary> /// creates a user in database /// </summary> /// <param name="user"></param> /// <returns>int</returns> public int CreateUser(User user) { return(_dbUser.Create(user)); }
public async Task CreateAsync(User user) { await _context.Users.AddAsync(DbUser.Create(user)); await _context.SaveChangesAsync(); }