2022-07-21 01:55:08 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
namespace RegexBot.Data;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents an item in the user cache.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Table("cache_users")]
|
|
|
|
|
public class CachedUser {
|
|
|
|
|
/// <summary>
|
2022-08-24 02:57:04 +00:00
|
|
|
|
/// Gets the associated user's snowflake ID.
|
2022-07-21 01:55:08 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
[Key]
|
|
|
|
|
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
|
|
|
|
public long UserId { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the timestamp showing when this cache entry was last updated.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public DateTimeOffset ULastUpdateTime { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the user's username value, without the discriminator.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Username { get; set; } = null!;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2023-11-15 03:24:46 +00:00
|
|
|
|
/// Gets the user's discriminator value. A value of "0000" means the user is on the new username system.
|
2022-07-21 01:55:08 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public string Discriminator { get; set; } = null!;
|
2023-11-15 03:24:46 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the user's display name. A user <em>may</em> have a global name if they are on the new username system.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string? GlobalName { get; set; } = null!;
|
|
|
|
|
|
2022-07-21 01:55:08 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the avatar URL, if any, for the associated user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string? AvatarUrl { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If included in the query, gets the list of associated <seealso cref="CachedGuildUser"/> entries for this entry.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[InverseProperty(nameof(CachedGuildUser.User))]
|
|
|
|
|
public ICollection<CachedGuildUser> Guilds { get; set; } = null!;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If included in the query, gets the list of associated <seealso cref="CachedGuildMessage"/> entries for this entry.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[InverseProperty(nameof(CachedGuildMessage.Author))]
|
|
|
|
|
public ICollection<CachedGuildMessage> GuildMessages { get; set; } = null!;
|
|
|
|
|
}
|