using System using System Collections Generic using System ComponentMo

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Models
{
[Table("User")]
public class User
{
[Key]
public Int32 UserId { get; set; }
[Required]
[MaxLength(100)]
public String FirstName { get; set; }
[Required]
[MaxLength(100)]
public String SecondName { get; set; }
[Required]
[MaxLength(100)]
public String Login { get; set; }
[Required]
[MaxLength(200)]
[DataType(DataType.EmailAddress)]
public String Email { get; set; }
[Required]
[MaxLength(100)]
[DataType(DataType.Password)]
public String Password { get; set; }
[Required]
[DataType(DataType.DateTime)]
public DateTime DateRegistration { get; set; }
[Required]
public Int32 Karma { get; set; }
[Required]
public Boolean Sex { get; set; }
[Required]
public Boolean IsActivate { get; set; }
[Required]
public Boolean IsAdmin { get; set; }
[Required]
public Boolean IsDeleted { get; set; }
[Required]
public Boolean IsBlocked { get; set; }
[Required]
public Int32 UserCategoryId { get; set; }
[ForeignKey("UserCategoryId")]
public virtual UserCategory UserCategory { get; set; }
public virtual ICollection<Kommentar> Kommentars { get; set; }
public virtual ICollection<RatingKommentar> RatingKommentars { get; set; }
public virtual ICollection<Post> Posts { get; set; }
public virtual ICollection<RatingPost> RatingPosts { get; set; }
public virtual ICollection<Answer> Answers { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Models
{
[Table("UserCategory")]
public class UserCategory
{
[Key]
public Int32 UserCategoryId { get; set; }
[Required]
[MaxLength(50)]
public String Title { get; set; }
public String Code { get; set; }
[MaxLength(150)]
public String Description { get; set; }
public virtual ICollection<User> Users { get; set; }
}
}