7bb7ab6f13
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 :(
40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
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)
|
|
};
|
|
}
|
|
} |