parent
608e9a7f9e
commit
ed619cdc17
18 changed files with 47 additions and 46 deletions
|
@ -1,6 +1,6 @@
|
|||
namespace Myhm.Data
|
||||
namespace LookingGlass.Data
|
||||
{
|
||||
public class MyhmConfiguration
|
||||
public class ApplicationSettings
|
||||
{
|
||||
public required string AuthToken { get; init; }
|
||||
public required string DatabaseConnectionString { get; init; }
|
|
@ -1,9 +1,10 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using static EnumStringValues.EnumExtensions;
|
||||
|
||||
namespace Myhm.Data
|
||||
namespace LookingGlass.Data
|
||||
{
|
||||
public class MyhmContext(DbContextOptions<MyhmContext> options) : DbContext(options)
|
||||
public class ApplicationContext(DbContextOptions<ApplicationContext> options)
|
||||
: DbContext(options)
|
||||
{
|
||||
public DbSet<Moderation> Moderation { get; set; } = default!;
|
||||
public DbSet<User> User { get; set; } = default!;
|
|
@ -1,6 +1,6 @@
|
|||
using EnumStringValues;
|
||||
|
||||
namespace Myhm.Data;
|
||||
namespace LookingGlass.Data;
|
||||
|
||||
public class Moderation
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Myhm.Data;
|
||||
namespace LookingGlass.Data;
|
||||
|
||||
public class User
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ public class User
|
|||
public bool WriteAccess { get; set; } = false;
|
||||
public bool Disabled { get; set; } = false;
|
||||
|
||||
public static User FromToken(string token, MyhmContext context)
|
||||
public static User FromToken(string token, ApplicationContext context)
|
||||
{
|
||||
User user =
|
||||
context.User.First(u => u.Token == token) ?? throw new Exception("User not found");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue