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

[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("ImagesModel", "FK_Images_Contributor", "People", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(ImagesModel.People), "Images", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(ImagesModel.Images))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("ImagesModel", "FK_Tags_CreatedBy", "People", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(ImagesModel.People), "Tags", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(ImagesModel.Tags))]
[assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("ImagesModel", "ImageTags", "Images", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(ImagesModel.Images), "Tags", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(ImagesModel.Tags))]

// Original file name:
// Generation date: 9/28/2009 4:31:15 PM
namespace ImagesModel
{
    
    /// <summary>
    /// There are no comments for ImagesEntities in the schema.
    /// </summary>
    public partial class ImagesEntities : global::System.Data.Objects.ObjectContext
    {
        /// <summary>
        /// Initializes a new ImagesEntities object using the connection string found in the 'ImagesEntities' section of the application configuration file.
        /// </summary>
        public ImagesEntities() : 
                base("name=ImagesEntities", "ImagesEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new ImagesEntities object.
        /// </summary>
        public ImagesEntities(string connectionString) : 
                base(connectionString, "ImagesEntities")
        {
            this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new ImagesEntities object.
        /// </summary>
        public ImagesEntities(global::System.Data.EntityClient.EntityConnection connection) : 
                base(connection, "ImagesEntities")
        {
            this.OnContextCreated();
        }
        partial void OnContextCreated();
        /// <summary>
        /// There are no comments for Images in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Images> Images
        {
            get
            {
                if ((this._Images == null))
                {
                    this._Images = base.CreateQuery<Images>("[Images]");
                }
                return this._Images;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Images> _Images;
        /// <summary>
        /// There are no comments for People in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<People> People
        {
            get
            {
                if ((this._People == null))
                {
                    this._People = base.CreateQuery<People>("[People]");
                }
                return this._People;
            }
        }
        private global::System.Data.Objects.ObjectQuery<People> _People;
        /// <summary>
        /// There are no comments for Tags in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Tags> Tags
        {
            get
            {
                if ((this._Tags == null))
                {
                    this._Tags = base.CreateQuery<Tags>("[Tags]");
                }
                return this._Tags;
            }
        }
        private global::System.Data.Objects.ObjectQuery<Tags> _Tags;
        /// <summary>
        /// There are no comments for Images in the schema.
        /// </summary>
        public void AddToImages(Images images)
        {
            base.AddObject("Images", images);
        }
        /// <summary>
        /// There are no comments for People in the schema.
        /// </summary>
        public void AddToPeople(People people)
        {
            base.AddObject("People", people);
        }
        /// <summary>
        /// There are no comments for Tags in the schema.
        /// </summary>
        public void AddToTags(Tags tags)
        {
            base.AddObject("Tags", tags);
        }
    }
    /// <summary>
    /// There are no comments for ImagesModel.Images in the schema.
    /// </summary>
    /// <KeyProperties>
    /// ImageID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="ImagesModel", Name="Images")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Images : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Images object.
        /// </summary>
        /// <param name="imageID">Initial value of ImageID.</param>
        public static Images CreateImages(int imageID)
        {
            Images images = new Images();
            images.ImageID = imageID;
            return images;
        }
        /// <summary>
        /// There are no comments for Property ImageID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public int ImageID
        {
            get
            {
                return this._ImageID;
            }
            set
            {
                this.OnImageIDChanging(value);
                this.ReportPropertyChanging("ImageID");
                this._ImageID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("ImageID");
                this.OnImageIDChanged();
            }
        }
        private int _ImageID;
        partial void OnImageIDChanging(int value);
        partial void OnImageIDChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this.ReportPropertyChanging("Name");
                this._Name = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Name");
                this.OnNameChanged();
            }
        }
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for Property Description in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Description
        {
            get
            {
                return this._Description;
            }
            set
            {
                this.OnDescriptionChanging(value);
                this.ReportPropertyChanging("Description");
                this._Description = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Description");
                this.OnDescriptionChanged();
            }
        }
        private string _Description;
        partial void OnDescriptionChanging(string value);
        partial void OnDescriptionChanged();
        /// <summary>
        /// There are no comments for Property Uri in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Uri
        {
            get
            {
                return this._Uri;
            }
            set
            {
                this.OnUriChanging(value);
                this.ReportPropertyChanging("Uri");
                this._Uri = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Uri");
                this.OnUriChanged();
            }
        }
        private string _Uri;
        partial void OnUriChanging(string value);
        partial void OnUriChanged();
        /// <summary>
        /// There are no comments for Contributor in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ImagesModel", "FK_Images_Contributor", "People")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public People Contributor
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<People>("ImagesModel.FK_Images_Contributor", "People").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<People>("ImagesModel.FK_Images_Contributor", "People").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for Contributor in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<People> ContributorReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<People>("ImagesModel.FK_Images_Contributor", "People");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<People>("ImagesModel.FK_Images_Contributor", "People", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Tags in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ImagesModel", "ImageTags", "Tags")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Tags> Tags
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Tags>("ImagesModel.ImageTags", "Tags");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Tags>("ImagesModel.ImageTags", "Tags", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for ImagesModel.People in the schema.
    /// </summary>
    /// <KeyProperties>
    /// PersonID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="ImagesModel", Name="People")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class People : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new People object.
        /// </summary>
        /// <param name="personID">Initial value of PersonID.</param>
        public static People CreatePeople(int personID)
        {
            People people = new People();
            people.PersonID = personID;
            return people;
        }
        /// <summary>
        /// There are no comments for Property FirstName in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string FirstName
        {
            get
            {
                return this._FirstName;
            }
            set
            {
                this.OnFirstNameChanging(value);
                this.ReportPropertyChanging("FirstName");
                this._FirstName = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("FirstName");
                this.OnFirstNameChanged();
            }
        }
        private string _FirstName;
        partial void OnFirstNameChanging(string value);
        partial void OnFirstNameChanged();
        /// <summary>
        /// There are no comments for Property PersonID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public int PersonID
        {
            get
            {
                return this._PersonID;
            }
            set
            {
                this.OnPersonIDChanging(value);
                this.ReportPropertyChanging("PersonID");
                this._PersonID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("PersonID");
                this.OnPersonIDChanged();
            }
        }
        private int _PersonID;
        partial void OnPersonIDChanging(int value);
        partial void OnPersonIDChanged();
        /// <summary>
        /// There are no comments for Property LastName in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string LastName
        {
            get
            {
                return this._LastName;
            }
            set
            {
                this.OnLastNameChanging(value);
                this.ReportPropertyChanging("LastName");
                this._LastName = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("LastName");
                this.OnLastNameChanged();
            }
        }
        private string _LastName;
        partial void OnLastNameChanging(string value);
        partial void OnLastNameChanged();
        /// <summary>
        /// There are no comments for Images in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ImagesModel", "FK_Images_Contributor", "Images")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Images> Images
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Images>("ImagesModel.FK_Images_Contributor", "Images");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Images>("ImagesModel.FK_Images_Contributor", "Images", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Tags in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ImagesModel", "FK_Tags_CreatedBy", "Tags")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Tags> Tags
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Tags>("ImagesModel.FK_Tags_CreatedBy", "Tags");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Tags>("ImagesModel.FK_Tags_CreatedBy", "Tags", value);
                }
            }
        }
    }
    /// <summary>
    /// There are no comments for ImagesModel.Tags in the schema.
    /// </summary>
    /// <KeyProperties>
    /// TagID
    /// </KeyProperties>
    [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="ImagesModel", Name="Tags")]
    [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
    [global::System.Serializable()]
    public partial class Tags : global::System.Data.Objects.DataClasses.EntityObject
    {
        /// <summary>
        /// Create a new Tags object.
        /// </summary>
        /// <param name="tagID">Initial value of TagID.</param>
        public static Tags CreateTags(int tagID)
        {
            Tags tags = new Tags();
            tags.TagID = tagID;
            return tags;
        }
        /// <summary>
        /// There are no comments for Property TagID in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public int TagID
        {
            get
            {
                return this._TagID;
            }
            set
            {
                this.OnTagIDChanging(value);
                this.ReportPropertyChanging("TagID");
                this._TagID = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value);
                this.ReportPropertyChanged("TagID");
                this.OnTagIDChanged();
            }
        }
        private int _TagID;
        partial void OnTagIDChanging(int value);
        partial void OnTagIDChanged();
        /// <summary>
        /// There are no comments for Property Name in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                this.OnNameChanging(value);
                this.ReportPropertyChanging("Name");
                this._Name = global::System.Data.Objects.DataClasses.StructuralObject.SetValidValue(value, true);
                this.ReportPropertyChanged("Name");
                this.OnNameChanged();
            }
        }
        private string _Name;
        partial void OnNameChanging(string value);
        partial void OnNameChanged();
        /// <summary>
        /// There are no comments for CreatedBy in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ImagesModel", "FK_Tags_CreatedBy", "People")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public People CreatedBy
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<People>("ImagesModel.FK_Tags_CreatedBy", "People").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<People>("ImagesModel.FK_Tags_CreatedBy", "People").Value = value;
            }
        }
        /// <summary>
        /// There are no comments for CreatedBy in the schema.
        /// </summary>
        [global::System.ComponentModel.BrowsableAttribute(false)]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityReference<People> CreatedByReference
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<People>("ImagesModel.FK_Tags_CreatedBy", "People");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<People>("ImagesModel.FK_Tags_CreatedBy", "People", value);
                }
            }
        }
        /// <summary>
        /// There are no comments for Images in the schema.
        /// </summary>
        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("ImagesModel", "ImageTags", "Images")]
        [global::System.Xml.Serialization.XmlIgnoreAttribute()]
        [global::System.Xml.Serialization.SoapIgnoreAttribute()]
        [global::System.Runtime.Serialization.DataMemberAttribute()]
        public global::System.Data.Objects.DataClasses.EntityCollection<Images> Images
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedCollection<Images>("ImagesModel.ImageTags", "Images");
            }
            set
            {
                if ((value != null))
                {
                    ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedCollection<Images>("ImagesModel.ImageTags", "Images", value);
                }
            }
        }
    }
}
