Viacheslav

ThreadEntity(ChatRoom)

Apr 30th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.66 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. using System.Text;
  6. using WebChat.Models.Abstractions;
  7.  
  8. namespace WebChat.Models
  9. {
  10.     public class Thread : BaseEntity
  11.     {
  12.         public Thread()
  13.         {
  14.             CreatedOn = DateTime.Now;
  15.             Messages = new HashSet<Message>();
  16.         }
  17.  
  18.         [Required]
  19.         [ForeignKey("OwnerId")]
  20.         public string OwnerId { get; set; }
  21.         public User Owner { get; set; }
  22.  
  23.         public string OponentId { get; set; }
  24.  
  25.  
  26.         public ICollection<Message> Messages { get; set; }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment