//------------------------------------------------------------------------------
// <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("Model1", "ProduktZamówienie", "Produkt", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Projekt_NajpierwModel.Produkt), "Zamówienie", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Projekt_NajpierwModel.Zamówienie))]

#endregion

namespace Projekt_NajpierwModel
{
    #region Contexts
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    public partial class Model1Container : ObjectContext
    {
        #region Constructors
    
        /// <summary>
        /// Initializes a new Model1Container object using the connection string found in the 'Model1Container' section of the application configuration file.
        /// </summary>
        public Model1Container() : base("name=Model1Container", "Model1Container")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new Model1Container object.
        /// </summary>
        public Model1Container(string connectionString) : base(connectionString, "Model1Container")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        /// <summary>
        /// Initialize a new Model1Container object.
        /// </summary>
        public Model1Container(EntityConnection connection) : base(connection, "Model1Container")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
        #endregion
    
        #region Partial Methods
    
        partial void OnContextCreated();
    
        #endregion
    
        #region ObjectSet Properties
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Produkt> ProduktSet
        {
            get
            {
                if ((_ProduktSet == null))
                {
                    _ProduktSet = base.CreateObjectSet<Produkt>("ProduktSet");
                }
                return _ProduktSet;
            }
        }
        private ObjectSet<Produkt> _ProduktSet;
    
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        public ObjectSet<Zamówienie> ZamówienieSet
        {
            get
            {
                if ((_ZamówienieSet == null))
                {
                    _ZamówienieSet = base.CreateObjectSet<Zamówienie>("ZamówienieSet");
                }
                return _ZamówienieSet;
            }
        }
        private ObjectSet<Zamówienie> _ZamówienieSet;

        #endregion
        #region AddTo Methods
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ProduktSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToProduktSet(Produkt produkt)
        {
            base.AddObject("ProduktSet", produkt);
        }
    
        /// <summary>
        /// Deprecated Method for adding a new object to the ZamówienieSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
        /// </summary>
        public void AddToZamówienieSet(Zamówienie zamówienie)
        {
            base.AddObject("ZamówienieSet", zamówienie);
        }

        #endregion
    }
    

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

        #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 Nazwa
        {
            get
            {
                return _Nazwa;
            }
            set
            {
                OnNazwaChanging(value);
                ReportPropertyChanging("Nazwa");
                _Nazwa = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Nazwa");
                OnNazwaChanged();
            }
        }
        private global::System.String _Nazwa;
        partial void OnNazwaChanging(global::System.String value);
        partial void OnNazwaChanged();

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

        #endregion
    }
    
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName="Model1", Name="Zamówienie")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class Zamówienie : EntityObject
    {
        #region Factory Method
    
        /// <summary>
        /// Create a new Zamówienie object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="nazwa">Initial value of the Nazwa property.</param>
        public static Zamówienie CreateZamówienie(global::System.Int32 id, global::System.String nazwa)
        {
            Zamówienie zamówienie = new Zamówienie();
            zamówienie.Id = id;
            zamówienie.Nazwa = nazwa;
            return zamówienie;
        }

        #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 Nazwa
        {
            get
            {
                return _Nazwa;
            }
            set
            {
                OnNazwaChanging(value);
                ReportPropertyChanging("Nazwa");
                _Nazwa = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Nazwa");
                OnNazwaChanged();
            }
        }
        private global::System.String _Nazwa;
        partial void OnNazwaChanging(global::System.String value);
        partial void OnNazwaChanged();

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

        #endregion
    }

    #endregion
    
}
