You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
650 B

using System.ComponentModel.DataAnnotations;
namespace AspNetCoreMVC.Models
{
public class TestModel
{
[Required]
public int Id { get; set; }
[Required]
[StringLength(20)]
public string Name { get; set; }
}
public class TestViewModel
{
public List<string> Names { get; set; }
}
public class SampleViewModel
{
[Required]
[Display(Name = "Product ID to purchase")]
public int Id { get; set; }
[Range(1, 10, ErrorMessage = "Value should be in 1 ~ 10!")]
[Display(Name = "Count")]
public int Count { get; set; }
}
}