ExampleModel.Designer.cs
Dosyayı İndir
//------------------------------------------------------------------------------
// <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("ExampleModel", "FK_Product_Category", "Category", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(ExampleEntityLibrary.Category), "Product", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(ExampleEntityLibrary.Product), true)]
#endregion
namespace ExampleEntityLibrary
{
#region Contexts
/// <summary>
/// No Metadata Documentation available.
/// </summary>
public partial class ExampleEntities : ObjectContext
{
#region Constructors
/// <summary>
/// Initializes a new ExampleEntities object using the connection string found in the 'ExampleEntities' section of the application configuration file.
/// </summary>
public ExampleEntities() : base("name=ExampleEntities", "ExampleEntities")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
/// <summary>
/// Initialize a new ExampleEntities object.
/// </summary>
public ExampleEntities(string connectionString) : base(connectionString, "ExampleEntities")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
/// <summary>
/// Initialize a new ExampleEntities object.
/// </summary>
public ExampleEntities(EntityConnection connection) : base(connection, "ExampleEntities")
{
this.ContextOptions.LazyLoadingEnabled = true;
OnContextCreated();
}
#endregion
#region Partial Methods
partial void OnContextCreated();
#endregion
#region ObjectSet Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
public ObjectSet<Category> Categories
{
get
{
if ((_Categories == null))
{
_Categories = base.CreateObjectSet<Category>("Categories");
}
return _Categories;
}
}
private ObjectSet<Category> _Categories;
/// <summary>
/// No Metadata Documentation available.
/// </summary>
public ObjectSet<Product> Products
{
get
{
if ((_Products == null))
{
_Products = base.CreateObjectSet<Product>("Products");
}
return _Products;
}
}
private ObjectSet<Product> _Products;
#endregion
#region AddTo Methods
/// <summary>
/// Deprecated Method for adding a new object to the Categories EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
/// </summary>
public void AddToCategories(Category category)
{
base.AddObject("Categories", category);
}
/// <summary>
/// Deprecated Method for adding a new object to the Products EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead.
/// </summary>
public void AddToProducts(Product product)
{
base.AddObject("Products", product);
}
#endregion
}
#endregion
#region Entities
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmEntityTypeAttribute(NamespaceName="ExampleModel", Name="Category")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class Category : EntityObject
{
#region Factory Method
/// <summary>
/// Create a new Category object.
/// </summary>
/// <param name="categoryId">Initial value of the CategoryId property.</param>
public static Category CreateCategory(global::System.Int64 categoryId)
{
Category category = new Category();
category.CategoryId = categoryId;
return category;
}
#endregion
#region Primitive Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int64 CategoryId
{
get
{
return _CategoryId;
}
set
{
if (_CategoryId != value)
{
OnCategoryIdChanging(value);
ReportPropertyChanging("CategoryId");
_CategoryId = StructuralObject.SetValidValue(value);
ReportPropertyChanged("CategoryId");
OnCategoryIdChanged();
}
}
}
private global::System.Int64 _CategoryId;
partial void OnCategoryIdChanging(global::System.Int64 value);
partial void OnCategoryIdChanged();
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String CategoryName
{
get
{
return _CategoryName;
}
set
{
OnCategoryNameChanging(value);
ReportPropertyChanging("CategoryName");
_CategoryName = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("CategoryName");
OnCategoryNameChanged();
}
}
private global::System.String _CategoryName;
partial void OnCategoryNameChanging(global::System.String value);
partial void OnCategoryNameChanged();
#endregion
#region Navigation Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("ExampleModel", "FK_Product_Category", "Product")]
public EntityCollection<Product> Products
{
get
{
return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product>("ExampleModel.FK_Product_Category", "Product");
}
set
{
if ((value != null))
{
((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product>("ExampleModel.FK_Product_Category", "Product", value);
}
}
}
#endregion
}
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmEntityTypeAttribute(NamespaceName="ExampleModel", Name="Product")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class Product : EntityObject
{
#region Factory Method
/// <summary>
/// Create a new Product object.
/// </summary>
/// <param name="productId">Initial value of the ProductId property.</param>
public static Product CreateProduct(global::System.Int64 productId)
{
Product product = new Product();
product.ProductId = productId;
return product;
}
#endregion
#region Primitive Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int64 ProductId
{
get
{
return _ProductId;
}
set
{
if (_ProductId != value)
{
OnProductIdChanging(value);
ReportPropertyChanging("ProductId");
_ProductId = StructuralObject.SetValidValue(value);
ReportPropertyChanged("ProductId");
OnProductIdChanged();
}
}
}
private global::System.Int64 _ProductId;
partial void OnProductIdChanging(global::System.Int64 value);
partial void OnProductIdChanged();
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String ProductName
{
get
{
return _ProductName;
}
set
{
OnProductNameChanging(value);
ReportPropertyChanging("ProductName");
_ProductName = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("ProductName");
OnProductNameChanged();
}
}
private global::System.String _ProductName;
partial void OnProductNameChanging(global::System.String value);
partial void OnProductNameChanged();
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public Nullable<global::System.Double> SalesPrice
{
get
{
return _SalesPrice;
}
set
{
OnSalesPriceChanging(value);
ReportPropertyChanging("SalesPrice");
_SalesPrice = StructuralObject.SetValidValue(value);
ReportPropertyChanged("SalesPrice");
OnSalesPriceChanged();
}
}
private Nullable<global::System.Double> _SalesPrice;
partial void OnSalesPriceChanging(Nullable<global::System.Double> value);
partial void OnSalesPriceChanged();
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public Nullable<global::System.Int64> CategoryId
{
get
{
return _CategoryId;
}
set
{
OnCategoryIdChanging(value);
ReportPropertyChanging("CategoryId");
_CategoryId = StructuralObject.SetValidValue(value);
ReportPropertyChanged("CategoryId");
OnCategoryIdChanged();
}
}
private Nullable<global::System.Int64> _CategoryId;
partial void OnCategoryIdChanging(Nullable<global::System.Int64> value);
partial void OnCategoryIdChanged();
#endregion
#region Navigation Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("ExampleModel", "FK_Product_Category", "Category")]
public Category Category
{
get
{
return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Category>("ExampleModel.FK_Product_Category", "Category").Value;
}
set
{
((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Category>("ExampleModel.FK_Product_Category", "Category").Value = value;
}
}
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[BrowsableAttribute(false)]
[DataMemberAttribute()]
public EntityReference<Category> CategoryReference
{
get
{
return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Category>("ExampleModel.FK_Product_Category", "Category");
}
set
{
if ((value != null))
{
((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Category>("ExampleModel.FK_Product_Category", "Category", value);
}
}
}
#endregion
}
#endregion
}
Dosyayı İndir