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,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Kemkas.Web.Db.Enums;
|
||||
|
||||
public static class TulajdonsagExtensions
|
||||
{
|
||||
public static Tulajdonsag Convert(string tulajdonsag)
|
||||
{
|
||||
return tulajdonsag switch
|
||||
{
|
||||
"t_ero" => Tulajdonsag.Ero,
|
||||
"t_ugy" => Tulajdonsag.Ugyesseg,
|
||||
"t_egs" => Tulajdonsag.Egeszseg,
|
||||
"t_int" => Tulajdonsag.Intelligencia,
|
||||
"t_bol" => Tulajdonsag.Bolcsesseg,
|
||||
"t_kar" => Tulajdonsag.Karizma,
|
||||
_ => throw new ValidationException("invalid tulajdonsag: " + tulajdonsag),
|
||||
};
|
||||
}
|
||||
|
||||
public static string Convert(this Tulajdonsag tulajdonsag)
|
||||
{
|
||||
return tulajdonsag switch
|
||||
{
|
||||
Tulajdonsag.Ero => "t_ero",
|
||||
Tulajdonsag.Ugyesseg => "t_ugy",
|
||||
Tulajdonsag.Egeszseg => "t_egs",
|
||||
Tulajdonsag.Intelligencia => "t_int",
|
||||
Tulajdonsag.Bolcsesseg => "t_bol",
|
||||
Tulajdonsag.Karizma => "t_kar",
|
||||
_ => throw new ValidationException("invalid tulajdonsag: " + tulajdonsag),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user