api-server-setup #1
@@ -21,10 +21,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
|
||||
using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) {
|
||||
while( await reader.ReadAsync() ) {
|
||||
if( reader == null ) {
|
||||
break;
|
||||
}
|
||||
|
||||
if( reader == null ) { break; }
|
||||
int _id = reader.GetInt32("ID");
|
||||
string _username = reader.GetString("UserName");
|
||||
string _email = reader.GetString("Email");
|
||||
@@ -56,7 +53,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
return account;
|
||||
}
|
||||
|
||||
public async Task<Account?> GetAccount( int ID ) {
|
||||
public async Task<Account?> GetAccount( int AccountID ) {
|
||||
Account? account = null;
|
||||
using( MySqlConnection connection = GetConnection() ) {
|
||||
connection.Open();
|
||||
@@ -67,7 +64,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(command, connection);
|
||||
cmd.Parameters.AddWithValue("@ID", ID);
|
||||
cmd.Parameters.AddWithValue("@ID", AccountID);
|
||||
|
||||
using( DbDataReader reader = await cmd.ExecuteReaderAsync() ) {
|
||||
while( await reader.ReadAsync() ) {
|
||||
@@ -144,7 +141,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
}
|
||||
}
|
||||
|
||||
public async Task DeleteAccount( int ID ) {
|
||||
public async Task DeleteAccount( int AccountID ) {
|
||||
using( MySqlConnection connection = GetConnection() ) {
|
||||
MySqlCommand cmd;
|
||||
connection.Open();
|
||||
@@ -153,7 +150,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
DELETE FROM Account WHERE ID = @ID;
|
||||
";
|
||||
cmd = new MySqlCommand( command, connection );
|
||||
cmd.Parameters.AddWithValue("@ID", ID);
|
||||
cmd.Parameters.AddWithValue("@ID", AccountID);
|
||||
|
||||
await cmd.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
|
||||
}
|
||||
|
||||
public async Task DeleteResume( int ID ) {
|
||||
public async Task DeleteResume( int ResumeID ) {
|
||||
using( MySqlConnection connection = GetConnection() ) {
|
||||
MySqlCommand cmd;
|
||||
connection.Open();
|
||||
@@ -227,7 +227,7 @@ namespace BoredCareers.Services.DatabaseService {
|
||||
DELETE FROM Resume WHERE ID = @ID;
|
||||
";
|
||||
cmd = new MySqlCommand( command, connection );
|
||||
cmd.Parameters.AddWithValue("@ID", ID);
|
||||
cmd.Parameters.AddWithValue("@ID", ResumeID);
|
||||
|
||||
await cmd.ExecuteNonQueryAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user