-
Notifications
You must be signed in to change notification settings - Fork 0
Sample: TestModels
Mendz edited this page Oct 8, 2017
·
2 revisions
- In Visual Studio, create a .Net Core class library project called TestModels.
- Add a class file named Test.cs, and enter the following:
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace TestModels
{
public class Test
{
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int TestID { get; set; }
[Required]
public string Code { get; set; }
[Required]
public string Name { get; set; }
public string Description { get; set; }
[Required]
public string CreatedBy { get; set; } = "System";
[Required]
public DateTime CreatedDate { get; set; } = DateTime.Now;
public string ModifiedBy { get; set; }
public DateTime? ModifiedDate { get; set; }
}
}