mirror of
https://github.com/morbalint/kemkas.git
synced 2026-07-17 19:03:46 +00:00
adding hidden basic asp.net core backend (#30)
Base functionality:
DB
email sending
user registration & login
storing new characters and reading them back
Notes:
Functionality is "hidden" with no links pointing to it.
Most pages are scaffolded and not reviewed at all :(
local Dev db setup is pushed to git
NO local email setup :(
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Kemkas.Web.Db.Enums;
|
||||
|
||||
public static class JellemExtensions
|
||||
{
|
||||
public static Jellem Convert(string jellem)
|
||||
{
|
||||
return jellem switch
|
||||
{
|
||||
"TJ" => Jellem.TorvenyesJo,
|
||||
"SJ" => Jellem.Jo,
|
||||
"KJ" => Jellem.KaotikusJo,
|
||||
"TS" => Jellem.Torvenyes,
|
||||
"S" => Jellem.Semleges,
|
||||
"KS" => Jellem.Kaotikus,
|
||||
"TG" => Jellem.TorvenyesGonosz,
|
||||
"SG" => Jellem.Gonosz,
|
||||
"KG" => Jellem.KaotikusGonosz,
|
||||
_ => throw new ValidationException("invalid jellem: " + jellem)
|
||||
};
|
||||
}
|
||||
|
||||
public static string Convert(this Jellem jellem)
|
||||
{
|
||||
return jellem switch
|
||||
{
|
||||
Jellem.TorvenyesJo => "TJ",
|
||||
Jellem.Jo => "SJ",
|
||||
Jellem.KaotikusJo => "KJ",
|
||||
Jellem.Torvenyes => "TS",
|
||||
Jellem.Semleges => "S",
|
||||
Jellem.Kaotikus => "KS",
|
||||
Jellem.TorvenyesGonosz => "TG",
|
||||
Jellem.Gonosz => "SG",
|
||||
Jellem.KaotikusGonosz => "KG",
|
||||
_ => throw new ValidationException("invalid jellem: " + (byte)jellem)
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user