.NET 10 solution for Ping, a Discord style chat app: Domain, Application and Infrastructure projects plus the Api host. SignalR for chat and presence, LiveKit for call tokens, EF Core on Postgres, S3 compatible storage for attachments, and OIDC auth shared with the Musify Zitadel instance. Includes the Compose stack for local development.
35 lines
823 B
C#
35 lines
823 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Ping.Domain.ValueObjects;
|
|
|
|
namespace Ping.Domain.Entities
|
|
{
|
|
[Table("Channel")]
|
|
public class Channel
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid? ServerId { get; set; }
|
|
|
|
public Server? ServerNavigation { get; set; }
|
|
|
|
[MaxLength(100)]
|
|
public string? Name { get; set; }
|
|
|
|
[MaxLength(1024)]
|
|
public string? Topic { get; set; }
|
|
|
|
[Required]
|
|
public ChannelType Type { get; set; }
|
|
|
|
[Required]
|
|
public int Position { get; set; }
|
|
|
|
[Required]
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
public ICollection<ChannelMember> Members { get; set; } = new List<ChannelMember>();
|
|
}
|
|
}
|