Files
kemkas-frontend/Kemkas.Web/Db/Enums/TulajdonsagExtensions.cs
T
morbalint 7bb7ab6f13 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 :(
2023-12-19 19:03:57 +01:00

34 lines
1.1 KiB
C#

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),
};
}
}