public async Task <int> InsertAsync(User user) { _logger.LogDebug($"User {_authenticatedService.GetUserKey()} is inserting a new User - {user}"); var parameters = new DynamicParameters(); parameters.Add("name", user.Name, direction: ParameterDirection.Input); parameters.Add("email", user.Email, direction: ParameterDirection.Input); parameters.Add("password", user.Password, direction: ParameterDirection.Input); parameters.Add("active", user.Active, direction: ParameterDirection.Input); parameters.Add("confirmed", user.Confirmed, direction: ParameterDirection.Input); parameters.Add("created", user.Created, direction: ParameterDirection.Input); parameters.Add("createdby", user.CreatedBy, direction: ParameterDirection.Input); parameters.Add("updated", user.Updated, direction: ParameterDirection.Input); parameters.Add("updatedby", user.UpdatedBy, direction: ParameterDirection.Input); var id = await _sqlService.ExecuteScalarAsync <int>(UserQuery.INSERT, CommandType.Text, parameters); _logger.LogDebug($"User {id} inserted"); return(id); }