C# NopCommerce/Entity Framework:产品表迁移错误

C# NopCommerce/Entity Framework:产品表迁移错误,c#,entity-framework,nopcommerce,C#,Entity Framework,Nopcommerce,我目前在从实体框架更新NopCommerce数据库时遇到了一个非常恼人的问题 背景: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. foreach (var piloProduct in piloProducts) { var product = new Models

我目前在从实体框架更新NopCommerce数据库时遇到了一个非常恼人的问题

背景:

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.
foreach (var piloProduct in piloProducts)
{
    var product = new Models.Nop.Product
    {
        Name = piloProduct.Name,
        ShortDescription = piloProduct.ShortDescription,
        FullDescription = piloProduct.FullDescription,
        ProductTemplateId = 1,
        ShowOnHomePage = false,
        MetaKeywords = piloProduct.MetaKeywords,
        MetaDescription = piloProduct.MetaDescription,
        MetaTitle = piloProduct.MetaTitle,
        SeName = piloProduct.SeName,
        AllowCustomerReviews = false,
        ApprovedRatingSum = 0,
        NotApprovedRatingSum = 0,
        ApprovedTotalReviews = 0,
        NotApprovedTotalReviews = 0,
        Published = true,
        Deleted = false,
        CreatedOnUtc = DateTime.UtcNow,
        UpdatedOnUtc = DateTime.UtcNow
    };
    nopDb.Products.AddObject(product);
}
nopDb.SaveChanges();
我正在编写一个小工具,将一种过时的电子商务应用迁移到nopCommerce

错误:

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.
foreach (var piloProduct in piloProducts)
{
    var product = new Models.Nop.Product
    {
        Name = piloProduct.Name,
        ShortDescription = piloProduct.ShortDescription,
        FullDescription = piloProduct.FullDescription,
        ProductTemplateId = 1,
        ShowOnHomePage = false,
        MetaKeywords = piloProduct.MetaKeywords,
        MetaDescription = piloProduct.MetaDescription,
        MetaTitle = piloProduct.MetaTitle,
        SeName = piloProduct.SeName,
        AllowCustomerReviews = false,
        ApprovedRatingSum = 0,
        NotApprovedRatingSum = 0,
        ApprovedTotalReviews = 0,
        NotApprovedTotalReviews = 0,
        Published = true,
        Deleted = false,
        CreatedOnUtc = DateTime.UtcNow,
        UpdatedOnUtc = DateTime.UtcNow
    };
    nopDb.Products.AddObject(product);
}
nopDb.SaveChanges();
我为解决问题所做的努力

在过去,当我有一个未初始化的DateTime属性(0001年)时,会出现这种错误。。但在这种情况下,这不是问题所在。我查看并确保所有DateTime属性都已设置。由于这不起作用,我还尝试制作db列
datetime2(7)
,但没有成功。最后,我将它设置为
NULLABLE
,但它仍然给了我相同的错误。所以,很明显,这里发生了一些其他的事情,EF抛出了一些无用的错误。我想知道表上是否有一个insert触发器(或任何触发器),它可能试图在product variant表或另一个表中创建一个条目,而datetime错误则来自该表,但事实并非如此

代码:

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.
The statement has been terminated.
foreach (var piloProduct in piloProducts)
{
    var product = new Models.Nop.Product
    {
        Name = piloProduct.Name,
        ShortDescription = piloProduct.ShortDescription,
        FullDescription = piloProduct.FullDescription,
        ProductTemplateId = 1,
        ShowOnHomePage = false,
        MetaKeywords = piloProduct.MetaKeywords,
        MetaDescription = piloProduct.MetaDescription,
        MetaTitle = piloProduct.MetaTitle,
        SeName = piloProduct.SeName,
        AllowCustomerReviews = false,
        ApprovedRatingSum = 0,
        NotApprovedRatingSum = 0,
        ApprovedTotalReviews = 0,
        NotApprovedTotalReviews = 0,
        Published = true,
        Deleted = false,
        CreatedOnUtc = DateTime.UtcNow,
        UpdatedOnUtc = DateTime.UtcNow
    };
    nopDb.Products.AddObject(product);
}
nopDb.SaveChanges();
我完全搞不懂这一点,因为上面的代码非常简单明了。非常感谢您的帮助

更新

我刚刚尝试使用LINQtoSQL类而不是实体框架EDMX,但遇到了完全相同的问题。奇怪的是,我直接从SQLManagementStudio在表上运行了一个“INSERT-INTO”语句,但它成功了。。想想看。。。有没有办法确切地看到EF或Linq to SQL生成了哪些“INSERT”语句

