Created
February 10, 2019 18:55
-
-
Save demonguru18/3b309c4766214abf249e56e83ec9e016 to your computer and use it in GitHub Desktop.
Model Class For Product, LoginView and RegisterView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Login View */ | |
using System; | |
using System.ComponentModel.DataAnnotations; | |
namespace JWT_NG.Models | |
{ | |
public class LoginViewModel | |
{ | |
[Required] | |
[Display(Name = "User Name")] | |
public string Username { get; set; } | |
[Required] | |
[DataType(DataType.Password)] | |
public string Password { get; set; } | |
} | |
/* Product View */ | |
public class ProductModel | |
{ | |
[Key] | |
public int ProductId { get; set; } | |
[Required] | |
[MaxLength(50)] | |
public string Name { get; set; } | |
[Required] | |
[MaxLength(150)] | |
public string Description { get; set; } | |
[Required] | |
public bool OutOfStock { get; set; } | |
[Required] | |
public string ImageUrl { get; set; } | |
[Required] | |
public double Price { get; set; } | |
} | |
/* Register View View */ | |
public class RegisterViewModel | |
{ | |
[Required] | |
[EmailAddress] | |
public string Email { get; set; } | |
[Required] | |
[Display(Name = "User Name")] | |
public string UserName { get; set; } | |
[Required] | |
[DataType(DataType.Password)] | |
public string Password { get; set; } | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment