//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

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

[assembly: EdmSchemaAttribute()]
#region EDM Relationship Metadata

[assembly: EdmRelationshipAttribute("ClubsModel", "FK_Players_Clubs", "Club", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(RadGridView_WPF_AR_11.Club), "Player", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(RadGridView_WPF_AR_11.Player), true)]

#endregion

namespace RadGridView_WPF_AR_11
{
    #region Contexts
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class ClubsEntities3 : ObjectContext
    {
        #region Constructors
    
        /// <summary>
        /// Initializes a new ClubsEntities3 object using the connection string found in the 'ClubsEntities3' section of the application configuration file.
        /// </summary>
        public ClubsEntities3() : base("name=ClubsEntities3", "ClubsEntities3")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new ClubsEntities3 object.
        /// </summary>
        public ClubsEntities3(string connectionString) : base(connectionString, "ClubsEntities3")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new ClubsEntities3 object.
        /// </summary>
        public ClubsEntities3(EntityConnection connection) : base(connection, "ClubsEntities3")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        #endregion
    
        #region Partial Methods
    
        partial void OnContextCreated();
    
        #endregion
    
        #region ObjectSet Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Club> Clubs
        {
            get
            {
                if ((_Clubs == null))
                {
                    _Clubs = base.CreateObjectSet<Club>("Clubs");
                }
                return _Clubs;
            }
        }
        private ObjectSet<Club> _Clubs;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Player> Players
        {
            get
            {
                if ((_Players == null))
                {
                    _Players = base.CreateObjectSet<Player>("Players");
                }
                return _Players;
            }
        }
        private ObjectSet<Player> _Players;

        #endregion
        #region AddTo Methods
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Clubs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToClubs(Club club)
        {
            base.AddObject("Clubs", club);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the Players EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToPlayers(Player player)
        {
            base.AddObject("Players", player);
        }

        #endregion
    }
    

    #endregion
    
    #region Entities
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="ClubsModel", Name="Club")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Club : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Club object.
        /// </summary>
        /// <param name="name">Initial value of the Name property.</param>
        /// <param name="clubId">Initial value of the ClubId property.</param>
        public static Club CreateClub(global::System.String name, global::System.Int32 clubId)
        {
            Club club = new Club();
            club.Name = name;
            club.ClubId = clubId;
            return club;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.Int32 ClubId
        {
            get
            {
                return _ClubId;
            }
            set
            {
                if (_ClubId != value)
                {
                    OnClubIdChanging(value);
                    ReportPropertyChanging("ClubId");
                    _ClubId = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("ClubId");
                    OnClubIdChanged();
                }
            }
        }
        private global::System.Int32 _ClubId;
        partial void OnClubIdChanging(global::System.Int32 value);
        partial void OnClubIdChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("ClubsModel", "FK_Players_Clubs", "Player")]
        public EntityCollection<Player> Players
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Player>("ClubsModel.FK_Players_Clubs", "Player");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Player>("ClubsModel.FK_Players_Clubs", "Player", value);
                }
            }
        }

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="ClubsModel", Name="Player")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Player : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Player object.
        /// </summary>
        /// <param name="id">Initial value of the ID property.</param>
        /// <param name="name">Initial value of the Name property.</param>
        public static Player CreatePlayer(global::System.Int32 id, global::System.String name)
        {
            Player player = new Player();
            player.ID = id;
            player.Name = name;
            return player;
        }

        #endregion
        #region Primitive Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </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>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
        [DataMemberAttribute()]
        public global::System.String Name
        {
            get
            {
                return _Name;
            }
            set
            {
                OnNameChanging(value);
                ReportPropertyChanging("Name");
                _Name = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Name");
                OnNameChanged();
            }
        }
        private global::System.String _Name;
        partial void OnNameChanging(global::System.String value);
        partial void OnNameChanged();
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
        [DataMemberAttribute()]
        public Nullable<global::System.Int32> ClubId
        {
            get
            {
                return _ClubId;
            }
            set
            {
                OnClubIdChanging(value);
                ReportPropertyChanging("ClubId");
                _ClubId = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("ClubId");
                OnClubIdChanged();
            }
        }
        private Nullable<global::System.Int32> _ClubId;
        partial void OnClubIdChanging(Nullable<global::System.Int32> value);
        partial void OnClubIdChanged();

        #endregion
    
        #region Navigation Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("ClubsModel", "FK_Players_Clubs", "Club")]
        public Club Club
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Club>("ClubsModel.FK_Players_Clubs", "Club").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Club>("ClubsModel.FK_Players_Clubs", "Club").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Club> ClubReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Club>("ClubsModel.FK_Players_Clubs", "Club");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Club>("ClubsModel.FK_Players_Clubs", "Club", value);
                }
            }
        }

        #endregion
    }

    #endregion
    
}