以下是Mark Oreta要求的EDMX生成模型:

[EdmEntityTypeAttribute(NamespaceName="eSalesModel", Name="Product")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class Product : EntityObject
{
    public static Product CreateProduct(global::System.Int32 id, global::System.String name, global::System.Int32 productTemplateId, global::System.Boolean showOnHomePage, global::System.Boolean allowCustomerReviews, global::System.Int32 approvedRatingSum, global::System.Int32 notApprovedRatingSum, global::System.Int32 approvedTotalReviews, global::System.Int32 notApprovedTotalReviews, global::System.Boolean published, global::System.Boolean deleted)
    {
        Product product = new Product();
        product.Id = id;
        product.Name = name;
        product.ProductTemplateId = productTemplateId;
        product.ShowOnHomePage = showOnHomePage;
        product.AllowCustomerReviews = allowCustomerReviews;
        product.ApprovedRatingSum = approvedRatingSum;
        product.NotApprovedRatingSum = notApprovedRatingSum;
        product.ApprovedTotalReviews = approvedTotalReviews;
        product.NotApprovedTotalReviews = notApprovedTotalReviews;
        product.Published = published;
        product.Deleted = deleted;
        return product;
    }
[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();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public Nullable<global::System.Int32> PiloId
{
    get
    {
        return _PiloId;
    }
    set
    {
        OnPiloIdChanging(value);
        ReportPropertyChanging("PiloId");
        _PiloId = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("PiloId");
        OnPiloIdChanged();
    }
}
private Nullable<global::System.Int32> _PiloId;
partial void OnPiloIdChanging(Nullable<global::System.Int32> value);
partial void OnPiloIdChanged();

[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();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String ShortDescription
{
    get
    {
        return _ShortDescription;
    }
    set
    {
        OnShortDescriptionChanging(value);
        ReportPropertyChanging("ShortDescription");
        _ShortDescription = StructuralObject.SetValidValue(value, true);
        ReportPropertyChanged("ShortDescription");
        OnShortDescriptionChanged();
    }
}
private global::System.String _ShortDescription;
partial void OnShortDescriptionChanging(global::System.String value);
partial void OnShortDescriptionChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String FullDescription
{
    get
    {
        return _FullDescription;
    }
    set
    {
        OnFullDescriptionChanging(value);
        ReportPropertyChanging("FullDescription");
        _FullDescription = StructuralObject.SetValidValue(value, true);
        ReportPropertyChanged("FullDescription");
        OnFullDescriptionChanged();
    }
}
private global::System.String _FullDescription;
partial void OnFullDescriptionChanging(global::System.String value);
partial void OnFullDescriptionChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String AdminComment
{
    get
    {
        return _AdminComment;
    }
    set
    {
        OnAdminCommentChanging(value);
        ReportPropertyChanging("AdminComment");
        _AdminComment = StructuralObject.SetValidValue(value, true);
        ReportPropertyChanged("AdminComment");
        OnAdminCommentChanged();
    }
}
private global::System.String _AdminComment;
partial void OnAdminCommentChanging(global::System.String value);
partial void OnAdminCommentChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int32 ProductTemplateId
{
    get
    {
        return _ProductTemplateId;
    }
    set
    {
        OnProductTemplateIdChanging(value);
        ReportPropertyChanging("ProductTemplateId");
        _ProductTemplateId = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("ProductTemplateId");
        OnProductTemplateIdChanged();
    }
}
private global::System.Int32 _ProductTemplateId;
partial void OnProductTemplateIdChanging(global::System.Int32 value);
partial void OnProductTemplateIdChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Boolean ShowOnHomePage
{
    get
    {
        return _ShowOnHomePage;
    }
    set
    {
        OnShowOnHomePageChanging(value);
        ReportPropertyChanging("ShowOnHomePage");
        _ShowOnHomePage = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("ShowOnHomePage");
        OnShowOnHomePageChanged();
    }
}
private global::System.Boolean _ShowOnHomePage;
partial void OnShowOnHomePageChanging(global::System.Boolean value);
partial void OnShowOnHomePageChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String MetaKeywords
{
    get
    {
        return _MetaKeywords;
    }
    set
    {
        OnMetaKeywordsChanging(value);
        ReportPropertyChanging("MetaKeywords");
        _MetaKeywords = StructuralObject.SetValidValue(value, true);
        ReportPropertyChanged("MetaKeywords");
        OnMetaKeywordsChanged();
    }
}
private global::System.String _MetaKeywords;
partial void OnMetaKeywordsChanging(global::System.String value);
partial void OnMetaKeywordsChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String MetaDescription
{
    get
    {
        return _MetaDescription;
    }
    set
    {
        OnMetaDescriptionChanging(value);
        ReportPropertyChanging("MetaDescription");
        _MetaDescription = StructuralObject.SetValidValue(value, true);
        ReportPropertyChanged("MetaDescription");
        OnMetaDescriptionChanged();
    }
}
private global::System.String _MetaDescription;
partial void OnMetaDescriptionChanging(global::System.String value);
partial void OnMetaDescriptionChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String MetaTitle
{
    get
    {
        return _MetaTitle;
    }
    set
    {
        OnMetaTitleChanging(value);
        ReportPropertyChanging("MetaTitle");
        _MetaTitle = StructuralObject.SetValidValue(value, true);
        ReportPropertyChanged("MetaTitle");
        OnMetaTitleChanged();
    }
}
private global::System.String _MetaTitle;
partial void OnMetaTitleChanging(global::System.String value);
partial void OnMetaTitleChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String SeName
{
    get
    {
        return _SeName;
    }
    set
    {
        OnSeNameChanging(value);
        ReportPropertyChanging("SeName");
        _SeName = StructuralObject.SetValidValue(value, true);
        ReportPropertyChanged("SeName");
        OnSeNameChanged();
    }
}
private global::System.String _SeName;
partial void OnSeNameChanging(global::System.String value);
partial void OnSeNameChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Boolean AllowCustomerReviews
{
    get
    {
        return _AllowCustomerReviews;
    }
    set
    {
        OnAllowCustomerReviewsChanging(value);
        ReportPropertyChanging("AllowCustomerReviews");
        _AllowCustomerReviews = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("AllowCustomerReviews");
        OnAllowCustomerReviewsChanged();
    }
}
private global::System.Boolean _AllowCustomerReviews;
partial void OnAllowCustomerReviewsChanging(global::System.Boolean value);
partial void OnAllowCustomerReviewsChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int32 ApprovedRatingSum
{
    get
    {
        return _ApprovedRatingSum;
    }
    set
    {
        OnApprovedRatingSumChanging(value);
        ReportPropertyChanging("ApprovedRatingSum");
        _ApprovedRatingSum = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("ApprovedRatingSum");
        OnApprovedRatingSumChanged();
    }
}
private global::System.Int32 _ApprovedRatingSum;
partial void OnApprovedRatingSumChanging(global::System.Int32 value);
partial void OnApprovedRatingSumChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int32 NotApprovedRatingSum
{
    get
    {
        return _NotApprovedRatingSum;
    }
    set
    {
        OnNotApprovedRatingSumChanging(value);
        ReportPropertyChanging("NotApprovedRatingSum");
        _NotApprovedRatingSum = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("NotApprovedRatingSum");
        OnNotApprovedRatingSumChanged();
    }
}
private global::System.Int32 _NotApprovedRatingSum;
partial void OnNotApprovedRatingSumChanging(global::System.Int32 value);
partial void OnNotApprovedRatingSumChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int32 ApprovedTotalReviews
{
    get
    {
        return _ApprovedTotalReviews;
    }
    set
    {
        OnApprovedTotalReviewsChanging(value);
        ReportPropertyChanging("ApprovedTotalReviews");
        _ApprovedTotalReviews = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("ApprovedTotalReviews");
        OnApprovedTotalReviewsChanged();
    }
}
private global::System.Int32 _ApprovedTotalReviews;
partial void OnApprovedTotalReviewsChanging(global::System.Int32 value);
partial void OnApprovedTotalReviewsChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Int32 NotApprovedTotalReviews
{
    get
    {
        return _NotApprovedTotalReviews;
    }
    set
    {
        OnNotApprovedTotalReviewsChanging(value);
        ReportPropertyChanging("NotApprovedTotalReviews");
        _NotApprovedTotalReviews = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("NotApprovedTotalReviews");
        OnNotApprovedTotalReviewsChanged();
    }
}
private global::System.Int32 _NotApprovedTotalReviews;
partial void OnNotApprovedTotalReviewsChanging(global::System.Int32 value);
partial void OnNotApprovedTotalReviewsChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Boolean Published
{
    get
    {
        return _Published;
    }
    set
    {
        OnPublishedChanging(value);
        ReportPropertyChanging("Published");
        _Published = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("Published");
        OnPublishedChanged();
    }
}
private global::System.Boolean _Published;
partial void OnPublishedChanging(global::System.Boolean value);
partial void OnPublishedChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Boolean Deleted
{
    get
    {
        return _Deleted;
    }
    set
    {
        OnDeletedChanging(value);
        ReportPropertyChanging("Deleted");
        _Deleted = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("Deleted");
        OnDeletedChanged();
    }
}
private global::System.Boolean _Deleted;
partial void OnDeletedChanging(global::System.Boolean value);
partial void OnDeletedChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public Nullable<global::System.DateTime> CreatedOnUtc
{
    get
    {
        return _CreatedOnUtc;
    }
    set
    {
        OnCreatedOnUtcChanging(value);
        ReportPropertyChanging("CreatedOnUtc");
        _CreatedOnUtc = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("CreatedOnUtc");
        OnCreatedOnUtcChanged();
    }
}
private Nullable<global::System.DateTime> _CreatedOnUtc;
partial void OnCreatedOnUtcChanging(Nullable<global::System.DateTime> value);
partial void OnCreatedOnUtcChanged();

[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public Nullable<global::System.DateTime> UpdatedOnUtc
{
    get
    {
        return _UpdatedOnUtc;
    }
    set
    {
        OnUpdatedOnUtcChanging(value);
        ReportPropertyChanging("UpdatedOnUtc");
        _UpdatedOnUtc = StructuralObject.SetValidValue(value);
        ReportPropertyChanged("UpdatedOnUtc");
        OnUpdatedOnUtcChanged();
    }
}
private Nullable<global::System.DateTime> _UpdatedOnUtc;
partial void OnUpdatedOnUtcChanging(Nullable<global::System.DateTime> value);
partial void OnUpdatedOnUtcChanged();

[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("eSalesModel", "ProductCategory_Product", "Product_Category_Mapping")]
public EntityCollection<Product_Category_Mapping> Product_Category_Mapping
{
    get
    {
        return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product_Category_Mapping>("eSalesModel.ProductCategory_Product", "Product_Category_Mapping");
    }
    set
    {
        if ((value != null))
        {
            ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product_Category_Mapping>("eSalesModel.ProductCategory_Product", "Product_Category_Mapping", value);
        }
    }
}

[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("eSalesModel", "ProductManufacturer_Product", "Product_Manufacturer_Mapping")]
public EntityCollection<Product_Manufacturer_Mapping> Product_Manufacturer_Mapping
{
    get
    {
        return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product_Manufacturer_Mapping>("eSalesModel.ProductManufacturer_Product", "Product_Manufacturer_Mapping");
    }
    set
    {
        if ((value != null))
        {
            ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product_Manufacturer_Mapping>("eSalesModel.ProductManufacturer_Product", "Product_Manufacturer_Mapping", value);
        }
    }
}

[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("eSalesModel", "ProductPicture_Product", "Product_Picture_Mapping")]
public EntityCollection<Product_Picture_Mapping> Product_Picture_Mapping
{
    get
    {
        return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product_Picture_Mapping>("eSalesModel.ProductPicture_Product", "Product_Picture_Mapping");
    }
    set
    {
        if ((value != null))
        {
            ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product_Picture_Mapping>("eSalesModel.ProductPicture_Product", "Product_Picture_Mapping", value);
        }
    }
}
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("eSalesModel", "ProductReview_Product1", "ProductReview")]
public EntityCollection<ProductReview> ProductReviews
{
    get
    {
        return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductReview>("eSalesModel.ProductReview_Product1", "ProductReview");
    }
    set
    {
        if ((value != null))
        {
            ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductReview>("eSalesModel.ProductReview_Product1", "ProductReview", value);
        }
    }
}
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("eSalesModel", "ProductSpecificationAttribute_Product", "Product_SpecificationAttribute_Mapping")]
public EntityCollection<Product_SpecificationAttribute_Mapping> Product_SpecificationAttribute_Mapping
{
    get
    {
        return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<Product_SpecificationAttribute_Mapping>("eSalesModel.ProductSpecificationAttribute_Product", "Product_SpecificationAttribute_Mapping");
    }
    set
    {
        if ((value != null))
        {
            ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<Product_SpecificationAttribute_Mapping>("eSalesModel.ProductSpecificationAttribute_Product", "Product_SpecificationAttribute_Mapping", value);
        }
    }
}
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("eSalesModel", "ProductVariant_Product", "ProductVariant")]
public EntityCollection<ProductVariant> ProductVariants
{
    get
    {
        return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductVariant>("eSalesModel.ProductVariant_Product", "ProductVariant");
    }
    set
    {
        if ((value != null))
        {
            ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductVariant>("eSalesModel.ProductVariant_Product", "ProductVariant", value);
        }
    }
}
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("eSalesModel", "Product_ProductTag_Mapping", "ProductTag")]
public EntityCollection<ProductTag> ProductTags
{
    get
    {
        return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<ProductTag>("eSalesModel.Product_ProductTag_Mapping", "ProductTag");
    }
    set
    {
        if ((value != null))
        {
            ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<ProductTag>("eSalesModel.Product_ProductTag_Mapping", "ProductTag", value);
        }
    }
}
[EdmEntityTypeAttribute(NamespaceName=“esalemodel”,Name=“Product”)]
[可序列化()]
[DataContractAttribute(IsReference=true)]
公共部分类产品:EntityObject
{
公共静态产品(global::System.Int32 id,global::System.String名称,global::System.Int32 productTemplateId,global::System.Boolean showOnHomePage,global::System.Boolean allowCustomerReviews,global::System.Int32 approvedTotalReviews,global::System.Int32 notApprovedTotalReviews,global::System.Int32 notApprovedTotalReviews,全局::System.Boolean已发布,全局::System.Boolean已删除)
{
产品=新产品();
product.Id=Id;
product.Name=名称;
product.ProductTemplateId=ProductTemplateId;
product.ShowOnHomePage=ShowOnHomePage;
product.AllowCustomerReviews=AllowCustomerReviews;
product.ApprovedRatingSum=ApprovedRatingSum;
product.NotApprovedRatingSum=NotApprovedRatingSum;
product.ApprovedTotalReviews=ApprovedTotalReviews;
product.NotApprovedTotalReviews=NotApprovedTotalReviews;
product.Published=已发布;
product.Deleted=已删除;
退货产品;
}
[EdmScalarPropertyAttribute(EntityKeyProperty=true,IsNullable=false)]
[DataMemberAttribute()]
公共全局::System.Int32 Id
{
得到
{
返回_Id;
}
设置
{
如果(_Id!=值)
{
onidchange(值);
报告财产变更(“Id”);
_Id=StructuralObject.SetValidValue(值);
ReportPropertyChanged(“Id”);
OnIdChanged();
}
}
}
私有全局::System.Int32_Id;
部分无效OnidChange(全局::System.Int32值);
部分无效OnIdChanged();
[EdmScalarPropertyAttribute(EntityKeyProperty=false,IsNullable=true)]
[DataMemberAttribute()]
公共可取消的有毛类
{
得到
{
返回毛状体;
}
设置
{
OnPiloIdChanging(值);
报告性质变化(“毛状”);
_PiloId=StructuralObject.SetValidValue(值);
报告财产变更(“PiloId”);
OnPiloIdChanged();
}
}
私人可为空的毛状体;
部分无效(可为空值);
PiloidChanged()上的部分无效;
[EdmScalarPropertyAttribute(EntityKeyProperty=false,IsNullable=false)]
[DataMemberAttribute()]
public global::System.String名称
{
得到
{
返回_Name;
}
设置
{
OnNameChanging(值);
报告财产变更(“名称”);
_Name=StructuralObject.SetValidValue(值,false);
报告财产变更(“名称”);
OnNameChanged();
}
}
私有全局::System.String\u名称;
部分void OnNameChanging(全局::System.String值);
部分无效OnNameChanged();
[EdmScalarPropertyAttribute(EntityKeyProperty=false,IsNullable=true)]
[DataMemberAttribute()]
public global::System.String ShortDescription
{
得到
{
返回-简短描述;
}
设置
{
OnShortDescriptionChanged(值);
报告财产变更(“简短描述”);
_ShortDescription=StructuralObject.SetValidValue(值,true);
报告财产变更(“简短描述”);
OnShortDescriptionChanged();
}
}
private global::System.String\u ShortDescription;
ShortDescriptionChangeing上的部分无效(全局::System.String值);
ShortDescriptionChanged()上的部分无效;
[EdmScalarPropertyAttribute(EntityKeyProperty=false,IsNullable=true)]
[DataMemberAttribute()]
public global::System.String FullDescription
{
得到
{
返回完整描述;
}
设置
{
OnFullDescriptionChange(值);
报告财产变更(“完整说明”);
_FullDescription=StructuralObject.SetValidValue(值,true);
报告财产变更(“完整描述”);
OnFullDescriptionChanged();
}
}
私有全局::System.String\u FullDescription;
部分void onFullDescriptionChange(全局::System.String值);
部分void OnFullDescriptionChanged();
[EdmScalarPropertyAttribute(EntityKeyProperty=false,IsNullable=true)]
[DataMemberAttribute()]
公共全局::System.String AdminComment
{
得到
{