using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web; using EnVisage.Code; namespace EnVisage.Models { public class ScenarioGroupModel : IBaseModel { public Guid Id { get; set; } [Required] [MaxLength(50)] [Display(Name="Scenario Type")] public string Name { get; set; } public int Type { get{ return 3; } } /// /// Casts a obect to the object of type . /// /// A object. /// A object filled with data from db. public static explicit operator ScenarioGroupModel(SystemAttribute obj) { if (obj == null) return null; var model = new ScenarioGroupModel { Id = obj.Id, Name = obj.Name }; model.TrimStringProperties(); return model; } /// /// Copies data from model to DAL object. /// /// A target DAL object. public void CopyTo(SystemAttribute dbObj) { if (dbObj == null) throw new ArgumentNullException(); dbObj.Name = Name; } } }