Implement SQL for users, implement retrieving user from database

This commit is contained in:
jvyden 2021-10-06 13:38:27 -04:00
parent f179e0df8d
commit 8a3393b0fb
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
8 changed files with 67 additions and 10 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ProjectLighthouse.Types;
@ -8,5 +9,13 @@ namespace ProjectLighthouse {
ServerSettings.DbConnectionString,
MySqlServerVersion.LatestSupportedServerVersion
);
public async Task CreateUser(string username) {
await this.Database.ExecuteSqlRawAsync(
"INSERT INTO Users (Username, Biography) VALUES ({0}, {1})",
username, "");
}
public DbSet<User> Users { get; set; }
}
}