-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProduct.cs
49 lines (39 loc) · 1.32 KB
/
Product.cs
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
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Model.Models
{
public partial class Product
{
[Key]
public int Id { get; set; }
[Required]
[StringLength(50)]
[Display(Name = "Title")]
public string Heading { get; set; }
public string Description { get; set; }
public string Barcode { get; set; }
[Display(Name = "Email")]
[DataType(DataType.EmailAddress)]
[Required(ErrorMessage = "Email is required.")]
[StringLength(20)]
[RegularExpression(@"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}", ErrorMessage = "Please enter a valid email address")]
public string Email { get; set; }
[Display(Name = "Password")]
[DataType(DataType.Password)]
public string Password { get; set; }
public int ProductionYear { get; set; }
[Display(Name = "Price")]
[Required(ErrorMessage = "Price is required.")]
[DisplayFormat(DataFormatString = "{0:N2}", ApplyFormatInEditMode = true)]
[RegularExpression(@"^\d*([.,]*\d{1,4})$")]
[Column(TypeName = "decimal(18,4)")]
public decimal Price { get; set; }
[Column(TypeName = "datetime")]
public DateTime CreatedDate { get; set; }
[Column(TypeName = "datetime")]
public DateTime? UpdatedDate { get; set; }
public bool IsActive { get; set; }
public bool IsDeleted { get; set; }
}
}