2023-06-01 00:03:23 -04:00
|
|
|
namespace vassago.Models;
|
|
|
|
|
2023-05-23 19:03:58 -04:00
|
|
|
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-05-23 19:03:58 -04:00
|
|
|
|
2023-06-19 12:56:40 -04:00
|
|
|
public class User
|
2023-05-23 19:03:58 -04:00
|
|
|
{
|
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; }
|
2023-11-30 12:50:51 -05:00
|
|
|
|
|
|
|
public string DisplayName
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return Accounts.Select(a => a.DisplayName).Distinct()
|
|
|
|
.MaxBy(distinctName =>
|
|
|
|
Accounts.Select(a => a.DisplayName)
|
|
|
|
.Where(selectedName => selectedName == distinctName).Count()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2023-05-23 19:03:58 -04:00
|
|
|
}
|