vassago/Models/User.cs

28 lines
831 B
C#
Raw Normal View History

2023-06-01 00:03:23 -04:00
namespace vassago.Models;
using System;
2023-06-01 00:03:23 -04:00
using System.Collections.Generic;
2023-06-05 14:55:48 -04:00
using System.ComponentModel.DataAnnotations.Schema;
using System.Reflection;
2023-06-19 12:56:40 -04:00
public class User
{
2023-06-05 14:55:48 -04:00
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
2023-06-01 00:03:23 -04:00
public Guid Id { get; set; }
2023-06-19 12:56:40 -04:00
public List<Account> Accounts { get; set; }
2024-07-07 14:22:10 -04:00
//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
{
return Accounts.Select(a => a.DisplayName).Distinct()
.MaxBy(distinctName =>
Accounts.Select(a => a.DisplayName)
.Where(selectedName => selectedName == distinctName).Count()
);
}
}
}