43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System.Collections.Specialized;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using AyCode.Interfaces.Entities;
|
|
using AyCode.Interfaces.TimeStampInfo;
|
|
using AyCode.Interfaces.Users;
|
|
|
|
namespace TIAM.Entities.Emails;
|
|
|
|
[Table(nameof(EmailMessage))]
|
|
public class EmailMessage : IEntityGuid, ITimeStampInfo, IEmailRecipientsRelation, IEmailAddress
|
|
{
|
|
public EmailMessage()
|
|
{
|
|
}
|
|
|
|
public EmailMessage(Guid id, Guid? senderId, Guid contextId, string subject, string? text, string emailAddress) : this()
|
|
{
|
|
Id = id;
|
|
SenderId = senderId;
|
|
ContextId = contextId;
|
|
Subject = subject;
|
|
Text = text;
|
|
EmailAddress = emailAddress;
|
|
}
|
|
|
|
[Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid ContextId { get; set; }
|
|
public Guid? SenderId { get; set; }
|
|
|
|
public virtual List<EmailRecipient> Recipients { get; set; } = [];
|
|
|
|
[MaxLength(150)]
|
|
public string EmailAddress { get; set; }
|
|
[MaxLength(100)]
|
|
public string Subject { get; set; }
|
|
public string? Text { get; set; }
|
|
|
|
public DateTime Created { get; set; }
|
|
public DateTime Modified { get; set; }
|
|
} |