This commit is contained in:
Salikh 2024-05-25 12:11:36 +04:00
parent 827cd9fac2
commit c932df1c72

View File

@ -9,35 +9,35 @@ namespace MotorPlantDatabaseImplement.Models
{ {
public class MessageInfo : IMessageInfoModel public class MessageInfo : IMessageInfoModel
{ {
[NotMapped] [NotMapped]
public int Id { get; private set; } public int Id { get; private set; }
[DataMember] [DataMember]
[Key] [Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)] [DatabaseGenerated(DatabaseGeneratedOption.None)]
public string MessageId { get; set; } = string.Empty; public string MessageId { get; set; } = string.Empty;
[DataMember] public int? ClientId { get; set; }
public int? ClientId { get; set; }
public virtual Client? Client { get; set; } public virtual Client? Client { get; set; }
[DataMember] [DataMember]
[Required] [Required]
public string SenderName { get; set; } = string.Empty; public string SenderName { get; set; } = string.Empty;
[DataMember] [DataMember]
[Required] [Required]
public DateTime DateDelivery { get; set; } public DateTime DateDelivery { get; set; }
[Required] [DataMember]
public string Subject { get; set; } = string.Empty; [Required]
public string Subject { get; set; } = string.Empty;
[DataMember] [DataMember]
[Required] [Required]
public string Body { get; set; } = string.Empty; public string Body { get; set; } = string.Empty;
public static MessageInfo? Create(MessageInfoBindingModel? model) public static MessageInfo? Create(MessageInfoBindingModel? model)
{ {
if (model == null) if (model == null)
{ {