Model Class: DepartmentByName.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.Department table.
    /// It uses the primary key to generate the Where clause for the Update operation.
    /// The SqlParameter attribute defines an argument: nameArgument.
    /// The SqlWhere attribute adds a Where clause using the nameArgument argument.
    /// 
    /// DepartmentID is the primary key.
    /// </summary>
    [SqlParameter("nameArgument", typeof(string))]
    [Table("Department", Schema = "dbo")]
    [UpdateWhereStrategy(UpdateWhereStrategy.KeyColumns)]
    [SqlWhere("Name = :nameArgument")]
    public class DepartmentByName
    {
        [Key]
        public Int32 DepartmentID { get; set; }
        public String Name { get; set; }
        public Decimal Budget { get; set; }
        public DateTime StartDate { get; set; }
        public Int32? Administrator { get; set; }
    }
}