Viacheslav

UserEntity

Apr 30th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations;
  5. using WebChat.Models.Abstractions;
  6. using WebChat.Models.Interfaces;
  7.  
  8. namespace WebChat.Models
  9. {
  10.     public class User : BaseEntity, IAuditable, IDeletable
  11.     {
  12.         public User()
  13.         {
  14.             Messages = new HashSet<Message>();
  15.         }
  16.         [MaxLength(60)]
  17.         public string Username { get; set; }
  18.  
  19.         [Required]
  20.         [MaxLength(60)]
  21.         public string Email { get; set; }
  22.  
  23.         [Required]
  24.         public string Password { get; set; }
  25.  
  26.         public ICollection<Message> Messages { get; set; }
  27.  
  28.         public ICollection<Thread> Threads { get; set; }
  29.  
  30.        
  31.  
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment