insight/src/Web/Insight.Web/Models/ChatUser.cs

25 lines
598 B
C#
Raw Normal View History

2023-09-21 18:58:32 +02:00
using MongoDB.Bson;
namespace Insight.Web.Models;
2023-12-18 16:31:00 +01:00
public class ChatUser(ObjectId uid)
2023-09-21 18:58:32 +02:00
{
2023-12-18 16:31:00 +01:00
public ObjectId Uid { get; set; } = uid;
2023-09-21 18:58:32 +02:00
public bool Online { get; set; }
public string? Username { get; set; }
public string? Email { get; set; }
public byte[]? Avatar { get; set; }
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType()) return false;
if (obj is ChatUser user && Uid != user.Uid) return false;
return true;
}
public override int GetHashCode()
{
return Uid.GetHashCode();
}
}