Demo entry 1487246

545435

   

Submitted by 4234 on Apr 20, 2015 at 13:55
Language: C#. Code size: 2.2 kB.

using System;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using ComfortSleep.Common.Base.Abstraction;

// ReSharper disable CheckNamespace
namespace ComfortSleep.Domain
// ReSharper restore CheckNamespace
{
    [Serializable]
    [DataContract]
    [Table("equipment_template")]
    [XmlRoot("Template")]
    public sealed partial class EquipmentTemplate : IHaveIdentity<int>, IAuditable<int>
    {
        public EquipmentTemplate()
        {
            EquipmentTemplateToGroups = new Collection<EquipmentTemplateToGroup>();
        }

        [Key]
        [Required]
        [Column("Id")]
        [DataMember]
        [XmlAttribute("Id")]
        public int Id { get; set; }

        [Required]
        [MaxLength(400)]
        [Column("Name")]
        [DataMember]
        [XmlAttribute("Name")]
        public string Name { get; set; }
        
        [Required]
        [Column("CreatedBy")]
        [DataMember]
        [XmlIgnore]
        public int CreatedBy { get; set; }

        [Required]
        [Column("CreatedDate")]
        [DataMember]
        [XmlIgnore]
        public DateTime CreatedDate { get; set; }
       
        [Column("LastModifiedBy")]
        [DataMember]
        [XmlIgnore]
        public int? LastModifiedBy { get; set; }

        [Column("LastModifiedDate")]
        [DataMember]
        [XmlIgnore]
        public DateTime? LastModifiedDate { get; set; }

        [Column("Archive")]
        [DataMember]
        [XmlIgnore]
        public bool Archive { get; set; }

        
        [ForeignKey("CreatedBy")]
        [DataMember]
        [XmlIgnore]
        public User CreatedByUser { get; set; }

        [ForeignKey("LastModifiedBy")]
        [DataMember]
        [XmlIgnore]
        public User LastModifiedByUser { get; set; }

        [DataMember]
        [XmlElement("Groups")]
        public Collection<EquipmentTemplateToGroup> EquipmentTemplateToGroups { get; set; }
    }
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).