using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.ComponentModel.DataAnnotations; using Sleis.Validation.Attribute; namespace Sleis.Models { public class ControlDevicePollutantBase : BaseIdentityModel { //public virtual ControlDevicePollutant Pollutant { get; set; } //public virtual int DeviceId { get; set; } } public class PublicControlDevicePollutant : ControlDevicePollutant { public PublicControlDevicePollutant() { //Pollutant = new ControlDevicePollutant(); } public override void SetContext(string parentContext) { if (!String.IsNullOrEmpty(Code)) { ValidationContxt = String.Format("{0} Pollutant:{1}", parentContext, Code); } else { ValidationContxt = parentContext; } } } }