mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-06-01 13:42:28 +00:00
Implement SQL for users, implement retrieving user from database
This commit is contained in:
parent
f179e0df8d
commit
8a3393b0fb
8 changed files with 67 additions and 10 deletions
|
@ -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; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue