﻿//------------------------------------------------------------------------------
// <auto-generated>
//    此代码是根据模板生成的。
//
//    手动更改此文件可能会导致应用程序中发生异常行为。
//    如果重新生成代码，则将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.ComponentModel;
using System.Data.EntityClient;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml.Serialization;

[assembly: EdmSchemaAttribute()]
namespace ContactManager.Model
{
    #region 上下文
    
    /// <summary>
    /// 没有元数据文档可用。
    /// </summary>
    public partial class testEntities : ObjectContext
    {
        #region 构造函数
    
        /// <summary>
        /// 请使用应用程序配置文件的“testEntities”部分中的连接字符串初始化新 testEntities 对象。
        /// </summary>
        public testEntities() : base("name=testEntities", "testEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// 初始化新的 testEntities 对象。
        /// </summary>
        public testEntities(string connectionString) : base(connectionString, "testEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// 初始化新的 testEntities 对象。
        /// </summary>
        public testEntities(EntityConnection connection) : base(connection, "testEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        #endregion
    
        #region 分部方法
    
        partial void OnContextCreated();
    
        #endregion
    
        #region ObjectSet 属性
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        public ObjectSet<Contact> Contact
        {
            get
            {
                if ((_Contact == null))
                {
                    _Contact = base.CreateObjectSet<Contact>("Contact");
                }
                return _Contact;
            }
        }
        private ObjectSet<Contact> _Contact;

        #endregion

        #region AddTo 方法
    
        /// <summary>
        /// 用于向 Contact EntitySet 添加新对象的方法，已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
        /// </summary>
        public void AddToContact(Contact contact)
        {
            base.AddObject("Contact", contact);
        }

        #endregion

    }

    #endregion

    #region 实体
    
    /// <summary>
    /// 没有元数据文档可用。
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="testModel", Name="Contact")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Contact : EntityObject
    {
        #region 工厂方法
    
        /// <summary>
        /// 创建新的 Contact 对象。
        /// </summary>
        /// <param name="id">Id 属性的初始值。</param>
        public static Contact CreateContact(global::System.Int32 id)
        {
            Contact contact = new Contact();
            contact.Id = id;
            return contact;
        }

        #endregion

        #region 基元属性
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Int32 _Id;
        partial void OnIdChanging(global::System.Int32 value);
        partial void OnIdChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String ImagePath
        {
            get
            {
                return _ImagePath;
            }
            set
            {
                OnImagePathChanging(value);
                ReportPropertyChanging("ImagePath");
                _ImagePath = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("ImagePath");
                OnImagePathChanged();
            }
        }
        private global::System.String _ImagePath;
        partial void OnImagePathChanging(global::System.String value);
        partial void OnImagePathChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String FirstName
        {
            get
            {
                return _FirstName;
            }
            set
            {
                OnFirstNameChanging(value);
                ReportPropertyChanging("FirstName");
                _FirstName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("FirstName");
                OnFirstNameChanged();
            }
        }
        private global::System.String _FirstName;
        partial void OnFirstNameChanging(global::System.String value);
        partial void OnFirstNameChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String LastName
        {
            get
            {
                return _LastName;
            }
            set
            {
                OnLastNameChanging(value);
                ReportPropertyChanging("LastName");
                _LastName = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("LastName");
                OnLastNameChanged();
            }
        }
        private global::System.String _LastName;
        partial void OnLastNameChanging(global::System.String value);
        partial void OnLastNameChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String Organization
        {
            get
            {
                return _Organization;
            }
            set
            {
                OnOrganizationChanging(value);
                ReportPropertyChanging("Organization");
                _Organization = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("Organization");
                OnOrganizationChanged();
            }
        }
        private global::System.String _Organization;
        partial void OnOrganizationChanging(global::System.String value);
        partial void OnOrganizationChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String JobTitle
        {
            get
            {
                return _JobTitle;
            }
            set
            {
                OnJobTitleChanging(value);
                ReportPropertyChanging("JobTitle");
                _JobTitle = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("JobTitle");
                OnJobTitleChanged();
            }
        }
        private global::System.String _JobTitle;
        partial void OnJobTitleChanging(global::System.String value);
        partial void OnJobTitleChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String OfficePhone
        {
            get
            {
                return _OfficePhone;
            }
            set
            {
                OnOfficePhoneChanging(value);
                ReportPropertyChanging("OfficePhone");
                _OfficePhone = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("OfficePhone");
                OnOfficePhoneChanged();
            }
        }
        private global::System.String _OfficePhone;
        partial void OnOfficePhoneChanging(global::System.String value);
        partial void OnOfficePhoneChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String CellPhone
        {
            get
            {
                return _CellPhone;
            }
            set
            {
                OnCellPhoneChanging(value);
                ReportPropertyChanging("CellPhone");
                _CellPhone = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("CellPhone");
                OnCellPhoneChanged();
            }
        }
        private global::System.String _CellPhone;
        partial void OnCellPhoneChanging(global::System.String value);
        partial void OnCellPhoneChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String HomePhone
        {
            get
            {
                return _HomePhone;
            }
            set
            {
                OnHomePhoneChanging(value);
                ReportPropertyChanging("HomePhone");
                _HomePhone = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("HomePhone");
                OnHomePhoneChanged();
            }
        }
        private global::System.String _HomePhone;
        partial void OnHomePhoneChanging(global::System.String value);
        partial void OnHomePhoneChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String PrimaryEmail
        {
            get
            {
                return _PrimaryEmail;
            }
            set
            {
                OnPrimaryEmailChanging(value);
                ReportPropertyChanging("PrimaryEmail");
                _PrimaryEmail = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("PrimaryEmail");
                OnPrimaryEmailChanged();
            }
        }
        private global::System.String _PrimaryEmail;
        partial void OnPrimaryEmailChanging(global::System.String value);
        partial void OnPrimaryEmailChanged();
    
        /// <summary>
        /// 没有元数据文档可用。
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public global::System.String SecondaryEmail
        {
            get
            {
                return _SecondaryEmail;
            }
            set
            {
                OnSecondaryEmailChanging(value);
                ReportPropertyChanging("SecondaryEmail");
                _SecondaryEmail = StructuralObject.SetValidValue(value, true);
                ReportPropertyChanged("SecondaryEmail");
                OnSecondaryEmailChanged();
            }
        }
        private global::System.String _SecondaryEmail;
        partial void OnSecondaryEmailChanging(global::System.String value);
        partial void OnSecondaryEmailChanged();

        #endregion

    
    }

    #endregion

    
}
