Model Class: Person.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.
/// When Discriminator is 'Instructor', it represents an instructor record;
/// when Discriminator is 'Student', it represents a student record.
///
/// It uses the primary key to generate the Where clause for the Update operation.
///
/// PersonID is the pimary key and the identity.
/// </summary>
[Table("Person", Schema = "dbo")]
[UpdateWhereStrategy(UpdateWhereStrategy.KeyColumns)]
public class Person
{
[Key]
[Identity]
public int PersonID { get; set; }
public string LastName { get; set; }
public string FirstName { get; set; }
public DateTime? HireDate { get; set; }
public DateTime? EnrollmentDate { get; set; }
public string Discriminator { get; set; }
}
}