using InvercargillSql.Orm; using Inversion; namespace Spry.Authentication { /** * Persistent user account row (`spry_users`). Passwords are stored as * libsodium hashes via {@link UserService}. */ public class UserEntity : Object { public int64 id { get; set; } public string username { get; set; } public string email { get; set; } public string forename { get; set; } public string surname { get; set; } public string password_hash { get; set; } public DateTime date_of_birth { get; set; } public DateTime created { get; set; } public DateTime modified { get; set; } public bool enabled { get; set; } public static void entity_mapping(EntityMapperBuilder cfg) { cfg.table("spry_users") .column("id", o => o.id, (o, v) => o.id = v) .column("username", o => o.username, (o, v) => o.username = v) .column("email", o => o.email, (o, v) => o.email = v) .column("forename", o => o.forename, (o, v) => o.forename = v) .column("surname", o => o.surname, (o, v) => o.surname = v) .column("password_hash", o => o.password_hash, (o, v) => o.password_hash = v) .column("date_of_birth", o => o.date_of_birth, (o, v) => o.date_of_birth = v) .column("created", o => o.created, (o, v) => o.created = v) .column("modified", o => o.modified, (o, v) => o.modified = v) .column("enabled", o => o.enabled, (o, v) => o.enabled = v); } } }