RegexBot/Data/CachedUser.cs
Noi de7e83ee50 Modify database context and navigation
Creating a migration as-is creates an extraneous column. Need to figure
out what the problem is.
2022-12-03 19:35:42 -08:00

46 lines
1.5 KiB
C#

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>
/// Gets the associated user's snowflake ID.
/// </summary>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public ulong 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>
/// Gets the user's discriminator value.
/// </summary>
public string Discriminator { get; set; } = null!;
/// <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>
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>
public ICollection<CachedGuildMessage> GuildMessages { get; set; } = null!;
}