#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace AddressValidation.DataLayer.DataModel
{
    using System.Data.Linq;
    using System.Data.Linq.Mapping;
    using System.Data;
    using System.Collections.Generic;
    using System.Reflection;
    using System.Linq;
    using System.Linq.Expressions;
    using System.ComponentModel;
    using System;


    [global::System.Data.Linq.Mapping.DatabaseAttribute(Name = "ContactDataDb")]
    public partial class AddressDbModelDataContext : System.Data.Linq.DataContext
    {

        private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();

        #region Extensibility Method Definitions
        partial void OnCreated();
        partial void InsertContact(Contact instance);
        partial void UpdateContact(Contact instance);
        partial void DeleteContact(Contact instance);
        #endregion

        public AddressDbModelDataContext() :
                base(ContactDbManager.ConnectionString, mappingSource)
                //base(global::AddressValidation.DataLayer.Properties.Settings.Default.ContactDataDbConnectionString, mappingSource)
        {
            OnCreated();
        }

        public AddressDbModelDataContext(string connection) :
                base(connection, mappingSource)
        {
            OnCreated();
        }

        public AddressDbModelDataContext(System.Data.IDbConnection connection) :
                base(connection, mappingSource)
        {
            OnCreated();
        }

        public AddressDbModelDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
                base(connection, mappingSource)
        {
            OnCreated();
        }

        public AddressDbModelDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
                base(connection, mappingSource)
        {
            OnCreated();
        }

        public System.Data.Linq.Table<Contact> Contacts
        {
            get
            {
                return this.GetTable<Contact>();
            }
        }
    }

    [global::System.Data.Linq.Mapping.TableAttribute(Name = "dbo.Contact")]
    public partial class Contact : INotifyPropertyChanging, INotifyPropertyChanged
    {

        private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

        private int _Id;

        private string _FirstName;

        private string _LastName;

        private string _Address1;

        private string _Address2;

        private string _City;

        private string _State;

        private string _Zip;

        private string _Country;

        private string _Phone;

        private string _Email;

        private string _Custom1;

        private string _Custom2;

        private bool _IsDuplicate;

        private System.Nullable<bool> _IsVerified;

        #region Extensibility Method Definitions
        partial void OnLoaded();
        partial void OnValidate(System.Data.Linq.ChangeAction action);
        partial void OnCreated();
        partial void OnIdChanging(int value);
        partial void OnIdChanged();
        partial void OnFirstNameChanging(string value);
        partial void OnFirstNameChanged();
        partial void OnLastNameChanging(string value);
        partial void OnLastNameChanged();
        partial void OnAddress1Changing(string value);
        partial void OnAddress1Changed();
        partial void OnAddress2Changing(string value);
        partial void OnAddress2Changed();
        partial void OnCityChanging(string value);
        partial void OnCityChanged();
        partial void OnStateChanging(string value);
        partial void OnStateChanged();
        partial void OnZipChanging(string value);
        partial void OnZipChanged();
        partial void OnCountryChanging(string value);
        partial void OnCountryChanged();
        partial void OnPhoneChanging(string value);
        partial void OnPhoneChanged();
        partial void OnEmailChanging(string value);
        partial void OnEmailChanged();
        partial void OnCustom1Changing(string value);
        partial void OnCustom1Changed();
        partial void OnCustom2Changing(string value);
        partial void OnCustom2Changed();
        partial void OnIsDuplicateChanging(bool value);
        partial void OnIsDuplicateChanged();
        partial void OnIsVerifiedChanging(System.Nullable<bool> value);
        partial void OnIsVerifiedChanged();
        #endregion

        public Contact()
        {
            OnCreated();
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Id", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public int Id
        {
            get
            {
                return this._Id;
            }
            set
            {
                if ((this._Id != value))
                {
                    this.OnIdChanging(value);
                    this.SendPropertyChanging();
                    this._Id = value;
                    this.SendPropertyChanged("Id");
                    this.OnIdChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_FirstName", DbType = "NVarChar(50)")]
        public string FirstName
        {
            get
            {
                return this._FirstName;
            }
            set
            {
                if ((this._FirstName != value))
                {
                    this.OnFirstNameChanging(value);
                    this.SendPropertyChanging();
                    this._FirstName = value;
                    this.SendPropertyChanged("FirstName");
                    this.OnFirstNameChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_LastName", DbType = "NVarChar(50)")]
        public string LastName
        {
            get
            {
                return this._LastName;
            }
            set
            {
                if ((this._LastName != value))
                {
                    this.OnLastNameChanging(value);
                    this.SendPropertyChanging();
                    this._LastName = value;
                    this.SendPropertyChanged("LastName");
                    this.OnLastNameChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Address1", DbType = "NVarChar(50)")]
        public string Address1
        {
            get
            {
                return this._Address1;
            }
            set
            {
                if ((this._Address1 != value))
                {
                    this.OnAddress1Changing(value);
                    this.SendPropertyChanging();
                    this._Address1 = value;
                    this.SendPropertyChanged("Address1");
                    this.OnAddress1Changed();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Address2", DbType = "NVarChar(50)")]
        public string Address2
        {
            get
            {
                return this._Address2;
            }
            set
            {
                if ((this._Address2 != value))
                {
                    this.OnAddress2Changing(value);
                    this.SendPropertyChanging();
                    this._Address2 = value;
                    this.SendPropertyChanged("Address2");
                    this.OnAddress2Changed();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_City", DbType = "NVarChar(50)")]
        public string City
        {
            get
            {
                return this._City;
            }
            set
            {
                if ((this._City != value))
                {
                    this.OnCityChanging(value);
                    this.SendPropertyChanging();
                    this._City = value;
                    this.SendPropertyChanged("City");
                    this.OnCityChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_State", DbType = "NVarChar(50)")]
        public string State
        {
            get
            {
                return this._State;
            }
            set
            {
                if ((this._State != value))
                {
                    this.OnStateChanging(value);
                    this.SendPropertyChanging();
                    this._State = value;
                    this.SendPropertyChanged("State");
                    this.OnStateChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Zip", DbType = "NVarChar(50)")]
        public string Zip
        {
            get
            {
                return this._Zip;
            }
            set
            {
                if ((this._Zip != value))
                {
                    this.OnZipChanging(value);
                    this.SendPropertyChanging();
                    this._Zip = value;
                    this.SendPropertyChanged("Zip");
                    this.OnZipChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Country", DbType = "NVarChar(50)")]
        public string Country
        {
            get
            {
                return this._Country;
            }
            set
            {
                if ((this._Country != value))
                {
                    this.OnCountryChanging(value);
                    this.SendPropertyChanging();
                    this._Country = value;
                    this.SendPropertyChanged("Country");
                    this.OnCountryChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Phone", DbType = "NVarChar(50)")]
        public string Phone
        {
            get
            {
                return this._Phone;
            }
            set
            {
                if ((this._Phone != value))
                {
                    this.OnPhoneChanging(value);
                    this.SendPropertyChanging();
                    this._Phone = value;
                    this.SendPropertyChanged("Phone");
                    this.OnPhoneChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Email", DbType = "NVarChar(50)")]
        public string Email
        {
            get
            {
                return this._Email;
            }
            set
            {
                if ((this._Email != value))
                {
                    this.OnEmailChanging(value);
                    this.SendPropertyChanging();
                    this._Email = value;
                    this.SendPropertyChanged("Email");
                    this.OnEmailChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Custom1", DbType = "NVarChar(50)")]
        public string Custom1
        {
            get
            {
                return this._Custom1;
            }
            set
            {
                if ((this._Custom1 != value))
                {
                    this.OnCustom1Changing(value);
                    this.SendPropertyChanging();
                    this._Custom1 = value;
                    this.SendPropertyChanged("Custom1");
                    this.OnCustom1Changed();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Custom2", DbType = "NVarChar(50)")]
        public string Custom2
        {
            get
            {
                return this._Custom2;
            }
            set
            {
                if ((this._Custom2 != value))
                {
                    this.OnCustom2Changing(value);
                    this.SendPropertyChanging();
                    this._Custom2 = value;
                    this.SendPropertyChanged("Custom2");
                    this.OnCustom2Changed();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_IsDuplicate", DbType = "Bit NOT NULL")]
        public bool IsDuplicate
        {
            get
            {
                return this._IsDuplicate;
            }
            set
            {
                if ((this._IsDuplicate != value))
                {
                    this.OnIsDuplicateChanging(value);
                    this.SendPropertyChanging();
                    this._IsDuplicate = value;
                    this.SendPropertyChanged("IsDuplicate");
                    this.OnIsDuplicateChanged();
                }
            }
        }

        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_IsVerified", DbType = "Bit")]
        public System.Nullable<bool> IsVerified
        {
            get
            {
                return this._IsVerified;
            }
            set
            {
                if ((this._IsVerified != value))
                {
                    this.OnIsVerifiedChanging(value);
                    this.SendPropertyChanging();
                    this._IsVerified = value;
                    this.SendPropertyChanged("IsVerified");
                    this.OnIsVerifiedChanged();
                }
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void SendPropertyChanging()
        {
            if ((this.PropertyChanging != null))
            {
                this.PropertyChanging(this, emptyChangingEventArgs);
            }
        }

        protected virtual void SendPropertyChanged(String propertyName)
        {
            if ((this.PropertyChanged != null))
            {
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
#pragma warning restore 1591
