vassago/Models/User.cs
adam 2793e6ef76
Some checks failed
gitea.arg.rip/vassago/pipeline/head There was a failure building this commit
fixed the launch error I was gettign
2025-01-28 17:09:23 -05:00

35 lines
1013 B
C#

namespace vassago.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Reflection;
public class User
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }
public List<Account> Accounts { get; set; }
//if I ever get lots and lots of tags, or some automatic way to register a feature's arbitrary tags, then I can move this off.
//public bool Tag_CanTwitchSummon { get; set; }
public string DisplayName
{
get
{
if (Accounts?.Any() ?? false)
{
return Accounts.Select(a => a.DisplayName).Distinct()
.MaxBy(distinctName =>
Accounts.Select(a => a.DisplayName)
.Where(selectedName => selectedName == distinctName).Count()
);
}
else
{
return $"[accountless {Id}";
}
}
}
}