Thread on the server better
This commit is contained in:
@@ -10,7 +10,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
public async Task<Company?> GetCompany( int CompanyID ) {
|
||||
Company? company = null;
|
||||
using( MySqlConnection connection = GetConnection() ) {
|
||||
connection.Open();
|
||||
await connection.OpenAsync();
|
||||
string command = @"
|
||||
SELECT *
|
||||
FROM Company
|
||||
@@ -22,7 +22,6 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
|
||||
using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) {
|
||||
while( await reader.ReadAsync() ) {
|
||||
if( reader == null ) { break; }
|
||||
int _id = reader.GetInt32("ID");
|
||||
string _name = reader.GetString("Name");
|
||||
string _email = reader.GetString("Email");
|
||||
@@ -58,8 +57,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
|
||||
public async Task<int> SetCompany( Company company ) {
|
||||
using (MySqlConnection connection = GetConnection()) {
|
||||
connection.Open();
|
||||
|
||||
await connection.OpenAsync();
|
||||
string command = @"
|
||||
INSERT INTO Company
|
||||
(ID,Name,Email,EmailVerified,WebsiteURL,Logo,Phone,PostalCode,Country,StateOrRegion,City,Description)
|
||||
@@ -104,7 +102,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
public async Task DeleteCompany( int CompanyID ) {
|
||||
using( MySqlConnection connection = GetConnection() ) {
|
||||
MySqlCommand cmd;
|
||||
connection.Open();
|
||||
await connection.OpenAsync();
|
||||
|
||||
string command = @"
|
||||
DELETE FROM Company WHERE ID = @ID;
|
||||
|
||||
Reference in New Issue
Block a user