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 Int32 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; }
}
}