33 lines
904 B
C#
33 lines
904 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
namespace Server.SQL
|
|
{
|
|
[Table("user", Schema = "gamedb")]
|
|
public class User
|
|
{
|
|
public int id { get; set; }
|
|
public string uuid { get; set; }
|
|
public string mail { get; set; }
|
|
public string nickname { get; set; }
|
|
}
|
|
|
|
public class UserSQL : SQL<User>
|
|
{
|
|
public override DbSet<User> table { get; set; }
|
|
public override string tablename { get { return "user"; } }
|
|
|
|
public User SelectUuid(string uuid)
|
|
{
|
|
return table.SingleOrDefault(data => data.uuid == uuid);
|
|
}
|
|
|
|
public User SelectMail(string mail)
|
|
{
|
|
return table.SingleOrDefault(data => data.mail == mail);
|
|
}
|
|
}
|
|
}
|