Model Class: PersonValidation.cs
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using SnapObjects.Data;
namespace Appeon.ApiDoc.Models.School
{
/// <summary>
/// This model class maps to the dbo.Person table.
///
/// LastName is required.
/// FirstName is not allowed to be shorter than 2 characters.
/// </summary>
[Table("Person", Schema = "dbo")]
[UpdateWhereStrategy(UpdateWhereStrategy.KeyColumns)]
public class PersonValidation
{
[Key]
[Identity]
public int PersonID { get; set; }
[Required]
public string LastName { get; set; }
[MinLength(2)]
public string FirstName { get; set; }
public DateTime? HireDate { get; set; }
public DateTime? EnrollmentDate { get; set; }
public string Discriminator { get; set; }
}
}