From 99fc0e655886ddcfc16bfbea0b20e999a959f5d0 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Tue, 19 Oct 2021 12:06:26 +0200 Subject: [PATCH 01/99] Copied EntityFramework project as a base for new EFCore project --- .../Framework/App.config | 13 + .../Framework/AssociationInfo.cs | 54 + .../Framework/DbContextExtensions.cs | 99 + .../Framework/DbDomainService.cs | 314 + ...mainServiceDescriptionProviderAttribute.cs | 100 + .../Framework/DbResource.Designer.cs | 99 + .../Framework/DbResource.resx | 132 + .../Framework/GlobalSuppressions.cs | 20 + .../Framework/LinqToEntitiesDomainService.cs | 304 + ...ntitiesDomainServiceDescriptionProvider.cs | 80 + ...mainServiceDescriptionProviderAttribute.cs | 104 + .../LinqToEntitiesTypeDescriptionContext.cs | 157 + .../Framework/LinqToEntitiesTypeDescriptor.cs | 296 + .../MetadataPropertyDescriptorWrapper.cs | 71 + .../Framework/MetadataResource.Designer.cs | 72 + .../Framework/MetadataResource.resx | 123 + .../Framework/MetadataWorkspaceUtilities.cs | 241 + .../Framework/ObjectContextExtensions.cs | 91 + .../Framework/ObjectContextUtilities.cs | 196 + ...Services.Server.EntityFrameworkCore.csproj | 47 + .../Framework/Properties/AssemblyInfo.cs | 26 + .../Framework/QueryHelper.cs | 37 + .../Framework/Resource.Designer.cs | 99 + .../Framework/Resource.resx | 132 + .../Framework/TypeDescriptionContextBase.cs | 50 + .../Framework/TypeDescriptorBase.cs | 90 + .../Test/CodeFirstModel/App.config | 13 + .../Test/CodeFirstModel/Category.cs | 24 + .../Test/CodeFirstModel/Customer.cs | 52 + .../CodeFirstModel/CustomerDemographic.cs | 20 + .../Test/CodeFirstModel/DbContextModel.cs | 63 + .../EFCoreCodeFirstModels.csproj | 27 + .../Test/CodeFirstModel/Employee.cs | 45 + .../Test/CodeFirstModel/Order.cs | 69 + .../Test/CodeFirstModel/Order_Detail.cs | 33 + .../Test/CodeFirstModel/Product.cs | 65 + .../Test/CodeFirstModel/ProductInfo.cs | 48 + .../CodeFirstModel/Properties/AssemblyInfo.cs | 13 + .../Test/CodeFirstModel/Region.cs | 22 + .../Test/CodeFirstModel/Shipper.cs | 19 + .../Test/CodeFirstModel/Supplier.cs | 28 + .../Test/CodeFirstModel/Territory.cs | 23 + .../AdventureWorks/AWBuildVersion.cs | 22 + .../DbContextModel/AdventureWorks/Address.cs | 42 + .../AdventureWorks/AddressType.cs | 31 + .../AdventureWorksDbCtx.Context.cs | 100 + .../AdventureWorksDbCtx.Context.tt | 194 + .../AdventureWorksDbCtx.Designer.cs | 4 + .../AdventureWorks/AdventureWorksDbCtx.cs | 9 + .../AdventureWorks/AdventureWorksDbCtx.edmx | 6405 +++++++++++++++++ .../AdventureWorks/AdventureWorksDbCtx.tt | 280 + .../AdventureWorksPartialClasses.cs | 103 + .../AdventureWorks/BillOfMaterial.cs | 31 + .../DbContextModel/AdventureWorks/Contact.cs | 50 + .../AdventureWorks/ContactCreditCard.cs | 24 + .../AdventureWorks/ContactType.cs | 30 + .../AdventureWorks/CountryRegion.cs | 30 + .../AdventureWorks/CountryRegionCurrency.cs | 24 + .../AdventureWorks/CreditCard.cs | 33 + .../DbContextModel/AdventureWorks/Culture.cs | 28 + .../DbContextModel/AdventureWorks/Currency.cs | 32 + .../AdventureWorks/CurrencyRate.cs | 34 + .../DbContextModel/AdventureWorks/Customer.cs | 36 + .../AdventureWorks/CustomerAddress.cs | 27 + .../AdventureWorks/DatabaseLog.cs | 26 + .../AdventureWorks/Department.cs | 29 + .../DbContextModel/AdventureWorks/Document.cs | 35 + .../DbContextModel/AdventureWorks/Employee.cs | 54 + .../AdventureWorks/EmployeeAddress.cs | 25 + .../EmployeeDepartmentHistory.cs | 28 + .../AdventureWorks/EmployeePayHistory.cs | 25 + .../DbContextModel/AdventureWorks/ErrorLog.cs | 27 + .../AdventureWorks/Illustration.cs | 28 + .../AdventureWorks/Individual.cs | 25 + .../AdventureWorks/JobCandidate.cs | 24 + .../DbContextModel/AdventureWorks/Location.cs | 32 + .../DbContextModel/AdventureWorks/Product.cs | 80 + .../AdventureWorks/ProductCategory.cs | 29 + .../AdventureWorks/ProductCostHistory.cs | 25 + .../AdventureWorks/ProductDescription.cs | 29 + .../AdventureWorks/ProductDocument.cs | 24 + .../AdventureWorks/ProductInventory.cs | 28 + .../AdventureWorks/ProductListPriceHistory.cs | 25 + .../AdventureWorks/ProductModel.cs | 35 + .../ProductModelIllustration.cs | 24 + .../ProductModelProductDescriptionCulture.cs | 26 + .../AdventureWorks/ProductPhoto.cs | 31 + .../AdventureWorks/ProductProductPhoto.cs | 25 + .../AdventureWorks/ProductReview.cs | 28 + .../AdventureWorks/ProductSubcategory.cs | 31 + .../AdventureWorks/ProductVendor.cs | 33 + .../AdventureWorks/PurchaseOrder.cs | 41 + .../AdventureWorks/PurchaseOrderDetail.cs | 32 + .../AdventureWorks/SalesOrderDetail.cs | 32 + .../AdventureWorks/SalesOrderHeader.cs | 63 + .../SalesOrderHeaderSalesReason.cs | 24 + .../AdventureWorks/SalesPerson.cs | 42 + .../AdventureWorks/SalesPersonQuotaHistory.cs | 25 + .../AdventureWorks/SalesReason.cs | 29 + .../AdventureWorks/SalesTaxRate.cs | 27 + .../AdventureWorks/SalesTerritory.cs | 43 + .../AdventureWorks/SalesTerritoryHistory.cs | 27 + .../AdventureWorks/ScrapReason.cs | 28 + .../DbContextModel/AdventureWorks/Shift.cs | 30 + .../AdventureWorks/ShipMethod.cs | 33 + .../AdventureWorks/ShoppingCartItem.cs | 26 + .../AdventureWorks/SpecialOffer.cs | 36 + .../AdventureWorks/SpecialOfferProduct.cs | 31 + .../AdventureWorks/StateProvince.cs | 37 + .../DbContextModel/AdventureWorks/Store.cs | 33 + .../AdventureWorks/StoreContact.cs | 27 + .../AdventureWorks/TransactionHistory.cs | 29 + .../TransactionHistoryArchive.cs | 27 + .../AdventureWorks/UnitMeasure.cs | 34 + .../DbContextModel/AdventureWorks/Vendor.cs | 39 + .../AdventureWorks/VendorAddress.cs | 26 + .../AdventureWorks/VendorContact.cs | 26 + .../AdventureWorks/WorkOrder.cs | 37 + .../AdventureWorks/WorkOrderRouting.cs | 33 + .../AdventureWorks/sysdiagram.cs | 23 + .../Test/DbContextModel/App.config | 13 + .../EFCoreDbContextModels.csproj | 334 + .../Test/DbContextModel/Northwind/Category.cs | 29 + .../Test/DbContextModel/Northwind/Customer.cs | 38 + .../Northwind/CustomerDemographic.cs | 27 + .../Test/DbContextModel/Northwind/Employee.cs | 48 + .../Northwind/NorthwindDbCtx.Designer.cs | 4 + .../Northwind/NorthwindDbCtx.edmx | 934 +++ .../Northwind/NorthwindEntities.Context.cs | 40 + .../Northwind/NorthwindEntities.Context.tt | 194 + .../Northwind/NorthwindEntities.cs | 9 + .../Northwind/NorthwindEntities.tt | 280 + .../Northwind/NorthwindPartialClasses.cs | 135 + .../Test/DbContextModel/Northwind/Order.cs | 42 + .../DbContextModel/Northwind/Order_Detail.cs | 26 + .../Test/DbContextModel/Northwind/Product.cs | 37 + .../Test/DbContextModel/Northwind/Region.cs | 27 + .../Test/DbContextModel/Northwind/Shipper.cs | 28 + .../Test/DbContextModel/Northwind/Supplier.cs | 37 + .../DbContextModel/Northwind/Territory.cs | 29 + .../DbContextModel/Properties/AssemblyInfo.cs | 19 + src/RiaServices.sln | 25 +- 142 files changed, 15304 insertions(+), 2 deletions(-) create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.resx create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Properties/AssemblyInfo.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config new file mode 100644 index 000000000..01f6c9b5f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config @@ -0,0 +1,13 @@ + + + + +
+ + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs new file mode 100644 index 000000000..19e1a187e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs @@ -0,0 +1,54 @@ +namespace OpenRiaServices.EntityFramework +{ + /// + /// Information about an Association + /// + internal class AssociationInfo + { + /// + /// The name of the association + /// + public string Name + { + get; + set; + } + + /// + /// The key members on the FK side of the association + /// + public string[] ThisKey + { + get; + set; + } + + /// + /// The key members on the non-FK side of the association + /// + public string[] OtherKey + { + get; + set; + } + + /// + /// The foreign key role name for this association + /// + public string FKRole + { + get; + set; + } + + /// + /// Gets or sets a value indicating whether this association can have a + /// multiplicity of zero + /// + public bool IsRequired + { + get; + set; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs new file mode 100644 index 000000000..70a9cb730 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs @@ -0,0 +1,99 @@ +using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Data.Entity; +using System.Data.Entity.Core.Objects; +using System.Data.Entity.Infrastructure; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// DbContext extension methods for DbDomainService authors. + /// + public static class DbContextExtensions + { + /// + /// Extension method used to attach the specified entity as modified, + /// with the specified original state. + /// + /// The entity Type + /// The to attach to. + /// The current entity. + /// The original entity. + /// The corresponding + public static void AttachAsModified(this IDbSet dbSet, T current, T original, DbContext dbContext) where T : class + { + if (dbSet == null) + { + throw new ArgumentNullException(nameof(dbSet)); + } + if (current == null) + { + throw new ArgumentNullException(nameof(current)); + } + if (original == null) + { + throw new ArgumentNullException(nameof(original)); + } + if (dbContext == null) + { + throw new ArgumentNullException(nameof(dbContext)); + } + + DbEntityEntry entityEntry = dbContext.Entry(current); + if (entityEntry.State == EntityState.Detached) + { + dbSet.Attach(current); + } + else + { + entityEntry.State = EntityState.Modified; + } + + ObjectContext objectContext = (dbContext as IObjectContextAdapter).ObjectContext; + ObjectStateEntry stateEntry = ObjectContextUtilities.AttachAsModifiedInternal(current, original, objectContext); + + if (stateEntry.State != EntityState.Modified) + { + // Ensure that when we leave this method, the entity is in a + // Modified state. For example, if current and original are the + // same, we still need to force the state transition + entityEntry.State = EntityState.Modified; + } + } + + /// + /// Extension method used to attach the specified entity as modified. This overload + /// can be used in cases where the entity has a Timestamp member. + /// + /// The entity type + /// The to attach to + /// The current entity + /// The coresponding + public static void AttachAsModified(this IDbSet dbSet, T entity, DbContext dbContext) where T : class + { + if (dbSet == null) + { + throw new ArgumentNullException(nameof(dbSet)); + } + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + if (dbContext == null) + { + throw new ArgumentNullException(nameof(dbContext)); + } + + DbEntityEntry entityEntry = dbContext.Entry(entity); + if (entityEntry.State == EntityState.Detached) + { + // attach the entity + dbSet.Attach(entity); + } + + // transition the entity to the modified state + entityEntry.State = EntityState.Modified; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs new file mode 100644 index 000000000..888791cf4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs @@ -0,0 +1,314 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Data.Entity; +using System.Data.Entity.Core; +using System.Data.Entity.Core.Objects; +using System.Data.Entity.Infrastructure; +using System.Globalization; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// Base class for DomainServices operating on LINQ To Entities DbContext based data models + /// + /// The DbContext type + [DbDomainServiceDescriptionProvider] + public abstract class DbDomainService : DomainService + where TContext : DbContext, new() + { + private TContext _dbContext; + private ObjectContext _refreshContext; + + /// + /// Protected constructor for the abstract class. + /// + protected DbDomainService() + { + } + + /// + /// Initializes the . must be called + /// prior to invoking any operations on the instance. + /// + /// The for this + /// instance. Overrides must call the base method. + public override void Initialize(DomainServiceContext context) + { + base.Initialize(context); + + ObjectContext objectContext = ((IObjectContextAdapter)this.DbContext).ObjectContext; + // We turn this off, since our deserializer isn't going to create + // the EF proxy types anyways. Proxies only really work if the entities + // are queried on the server. + objectContext.ContextOptions.ProxyCreationEnabled = false; + + // Turn off DbContext validation. + this.DbContext.Configuration.ValidateOnSaveEnabled = false; + + // Turn off AutoDetectChanges. + this.DbContext.Configuration.AutoDetectChangesEnabled = false; + + this.DbContext.Configuration.LazyLoadingEnabled = false; + } + + /// + /// Returns the DbContext object. + /// + /// The created DbContext object. + protected virtual TContext CreateDbContext() + { + return new TContext(); + } + + /// + /// Gets the used for retrieving store values + /// + private ObjectContext RefreshContext + { + get + { + if (this._refreshContext == null) + { + DbContext dbContext = this.CreateDbContext(); + this._refreshContext = (dbContext as IObjectContextAdapter).ObjectContext; + } + return this._refreshContext; + } + } + + /// + /// Gets the + /// + protected TContext DbContext + { + get + { + if (this._dbContext == null) + { + this._dbContext = this.CreateDbContext(); + } + return this._dbContext; + } + } + + /// + /// Gets the number of rows in an . + /// + /// The element Type of the query. + /// The query for which the count should be returned. + /// which may be used by hosting layer to request cancellation + /// The total number of rows. + protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) + { + return QueryHelper.CountAsync(query, cancellationToken); + } + + /// + /// Enumerates the specified enumerable to guarantee eager execution. + /// If possible code similar to ToListAsync is used, but with optimizations to start with a larger initial capacity + /// + /// The element type of the enumerable. + /// The enumerable to enumerate. + /// The estimated number of items the enumerable will yield. + /// which may be used by hosting layer to request cancellation + /// A new enumerable with the results of the enumerated enumerable. + protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) + { + // EF will throw if provider is not a IDbAsyncEnumerable + if (enumerable is IDbAsyncEnumerable asyncEnumerable) + { + return QueryHelper.EnumerateAsyncEnumerable(asyncEnumerable, estimatedResultCount, cancellationToken); + } + else + { + return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); + } + } + + + /// + /// This method is called to finalize changes after all the operations in the specified changeset + /// have been invoked. All changes are committed to the DbContext, and any resulting optimistic + /// concurrency errors are processed. + /// + /// True if the was persisted successfully, false otherwise. + protected override ValueTask PersistChangeSetAsync(CancellationToken cancellationToken) + { + return new ValueTask(this.InvokeSaveChangesAsync(true, cancellationToken)); + } + + /// + /// This method is called to finalize changes after all the operations in the specified changeset + /// have been invoked. All changes are committed to the DbContext. + /// If the submit fails due to concurrency conflicts will be called. + /// If returns true a single resubmit will be attempted. + /// + /// + /// The list of concurrency conflicts that occurred + /// Returns true if the was persisted successfully, false otherwise. + protected virtual bool ResolveConflicts(IEnumerable conflicts) + { + return false; + } + + /// + /// See . + /// + /// A indicating whether or not the instance is currently disposing. + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (this.DbContext != null) + { + this.DbContext.Dispose(); + } + if (this._refreshContext != null) + { + this._refreshContext.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// Called by PersistChangeSet method to save the changes to the database. + /// + /// Flag indicating whether to retry after resolving conflicts. + /// + /// true if saved successfully and false otherwise. + private async Task InvokeSaveChangesAsync(bool retryOnConflict, CancellationToken cancellationToken) + { + try + { + await this.DbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false); + } + catch (DbUpdateConcurrencyException ex) + { + // Map the operations that could have caused a conflict to an entity. + Dictionary operationConflictMap = new Dictionary(); + foreach (DbEntityEntry conflict in ex.Entries) + { + ChangeSetEntry entry = this.ChangeSet.ChangeSetEntries.SingleOrDefault(p => object.ReferenceEquals(p.Entity, conflict.Entity)); + if (entry == null) + { + // If we're unable to find the object in our changeset, propagate + // the original exception + throw; + } + operationConflictMap.Add(conflict, entry); + } + + this.SetChangeSetConflicts(operationConflictMap); + + // Call out to any user resolve code and resubmit if all conflicts + // were resolved + if (retryOnConflict && this.ResolveConflicts(ex.Entries)) + { + // clear the conflics from the entries + foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) + { + entry.StoreEntity = null; + entry.ConflictMembers = null; + entry.IsDeleteConflict = false; + } + + // If all conflicts were resolved attempt a resubmit + return await this.InvokeSaveChangesAsync(/* retryOnConflict */ false, cancellationToken).ConfigureAwait(false); + } + + // if the conflict wasn't resolved, call the error handler + this.OnError(new DomainServiceErrorInfo(ex)); + + // if there was a conflict but no conflict information was + // extracted to the individual entries, we need to ensure the + // error makes it back to the client + if (!this.ChangeSet.HasError) + { + throw; + } + return false; + } + return true; + } + + /// + /// Updates each entry in the ChangeSet with its corresponding conflict info. + /// + /// Map of conflicts to their corresponding operations entries. + private void SetChangeSetConflicts(Dictionary operationConflictMap) + { + object storeValue; + EntityKey refreshEntityKey; + + ObjectContext objectContext = ((IObjectContextAdapter)this.DbContext).ObjectContext; + ObjectStateManager objectStateManager = objectContext.ObjectStateManager; + if (objectStateManager == null) + { + throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, DbResource.ObjectStateManagerNotFoundException, this.DbContext.GetType().Name)); + } + + foreach (var conflictEntry in operationConflictMap) + { + DbEntityEntry entityEntry = conflictEntry.Key; + ObjectStateEntry stateEntry = objectStateManager.GetObjectStateEntry(entityEntry.Entity); + + if (stateEntry.State == EntityState.Unchanged) + { + continue; + } + + // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. + ChangeSetEntry operationInConflict = conflictEntry.Value; + refreshEntityKey = this.RefreshContext.CreateEntityKey(stateEntry.EntitySet.Name, stateEntry.Entity); + this.RefreshContext.TryGetObjectByKey(refreshEntityKey, out storeValue); + operationInConflict.StoreEntity = storeValue; + + // StoreEntity will be null if the entity has been deleted in the store (i.e. Delete/Delete conflict) + bool isDeleted = (operationInConflict.StoreEntity == null); + if (isDeleted) + { + operationInConflict.IsDeleteConflict = true; + } + else + { + // Determine which members are in conflict by comparing original values to the current DB values + PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); + List membersInConflict = new List(); + object originalValue; + PropertyDescriptor pd; + for (int i = 0; i < stateEntry.OriginalValues.FieldCount; i++) + { + originalValue = stateEntry.OriginalValues.GetValue(i); + if (originalValue is DBNull) + { + originalValue = null; + } + + string propertyName = stateEntry.OriginalValues.GetName(i); + pd = propDescriptors[propertyName]; + if (pd == null) + { + // This might happen in the case of a private model + // member that isn't mapped + continue; + } + + if (!object.Equals(originalValue, pd.GetValue(operationInConflict.StoreEntity))) + { + membersInConflict.Add(pd.Name); + } + } + operationInConflict.ConflictMembers = membersInConflict; + } + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs new file mode 100644 index 000000000..288bfb6d2 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs @@ -0,0 +1,100 @@ +using System; +using System.ComponentModel; +using System.Data.Entity; +using System.Globalization; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// Attribute applied to a that exposes LINQ to Entities mapped + /// Types. + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] + public sealed class DbDomainServiceDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute + { + private Type _dbContextType; + + /// + /// Default constructor. Using this constructor, the Type of the LINQ To Entities + /// DbContext will be inferred from the the + /// attribute is applied to. + /// + public DbDomainServiceDescriptionProviderAttribute() + : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + { + } + + /// + /// Constructs an attribute for the specified LINQ To Entities + /// DbContext Type. + /// + /// The LINQ To Entities ObjectContext Type. + public DbDomainServiceDescriptionProviderAttribute(Type dbContextType) + : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + { + this._dbContextType = dbContextType; + } + + /// + /// The Linq To Entities DbContext Type. + /// + public Type DbContextType + { + get + { + return this._dbContextType; + } + } + + /// + /// This method creates an instance of the . + /// + /// The Type to create a description provider for. + /// The existing parent description provider. + /// The description provider. + public override DomainServiceDescriptionProvider CreateProvider(Type domainServiceType, DomainServiceDescriptionProvider parent) + { + if (domainServiceType == null) + { + throw new ArgumentNullException(nameof(domainServiceType)); + } + + if (this._dbContextType == null) + { + this._dbContextType = GetContextType(domainServiceType); + } + + if (!typeof(DbContext).IsAssignableFrom(this._dbContextType)) + { + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, + DbResource.InvalidDbDomainServiceDescriptionProviderSpecification, + this._dbContextType)); + } + + return new LinqToEntitiesDomainServiceDescriptionProvider(domainServiceType, this._dbContextType, parent); + } + + /// + /// Extracts the context type from the specified . + /// + /// A LINQ to Entities domain service type. + /// The type of the object context. + private static Type GetContextType(Type domainServiceType) + { + Type efDomainServiceType = domainServiceType.BaseType; + while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DbDomainService<>)) + { + if (efDomainServiceType == typeof(object)) + { + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, + Resource.InvalidMetadataProviderSpecification, + typeof(DbDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DbDomainService<>).Name)); + } + efDomainServiceType = efDomainServiceType.BaseType; + } + + return efDomainServiceType.GetGenericArguments()[0]; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs new file mode 100644 index 000000000..5be5963ea --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OpenRiaServices.EntityFramework { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class DbResource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal DbResource() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.DbResource", typeof(DbResource).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The DbContext type '{0}' does not contain a default constructor. A default constructor is required to use EntityFramework in the Code-First mode with WCF RIA Services.. + /// + public static string DefaultCtorNotFound { + get { + return ResourceManager.GetString("DefaultCtorNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' is not a valid DbDomainServiceDescriptionProviderAttribute parameter because it does not derive from DbContext.. + /// + public static string InvalidDbDomainServiceDescriptionProviderSpecification { + get { + return ResourceManager.GetString("InvalidDbDomainServiceDescriptionProviderSpecification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to get the MetadataWorkspace for the DbContext type '{0}'.. + /// + public static string MetadataWorkspaceNotFound { + get { + return ResourceManager.GetString("MetadataWorkspaceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ObjectStateManager not initialized for the DbContext type '{0}'.. + /// + public static string ObjectStateManagerNotFoundException { + get { + return ResourceManager.GetString("ObjectStateManagerNotFoundException", resourceCulture); + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.resx b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.resx new file mode 100644 index 000000000..c86f8d524 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The DbContext type '{0}' does not contain a default constructor. A default constructor is required to use EntityFramework in the Code-First mode with WCF RIA Services. + + + Type '{0}' is not a valid DbDomainServiceDescriptionProviderAttribute parameter because it does not derive from DbContext. + + + Failed to get the MetadataWorkspace for the DbContext type '{0}'. + + + ObjectStateManager not initialized for the DbContext type '{0}'. + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs new file mode 100644 index 000000000..1de701ead --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs @@ -0,0 +1,20 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. +// +// To add a suppression to this file, right-click the message in the +// Error List, point to "Suppress Message(s)", and click +// "In Project Suppression File". +// You do not need to add suppressions to this file manually. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "OpenRiaServices.EntityFramework.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "OpenRiaServices.EntityFramework.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFramework.DbDomainService`1.#CreateDbContext()", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFramework.DbDomainService`1.#DbContext", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFramework.DbDomainServiceDescriptionProviderAttribute.#DbContextType", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFramework.DbContextExtensions", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFramework.DbDomainService`1", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFramework.DbDomainServiceDescriptionProviderAttribute", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Assemblies are delay signed.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "OpenRiaServices.EntityFramework.AssociationInfo.#IsRequired", Justification = "Code shared with other projects.")] diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs new file mode 100644 index 000000000..be0948749 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs @@ -0,0 +1,304 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +#if DBCONTEXT +using System.Data.Entity; +using System.Data.Entity.Core; +using System.Data.Entity.Core.Objects; +using System.Data.Entity.Infrastructure; +#else +using System.Data; +using System.Data.Objects; +#endif +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// Base class for DomainServices operating on LINQ To Entities data models + /// + /// The Type of the LINQ To Entities ObjectContext + [LinqToEntitiesDomainServiceDescriptionProvider] + public abstract class LinqToEntitiesDomainService : DomainService where TContext : ObjectContext, new() + { + private TContext _objectContext; + private TContext _refreshContext; + + /// + /// Protected constructor because this is an abstract class + /// + protected LinqToEntitiesDomainService() + { + } + + /// + /// Gets the + /// + protected internal TContext ObjectContext + { + get + { + if (this._objectContext == null) + { + this._objectContext = this.CreateObjectContext(); + } + return this._objectContext; + } + } + + /// + /// Initializes this . must be called + /// prior to invoking any operations on the instance. + /// + /// The for this + /// instance. Overrides must call the base method. + public override void Initialize(DomainServiceContext context) + { + base.Initialize(context); + + // If we're going to process a query, we want to turn deferred loading + // off, since the framework will access association members marked + // with IncludeAttribute and we don't want to cause deferred loads. However, + // for other operation types, we don't want to interfere. + if (context.OperationType == DomainOperationType.Query) + { + this.ObjectContext.ContextOptions.LazyLoadingEnabled = false; + } + + // We turn this off, since our deserializer isn't going to create + // the EF proxy types anyways. Proxies only really work if the entities + // are queried on the server. + this.ObjectContext.ContextOptions.ProxyCreationEnabled = false; + } + + /// + /// Gets the used by retrieving store values + /// + private ObjectContext RefreshContext + { + get + { + if (this._refreshContext == null) + { + this._refreshContext = this.CreateObjectContext(); + } + return this._refreshContext; + } + } + + /// + /// Creates and returns the instance that will + /// be used by this provider. + /// + /// The ObjectContext + protected virtual TContext CreateObjectContext() + { + return new TContext(); + } + + /// + /// See . + /// + /// A indicating whether or not the instance is currently disposing. + protected override void Dispose(bool disposing) + { + if (disposing) + { + if (this._objectContext != null) + { + this._objectContext.Dispose(); + } + if (this._refreshContext != null) + { + this._refreshContext.Dispose(); + } + } + base.Dispose(disposing); + } + + /// + /// Gets the number of rows in an . + /// + /// The element Type of the query. + /// The query for which the count should be returned. + /// which may be used by hosting layer to request cancellation + /// The total number of rows. + protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) + { + return QueryHelper.CountAsync(query, cancellationToken); + } + + /// + /// Enumerates the specified enumerable to guarantee eager execution. + /// If possible code similar to ToListAsync is used, but with optimizations to start with a larger initial capacity + /// + /// The element type of the enumerable. + /// The enumerable to enumerate. + /// The estimated number of items the enumerable will yield. + /// which may be used by hosting layer to request cancellation + /// A new enumerable with the results of the enumerated enumerable. + protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) + { + // EF will throw if provider is not a IDbAsyncEnumerable + if (enumerable is IDbAsyncEnumerable asyncEnumerable) + { + return QueryHelper.EnumerateAsyncEnumerable(asyncEnumerable, estimatedResultCount, cancellationToken); + } + else + { + return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); + } + } + + /// + /// This method is called to finalize changes after all the operations in the specified changeset + /// have been invoked. All changes are committed to the ObjectContext, and any resulting optimistic + /// concurrency errors are processed. + /// + /// which may be used by hosting layer to request cancellation + /// True if the was persisted successfully, false otherwise. + protected override ValueTask PersistChangeSetAsync(CancellationToken cancellationToken) + { + return new ValueTask(this.InvokeSaveChangesAsync(true, cancellationToken)); + } + + private async Task InvokeSaveChangesAsync(bool retryOnConflict, CancellationToken cancellationToken) + { + try + { + await this.ObjectContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false); + } + catch (OptimisticConcurrencyException ex) + { + // Map the operations that could have caused a conflict to an entity. + Dictionary operationConflictMap = new Dictionary(); + foreach (ObjectStateEntry conflict in ex.StateEntries) + { + ChangeSetEntry entry = this.ChangeSet.ChangeSetEntries.SingleOrDefault(p => object.ReferenceEquals(p.Entity, conflict.Entity)); + if (entry == null) + { + // If we're unable to find the object in our changeset, propagate + // the original exception + throw; + } + operationConflictMap.Add(conflict, entry); + } + + this.SetChangeSetConflicts(operationConflictMap); + + // Call out to any user resolve code and resubmit if all conflicts + // were resolved + if (retryOnConflict && this.ResolveConflicts(ex.StateEntries)) + { + // clear the conflics from the entries + foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) + { + entry.StoreEntity = null; + entry.ConflictMembers = null; + entry.IsDeleteConflict = false; + } + + // If all conflicts were resolved attempt a resubmit + return await this.InvokeSaveChangesAsync(/* retryOnConflict */ false, cancellationToken).ConfigureAwait(false); + } + + // if the conflict wasn't resolved, call the error handler + this.OnError(new DomainServiceErrorInfo(ex)); + + // if there was a conflict but no conflict information was + // extracted to the individual entries, we need to ensure the + // error makes it back to the client + if (!this.ChangeSet.HasError) + { + throw; + } + + return false; + } + + return true; + } + + /// + /// This method is called to finalize changes after all the operations in the specified changeset + /// have been invoked. All changes are committed to the ObjectContext. + /// If the submit fails due to concurrency conflicts will be called. + /// If returns true a single resubmit will be attempted. + /// + /// + /// The list of concurrency conflicts that occurred + /// Returns true if the was persisted successfully, false otherwise. + protected virtual bool ResolveConflicts(IEnumerable conflicts) + { + return false; + } + + /// + /// Updates each entry in the ChangeSet with its corresponding conflict info. + /// + /// Map of conflicts to their corresponding operations entries. + private void SetChangeSetConflicts(Dictionary operationConflictMap) + { + object storeValue; + EntityKey refreshEntityKey; + + foreach (var conflictEntry in operationConflictMap) + { + ObjectStateEntry stateEntry = conflictEntry.Key; + + if (stateEntry.State == EntityState.Unchanged) + { + continue; + } + + // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. + ChangeSetEntry operationInConflict = conflictEntry.Value; + refreshEntityKey = this.RefreshContext.CreateEntityKey(stateEntry.EntitySet.Name, stateEntry.Entity); + this.RefreshContext.TryGetObjectByKey(refreshEntityKey, out storeValue); + operationInConflict.StoreEntity = storeValue; + + // StoreEntity will be null if the entity has been deleted in the store (i.e. Delete/Delete conflict) + bool isDeleted = (operationInConflict.StoreEntity == null); + if (isDeleted) + { + operationInConflict.IsDeleteConflict = true; + } + else + { + // Determine which members are in conflict by comparing original values to the current DB values + PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); + List membersInConflict = new List(); + object originalValue; + PropertyDescriptor pd; + for (int i = 0; i < stateEntry.OriginalValues.FieldCount; i++) + { + originalValue = stateEntry.OriginalValues.GetValue(i); + if (originalValue is DBNull) + { + originalValue = null; + } + + string propertyName = stateEntry.OriginalValues.GetName(i); + pd = propDescriptors[propertyName]; + if (pd == null) + { + // This might happen in the case of a private model + // member that isn't mapped + continue; + } + + if (!object.Equals(originalValue, pd.GetValue(operationInConflict.StoreEntity))) + { + membersInConflict.Add(pd.Name); + } + } + operationInConflict.ConflictMembers = membersInConflict; + } + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs new file mode 100644 index 000000000..68b3e4d2e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +#if DBCONTEXT +using System.Data.Entity.Core.Metadata.Edm; +#else +using System.Data.Metadata.Edm; +#endif +#if RIACONTRIB +using System.ServiceModel.DomainServices.Server; +#endif +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ + internal class LinqToEntitiesDomainServiceDescriptionProvider : DomainServiceDescriptionProvider + { + private static Dictionary tdpContextMap = new Dictionary(); + private readonly LinqToEntitiesTypeDescriptionContext _typeDescriptionContext; + private readonly Dictionary _descriptors = new Dictionary(); + + public LinqToEntitiesDomainServiceDescriptionProvider(Type domainServiceType, Type contextType, DomainServiceDescriptionProvider parent) + : base(domainServiceType, parent) + { + lock (tdpContextMap) + { + if (!tdpContextMap.TryGetValue(contextType, out this._typeDescriptionContext)) + { + // create and cache a context for this provider type + this._typeDescriptionContext = new LinqToEntitiesTypeDescriptionContext(contextType); + tdpContextMap.Add(contextType, this._typeDescriptionContext); + } + } + } + + /// + /// Returns a custom type descriptor for the specified type (either an entity or complex type). + /// + /// Type of object for which we need the descriptor + /// The parent type descriptor + /// Custom type description for the specified type + public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustomTypeDescriptor parent) + { + // No need to deal with concurrency... Worst case scenario we have multiple + // instances of this thing. + ICustomTypeDescriptor td = null; + if (!this._descriptors.TryGetValue(objectType, out td)) + { + // call into base so the TDs are chained + parent = base.GetTypeDescriptor(objectType, parent); + + StructuralType edmType = this._typeDescriptionContext.GetEdmType(objectType); + if (edmType != null && + (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || edmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) + { + // only add an LTE TypeDescriptor if the type is an EF Entity or ComplexType + td = new LinqToEntitiesTypeDescriptor(this._typeDescriptionContext, edmType, parent); + } + else + { + td = parent; + } + + this._descriptors[objectType] = td; + } + + return td; + } + + public override bool LookupIsEntityType(Type type) + { + StructuralType edmType = this._typeDescriptionContext.GetEdmType(type); + if (edmType != null && edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { + return true; + } + return false; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs new file mode 100644 index 000000000..04202c832 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs @@ -0,0 +1,104 @@ +using System; +using System.ComponentModel; +#if DBCONTEXT +using System.Data.Entity.Core.Objects; +#else +using System.Data.Objects; +#endif +using System.Globalization; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// Attribute applied to a that exposes LINQ to Entities mapped + /// Types. + /// + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] + public sealed class LinqToEntitiesDomainServiceDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute + { + private Type _objectContextType; + + /// + /// Default constructor. Using this constructor, the Type of the LINQ To Entities + /// ObjectContext will be inferred from the the + /// attribute is applied to. + /// + public LinqToEntitiesDomainServiceDescriptionProviderAttribute() + : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + { + } + + /// + /// Constructs an attribute for the specified LINQ To Entities + /// ObjectContext Type. + /// + /// The LINQ To Entities ObjectContext Type. + public LinqToEntitiesDomainServiceDescriptionProviderAttribute(Type objectContextType) + : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + { + this._objectContextType = objectContextType; + } + + /// + /// The Linq To Entities ObjectContext Type. + /// + public Type ObjectContextType + { + get + { + return this._objectContextType; + } + } + + /// + /// This method creates an instance of the . + /// + /// The Type to create a description provider for. + /// The existing parent description provider. + /// The description provider. + public override DomainServiceDescriptionProvider CreateProvider(Type domainServiceType, DomainServiceDescriptionProvider parent) + { + if (domainServiceType == null) + { + throw new ArgumentNullException(nameof(domainServiceType)); + } + + if (this._objectContextType == null) + { + this._objectContextType = GetContextType(domainServiceType); + } + + if (!typeof(ObjectContext).IsAssignableFrom(this._objectContextType)) + { + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, + Resource.InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification, + this._objectContextType)); + } + + return new LinqToEntitiesDomainServiceDescriptionProvider(domainServiceType, this._objectContextType, parent); + } + + /// + /// Extracts the context type from the specified . + /// + /// A LINQ to Entities domain service type. + /// The type of the object context. + private static Type GetContextType(Type domainServiceType) + { + Type efDomainServiceType = domainServiceType.BaseType; + while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(LinqToEntitiesDomainService<>)) + { + if (efDomainServiceType == typeof(object)) + { + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, + Resource.InvalidMetadataProviderSpecification, + typeof(LinqToEntitiesDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(LinqToEntitiesDomainService<>).Name)); + } + efDomainServiceType = efDomainServiceType.BaseType; + } + + return efDomainServiceType.GetGenericArguments()[0]; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs new file mode 100644 index 000000000..2b0e62a50 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Data.Mapping; +#if DBCONTEXT +using System.Data.Entity.Core.Metadata.Edm; +#else +using System.Data.Metadata.Edm; +#endif +using System.Globalization; +using System.Linq; +using System.Reflection; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// Metadata context for LINQ To Entities domain services + /// + internal class LinqToEntitiesTypeDescriptionContext : TypeDescriptionContextBase + { + private readonly Dictionary _associationMap = new Dictionary(); + private readonly Type _contextType; + private MetadataWorkspace _metadataWorkspace; + + /// + /// Constructor that accepts a LINQ To Entities context type + /// + /// The ObjectContext Type + public LinqToEntitiesTypeDescriptionContext(Type contextType) + { + if (contextType == null) + { + throw new ArgumentNullException(nameof(contextType)); + } + this._contextType = contextType; + } + + /// + /// Gets the MetadataWorkspace for the context + /// + public MetadataWorkspace MetadataWorkspace + { + get + { + if (this._metadataWorkspace == null) + { + // we only support embedded mappings + this._metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspace(this._contextType); + } + return this._metadataWorkspace; + } + } + + /// + /// Returns the that corresponds to the given CLR type + /// + /// The CLR type + /// The StructuralType that corresponds to the given CLR type + public StructuralType GetEdmType(Type clrType) + { + return ObjectContextUtilities.GetEdmType(this.MetadataWorkspace, clrType); + } + + /// + /// Returns the association information for the specified navigation property. + /// + /// The navigation property to return association information for + /// The association info + internal AssociationInfo GetAssociationInfo(NavigationProperty navigationProperty) + { + lock (this._associationMap) + { + string associationName = navigationProperty.RelationshipType.FullName; + AssociationInfo associationInfo = null; + if (!this._associationMap.TryGetValue(associationName, out associationInfo)) + { + AssociationType associationType = (AssociationType)navigationProperty.RelationshipType; + + if (!associationType.ReferentialConstraints.Any()) + { + // We only support EF models where FK info is part of the model. + throw new NotSupportedException( + string.Format(CultureInfo.CurrentCulture, + Resource.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); + } + + associationInfo = new AssociationInfo(); + associationInfo.FKRole = associationType.ReferentialConstraints[0].ToRole.Name; + associationInfo.Name = this.GetAssociationName(navigationProperty, associationInfo.FKRole); + associationInfo.ThisKey = associationType.ReferentialConstraints[0].ToProperties.Select(p => p.Name).ToArray(); + associationInfo.OtherKey = associationType.ReferentialConstraints[0].FromProperties.Select(p => p.Name).ToArray(); + associationInfo.IsRequired = associationType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.One; + + this._associationMap[associationName] = associationInfo; + } + + return associationInfo; + } + } + + /// + /// Creates an AssociationAttribute for the specified navigation property + /// + /// The navigation property that corresponds to the association (it identifies the end points) + /// A new AssociationAttribute that describes the given navigation property association + internal AssociationAttribute CreateAssociationAttribute(NavigationProperty navigationProperty) + { + AssociationInfo assocInfo = this.GetAssociationInfo(navigationProperty); + bool isForeignKey = navigationProperty.FromEndMember.Name == assocInfo.FKRole; + string thisKey; + string otherKey; + if (isForeignKey) + { + thisKey = FormatMemberList(assocInfo.ThisKey); + otherKey = FormatMemberList(assocInfo.OtherKey); + } + else + { + otherKey = FormatMemberList(assocInfo.ThisKey); + thisKey = FormatMemberList(assocInfo.OtherKey); + } + + AssociationAttribute assocAttrib = new AssociationAttribute(assocInfo.Name, thisKey, otherKey); + assocAttrib.IsForeignKey = isForeignKey; + return assocAttrib; + } + + /// + /// Returns a unique association name for the specified navigation property. + /// + /// The navigation property + /// The foreign key role name for the property's association + /// A unique association name for the specified navigation property. + private string GetAssociationName(NavigationProperty navigationProperty, string foreignKeyRoleName) + { + RelationshipEndMember fromMember = navigationProperty.FromEndMember; + RelationshipEndMember toMember = navigationProperty.ToEndMember; + + RefType toRefType = toMember.TypeUsage.EdmType as RefType; + EntityType toEntityType = toRefType.ElementType as EntityType; + + RefType fromRefType = fromMember.TypeUsage.EdmType as RefType; + EntityType fromEntityType = fromRefType.ElementType as EntityType; + + bool isForeignKey = navigationProperty.FromEndMember.Name == foreignKeyRoleName; + string fromTypeName = isForeignKey ? fromEntityType.Name : toEntityType.Name; + string toTypeName = isForeignKey ? toEntityType.Name : fromEntityType.Name; + + // names are always formatted non-FK side type name followed by FK side type name + string associationName = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", toTypeName, fromTypeName); + associationName = MakeUniqueName(associationName, this._associationMap.Values.Select(p => p.Name)); + + return associationName; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs new file mode 100644 index 000000000..9d601d23f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs @@ -0,0 +1,296 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +#if RIACONTRIB +using System.ServiceModel.DomainServices.Server; +#endif +using System.ComponentModel.DataAnnotations.Schema; +#if DBCONTEXT +using System.Data.Entity.Core.Metadata.Edm; +using System.Data.Entity.Core.Objects.DataClasses; +using System.Data.Entity; +#else +using System.Data; +using System.Data.Metadata.Edm; +using System.Data.Objects.DataClasses; +#endif + +using System.Linq; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// CustomTypeDescriptor for LINQ To Entities + /// + internal class LinqToEntitiesTypeDescriptor : TypeDescriptorBase + { + private readonly LinqToEntitiesTypeDescriptionContext _typeDescriptionContext; + private readonly StructuralType _edmType; + private readonly EdmMember _timestampMember; + private readonly HashSet _foreignKeyMembers; + private readonly bool _keyIsEditable; + + /// + /// Constructor taking a metadata context, an structural type, and a parent custom type descriptor + /// + /// The context. + /// The type (can be an entity or complex type). + /// The parent custom type descriptor. + public LinqToEntitiesTypeDescriptor(LinqToEntitiesTypeDescriptionContext typeDescriptionContext, StructuralType edmType, ICustomTypeDescriptor parent) + : base(parent) + { + this._typeDescriptionContext = typeDescriptionContext; + this._edmType = edmType; + + EdmMember[] timestampMembers = this._edmType.Members.Where(p => ObjectContextUtilities.IsConcurrencyTimestamp(p)).ToArray(); + if (timestampMembers.Length == 1) + { + this._timestampMember = timestampMembers[0]; + } + + if (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { + // if any FK member of any association is also part of the primary key, then the key cannot be marked + // Editable(false) + EntityType entityType = (EntityType)edmType; + this._foreignKeyMembers = new HashSet(entityType.NavigationProperties.SelectMany(p => p.GetDependentProperties())); + foreach (EdmProperty foreignKeyMember in this._foreignKeyMembers) + { + if (entityType.KeyMembers.Contains(foreignKeyMember)) + { + this._keyIsEditable = true; + break; + } + } + } + } + + /// + /// Gets the metadata context + /// + public LinqToEntitiesTypeDescriptionContext TypeDescriptionContext + { + get + { + return this._typeDescriptionContext; + } + } + + /// + /// Gets the Edm type + /// + private StructuralType EdmType + { + get + { + return this._edmType; + } + } + + /// + /// Returns a collection of all the s we infer from the metadata associated + /// with the metadata member corresponding to the given property descriptor + /// + /// A to examine + /// A collection of attributes inferred from the metadata in the given descriptor. + protected override IEnumerable GetMemberAttributes(PropertyDescriptor pd) + { + List attributes = new List(); + + // Exclude any EntityState, EntityReference, etc. members + if (ShouldExcludeEntityMember(pd)) + { + // for these members, we don't want to do any further + // attribute inference + attributes.Add(new ExcludeAttribute()); + return attributes.ToArray(); + } + + EditableAttribute editableAttribute = null; + bool inferRoundtripOriginalAttribute = false; + + bool hasKeyAttribute = (pd.Attributes[typeof(KeyAttribute)] != null); + bool isEntity = this.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + if (isEntity) + { + EntityType entityType = (EntityType)this.EdmType; + EdmMember keyMember = entityType.KeyMembers.SingleOrDefault(k => k.Name == pd.Name); + if (keyMember != null && !hasKeyAttribute) + { + attributes.Add(new KeyAttribute()); + hasKeyAttribute = true; + } + } + + EdmProperty member = this.EdmType.Members.SingleOrDefault(p => p.Name == pd.Name) as EdmProperty; + if (member != null) + { + if (hasKeyAttribute) + { + // key members must always be roundtripped + inferRoundtripOriginalAttribute = true; + + // key members that aren't also FK members are non-editable (but allow an initial value) + if (!this._keyIsEditable) + { + editableAttribute = new EditableAttribute(false) { AllowInitialValue = true }; + } + } + + // Check if the member is DB generated and add the DatabaseGeneratedAttribute to it if not already present. + bool databaseGenerated = false; + if (pd.Attributes[typeof(DatabaseGeneratedAttribute)] == null) + { + MetadataProperty md = ObjectContextUtilities.GetStoreGeneratedPattern(member); + if (md != null) + { + if ((string)md.Value == "Computed") + { + attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Computed)); + databaseGenerated = true; + } + else if ((string)md.Value == "Identity") + { + attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)); + databaseGenerated = true; + } + } + } + else + { + databaseGenerated = ((DatabaseGeneratedAttribute)pd.Attributes[typeof(DatabaseGeneratedAttribute)]).DatabaseGeneratedOption != DatabaseGeneratedOption.None; + } + + // Add implicit ConcurrencyCheck attribute to metadata if ConcurrencyMode is anything other than ConcurrencyMode.None + Facet facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "ConcurrencyMode"); + if (facet != null && facet.Value != null && (ConcurrencyMode)facet.Value != ConcurrencyMode.None && + pd.Attributes[typeof(ConcurrencyCheckAttribute)] == null) + { + attributes.Add(new ConcurrencyCheckAttribute()); + inferRoundtripOriginalAttribute = true; + } + + // Add Required attribute to metadata if the member cannot be null and it is either a reference type or a Nullable + // unless it is a database generated field + if (!member.Nullable && (!pd.PropertyType.IsValueType || IsNullableType(pd.PropertyType)) + && !databaseGenerated + && pd.Attributes[typeof(RequiredAttribute)] == null) + { + attributes.Add(new RequiredAttribute()); + } + + bool isStringType = pd.PropertyType == typeof(string) || pd.PropertyType == typeof(char[]); + if (isStringType && + pd.Attributes[typeof(StringLengthAttribute)] == null) + { + facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "MaxLength"); + if (facet != null && facet.Value != null && facet.Value.GetType() == typeof(int)) + { + // need to test for Type int, since the value can also be of type + // System.Data.Metadata.Edm.EdmConstants.Unbounded + int maxLength = (int)facet.Value; + attributes.Add(new StringLengthAttribute(maxLength)); + } + } + + bool hasTimestampAttribute = (pd.Attributes[typeof(TimestampAttribute)] != null); + + if (this._timestampMember == member && !hasTimestampAttribute) + { + attributes.Add(new TimestampAttribute()); + hasTimestampAttribute = true; + } + + // All members marked with TimestampAttribute (inferred or explicit) need to + // have [Editable(false)] and [RoundtripOriginal] applied + if (hasTimestampAttribute) + { + inferRoundtripOriginalAttribute = true; + + if (editableAttribute == null) + { + editableAttribute = new EditableAttribute(false); + } + } + + // Add RTO to this member if required. If this type has a timestamp + // member that member should be the ONLY member we apply RTO to. + // Dont apply RTO if it is an association member. + bool isForeignKeyMember = this._foreignKeyMembers != null && this._foreignKeyMembers.Contains(member); + if ((this._timestampMember == null || this._timestampMember == member) && + (inferRoundtripOriginalAttribute || isForeignKeyMember) && + pd.Attributes[typeof(AssociationAttribute)] == null) + { + if (pd.Attributes[typeof(RoundtripOriginalAttribute)] == null) + { + attributes.Add(new RoundtripOriginalAttribute()); + } + } + } + + // Add the Editable attribute if required + if (editableAttribute != null && pd.Attributes[typeof(EditableAttribute)] == null) + { + attributes.Add(editableAttribute); + } + + if (isEntity) + { + this.AddAssociationAttributes(pd, attributes); + } + + return attributes.ToArray(); + } + + /// + /// Determines whether the specified property is an Entity member that + /// should be excluded. + /// + /// The property to check. + /// True if the property should be excluded, false otherwise. + internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) + { + // exclude EntityState members + if (pd.PropertyType == typeof(EntityState) && + (pd.ComponentType == typeof(EntityObject) || typeof(IEntityChangeTracker).IsAssignableFrom(pd.ComponentType))) + { + return true; + } + + // exclude entity reference properties + if (typeof(EntityReference).IsAssignableFrom(pd.PropertyType)) + { + return true; + } + + return false; + } + + /// + /// Add AssociationAttribute if required for the specified property + /// + /// The property + /// The list of attributes to append to + private void AddAssociationAttributes(PropertyDescriptor pd, List attributes) + { + EntityType entityType = (EntityType)this.EdmType; + NavigationProperty navProperty = entityType.NavigationProperties.Where(n => n.Name == pd.Name).SingleOrDefault(); + if (navProperty != null) + { + bool isManyToMany = navProperty.RelationshipType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.Many && + navProperty.RelationshipType.RelationshipEndMembers[1].RelationshipMultiplicity == RelationshipMultiplicity.Many; + if (!isManyToMany) + { + AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(System.ComponentModel.DataAnnotations.AssociationAttribute)]; + if (assocAttrib == null) + { + assocAttrib = this.TypeDescriptionContext.CreateAssociationAttribute(navProperty); + attributes.Add(assocAttrib); + } + } + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs new file mode 100644 index 000000000..970e55a41 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs @@ -0,0 +1,71 @@ +using System; +using System.ComponentModel; + +namespace OpenRiaServices.Server +{ + internal class MetadataPropertyDescriptorWrapper : PropertyDescriptor + { + private readonly PropertyDescriptor _descriptor; + + public MetadataPropertyDescriptorWrapper(PropertyDescriptor descriptor, Attribute[] attrs) + : base(descriptor, attrs) + { + this._descriptor = descriptor; + } + + public override Type ComponentType + { + get { return this._descriptor.ComponentType; } + } + + public override bool IsReadOnly + { + get { return this._descriptor.IsReadOnly; } + } + + public override Type PropertyType + { + get { return this._descriptor.PropertyType; } + } + + public override bool SupportsChangeEvents + { + get { return this._descriptor.SupportsChangeEvents; } + } + + public override void AddValueChanged(object component, EventHandler handler) + { + this._descriptor.AddValueChanged(component, handler); + } + + public override bool CanResetValue(object component) + { + return this._descriptor.CanResetValue(component); + } + + public override object GetValue(object component) + { + return this._descriptor.GetValue(component); + } + + public override void RemoveValueChanged(object component, EventHandler handler) + { + this._descriptor.RemoveValueChanged(component, handler); + } + + public override void ResetValue(object component) + { + this._descriptor.ResetValue(component); + } + + public override void SetValue(object component, object value) + { + this._descriptor.SetValue(component, value); + } + + public override bool ShouldSerializeValue(object component) + { + return this._descriptor.ShouldSerializeValue(component); + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs new file mode 100644 index 000000000..b72fe9543 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace System.Data.Mapping { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class MetadataResource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal MetadataResource() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.MetadataResource", typeof(MetadataResource).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Unable to find metadata for '{0}'.. + /// + internal static string LinqToEntitiesProvider_UnableToRetrieveMetadata { + get { + return ResourceManager.GetString("LinqToEntitiesProvider_UnableToRetrieveMetadata", resourceCulture); + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx new file mode 100644 index 000000000..3aae8f7cf --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Unable to find metadata for '{0}'. + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs new file mode 100644 index 000000000..54c4d9b25 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs @@ -0,0 +1,241 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +#if DBCONTEXT +using System.Data.Entity.Core.Metadata.Edm; +using System.Data.Entity.Core.Objects; +using System.Data.Entity.Core.Mapping; +#else +using System.Data.Metadata.Edm; +using System.Data.Objects; +using System.Data.Mapping; +#endif +using System.Globalization; +using System.Linq; +using System.Reflection; +using OpenRiaServices; + +namespace System.Data.Mapping +{ + /// + /// EF metadata utilities class. + /// + internal static class MetadataWorkspaceUtilities + { + /// + /// Creates a metadata workspace for the specified context. + /// + /// The type of the object context. + /// The metadata workspace. + public static MetadataWorkspace CreateMetadataWorkspace(Type contextType) + { + MetadataWorkspace metadataWorkspace = null; +#if !DBCONTEXT + + metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(ObjectContext)); + +#else + metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(System.Data.Entity.DbContext)); + if (metadataWorkspace == null && typeof(System.Data.Entity.DbContext).IsAssignableFrom(contextType)) + { + if (contextType.GetConstructor(Type.EmptyTypes) == null) + { + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFramework.DbResource.DefaultCtorNotFound, contextType.FullName)); + } + + try + { + System.Data.Entity.DbContext dbContext = Activator.CreateInstance(contextType) as System.Data.Entity.DbContext; + ObjectContext objectContext = (dbContext as System.Data.Entity.Infrastructure.IObjectContextAdapter).ObjectContext; + metadataWorkspace = objectContext.MetadataWorkspace; + } + catch (Exception efException) + { + if (efException.IsFatal()) + { + throw; + } + + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFramework.DbResource.MetadataWorkspaceNotFound + ProcessException(efException), contextType.FullName), efException); + } + } +#endif + if (metadataWorkspace == null) + { + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, MetadataResource.LinqToEntitiesProvider_UnableToRetrieveMetadata, contextType.Name)); + } + else + { + return metadataWorkspace; + } + } + + static string ProcessException(Exception ex) + { + if (ex == null) + return string.Empty; + else + return " Exception: " + ex.Message + ProcessException(ex.InnerException); + } + /// + /// Creates the MetadataWorkspace for the given context type and base context type. + /// + /// The type of the context. + /// The base context type (DbContext or ObjectContext). + /// The generated + public static MetadataWorkspace CreateMetadataWorkspaceFromResources(Type contextType, Type baseContextType) + { + // get the set of embedded mapping resources for the target assembly and create + // a metadata workspace info for each group + IEnumerable metadataResourcePaths = FindMetadataResources(contextType.Assembly); + IEnumerable workspaceInfos = GetMetadataWorkspaceInfos(metadataResourcePaths); + + // Search for the correct EntityContainer by name and if found, create + // a comlete MetadataWorkspace and return it + foreach (var workspaceInfo in workspaceInfos) + { + EdmItemCollection edmItemCollection = new EdmItemCollection(workspaceInfo.Csdl); + + Type currentType = contextType; + while (currentType != baseContextType && currentType != typeof(object)) + { + EntityContainer container; + if (edmItemCollection.TryGetEntityContainer(currentType.Name, out container)) + { + StoreItemCollection store = new StoreItemCollection(workspaceInfo.Ssdl); +#if DBCONTEXT // This actually means EF6+ + MetadataWorkspace workspace = new MetadataWorkspace( + () => edmItemCollection, + () => store, + () => new StorageMappingItemCollection(edmItemCollection, store, workspaceInfo.Msl), + () => new ObjectItemCollection()); +#else // EF4 + StorageMappingItemCollection mapping = new StorageMappingItemCollection(edmItemCollection, store, workspaceInfo.Msl); + MetadataWorkspace workspace = new MetadataWorkspace(); + workspace.RegisterItemCollection(edmItemCollection); + workspace.RegisterItemCollection(store); + workspace.RegisterItemCollection(mapping); + workspace.RegisterItemCollection(new ObjectItemCollection()); +#endif + return workspace; + } + + currentType = currentType.BaseType; + } + } + return null; + } + + /// + /// Gets the specified resource paths as metadata workspace info objects. + /// + /// The metadata resource paths. + /// The metadata workspace info objects. + private static IEnumerable GetMetadataWorkspaceInfos(IEnumerable resourcePaths) + { + // for file paths, you would want to group without the path or the extension like Path.GetFileNameWithoutExtension, but resource names can contain + // forbidden path chars, so don't use it on resource names + foreach (var group in resourcePaths.GroupBy(p => p.Substring(0, p.LastIndexOf('.')), StringComparer.InvariantCultureIgnoreCase)) + { + yield return MetadataWorkspaceInfo.Create(group); + } + } + + /// + /// Find all the EF metadata resources. + /// + /// The assembly to find the metadata resources in. + /// The metadata paths that were found. + private static IEnumerable FindMetadataResources(Assembly assembly) + { + foreach (string name in assembly.GetManifestResourceNames()) + { + if (MetadataWorkspaceInfo.IsMetadata(name)) + { + yield return string.Format("res://{0}/{1}", assembly.FullName, name); + } + } + } + + /// + /// Represents the paths for a single metadata workspace. + /// + private class MetadataWorkspaceInfo + { + private const string CSDL_EXT = ".csdl"; + private const string MSL_EXT = ".msl"; + private const string SSDL_EXT = ".ssdl"; + + public string Csdl + { + get; + private set; + } + + public string Msl + { + get; + private set; + } + + public string Ssdl + { + get; + private set; + } + + public static MetadataWorkspaceInfo Create(IEnumerable paths) + { + string csdlPath = null; + string mslPath = null; + string ssdlPath = null; + foreach (string path in paths) + { + if (path.EndsWith(CSDL_EXT, StringComparison.OrdinalIgnoreCase)) + { + csdlPath = path; + } + else if (path.EndsWith(MSL_EXT, StringComparison.OrdinalIgnoreCase)) + { + mslPath = path; + } + else if (path.EndsWith(SSDL_EXT, StringComparison.OrdinalIgnoreCase)) + { + ssdlPath = path; + } + } + + return new MetadataWorkspaceInfo(csdlPath, mslPath, ssdlPath); + } + + public static bool IsMetadata(string path) + { + return path.EndsWith(CSDL_EXT, StringComparison.OrdinalIgnoreCase) || + path.EndsWith(MSL_EXT, StringComparison.OrdinalIgnoreCase) || + path.EndsWith(SSDL_EXT, StringComparison.OrdinalIgnoreCase); + } + + + public MetadataWorkspaceInfo(string csdlPath, string mslPath, string ssdlPath) + { + if (csdlPath == null) + { + throw new ArgumentNullException(nameof(csdlPath)); + } + + if (mslPath == null) + { + throw new ArgumentNullException(nameof(mslPath)); + } + + if (ssdlPath == null) + { + throw new ArgumentNullException(nameof(ssdlPath)); + } + + this.Csdl = csdlPath; + this.Msl = mslPath; + this.Ssdl = ssdlPath; + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs new file mode 100644 index 000000000..e9ac41077 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs @@ -0,0 +1,91 @@ +using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Data; +using System.Data.Entity; +using System.Data.Entity.Core.Objects; + +namespace OpenRiaServices.EntityFramework +{ + /// + /// ObjectContext extension methods useful to LinqToEntitiesDomainService authors + /// + public static class ObjectContextExtensions + { + /// + /// Extension method used to attach the specified entity as modified, + /// with the specified original state. + /// + /// The entity Type + /// The ObjectSet to attach to + /// The current entity state + /// The original entity state + public static void AttachAsModified(this ObjectSet objectSet, T current, T original) where T : class + { + if (objectSet == null) + { + throw new ArgumentNullException(nameof(objectSet)); + } + if (current == null) + { + throw new ArgumentNullException(nameof(current)); + } + if (original == null) + { + throw new ArgumentNullException(nameof(original)); + } + + // Attach the entity if it is not already attached, or if it is already + // attached, transition to Modified + EntityState currState = ObjectContextUtilities.GetEntityState(objectSet.Context, current); + if (currState == EntityState.Detached) + { + objectSet.Attach(current); + } + else + { + objectSet.Context.ObjectStateManager.ChangeObjectState(current, EntityState.Modified); + } + + ObjectStateEntry stateEntry = ObjectContextUtilities.AttachAsModifiedInternal(current, original, objectSet.Context); + + if (stateEntry.State != EntityState.Modified) + { + // Ensure that when we leave this method, the entity is in a + // Modified state. For example, if current and original are the + // same, we still need to force the state transition + objectSet.Context.ObjectStateManager.ChangeObjectState(current, EntityState.Modified); + } + } + + /// + /// Extension method used to attach the specified entity as modified. This overload + /// can be used in cases where the entity has a Timestamp member. + /// + /// The entity Type + /// The ObjectSet to attach to + /// The current entity state + public static void AttachAsModified(this ObjectSet objectSet, T entity) where T : class + { + if (objectSet == null) + { + throw new ArgumentNullException(nameof(objectSet)); + } + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + ObjectContext context = objectSet.Context; + EntityState currState = ObjectContextUtilities.GetEntityState(context, entity); + if (currState == EntityState.Detached) + { + // attach the entity + objectSet.Attach(entity); + } + + // transition the entity to the modified state + context.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified); + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs new file mode 100644 index 000000000..f14fc45d8 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs @@ -0,0 +1,196 @@ +using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +#if RIACONTRIB +using System.ServiceModel.DomainServices.Server; +#endif +using System.Data.Entity; +#if DBCONTEXT +using System.Data.Entity.Core.Metadata.Edm; +using System.Data.Entity.Core.Objects.DataClasses; +using System.Data.Entity.Core.Objects; +#else +using System.Data; +using System.Data.Metadata.Edm; +using System.Data.Objects; +using System.Data.Objects.DataClasses; +#endif +using System.Linq; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFramework +{ +#if DBCONTEXT + using ConcurrencyMode = System.Data.Entity.Core.Metadata.Edm.ConcurrencyMode; +#else +using ConcurrencyMode = System.Data.Metadata.Edm.ConcurrencyMode; +#endif + + + /// + /// Internal utility functions for dealing with EF types and metadata + /// + internal static class ObjectContextUtilities + { + /// + /// Retrieves the corresponding to the given CLR type (where the + /// type is an entity or complex type). + /// + /// + /// If no mapping exists for , but one does exist for one of its base + /// types, we will return the mapping for the base type. + /// + /// The + /// The CLR type + /// The corresponding to that CLR type, or null if the Type + /// is not mapped. + public static StructuralType GetEdmType(MetadataWorkspace workspace, Type clrType) + { + if (workspace == null) + { + throw new ArgumentNullException(nameof(workspace)); + } + if (clrType == null) + { + throw new ArgumentNullException(nameof(clrType)); + } + + if (clrType.IsPrimitive || clrType == typeof(object)) + { + // want to avoid loading searching system assemblies for + // types we know aren't entity or complex types + return null; + } + + // We first locate the EdmType in "OSpace", which matches the name and namespace of the CLR type + EdmType edmType = null; + do + { + if (!workspace.TryGetType(clrType.Name, clrType.Namespace, DataSpace.OSpace, out edmType)) + { + // If EF could not find this type, it could be because it is not loaded into + // its current workspace. In this case, we explicitly load the assembly containing + // the CLR type and try again. + workspace.LoadFromAssembly(clrType.Assembly); + workspace.TryGetType(clrType.Name, clrType.Namespace, DataSpace.OSpace, out edmType); + } + } + while (edmType == null && (clrType = clrType.BaseType) != typeof(object) && clrType != null); + + // Next we locate the StructuralType from the EdmType. + // This 2-step process is necessary when the types CLR namespace does not match Edm namespace. + // Look at the EdmEntityTypeAttribute on the generated entity classes to see this Edm namespace. + StructuralType structuralType = null; + if (edmType != null && + (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || edmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) + { + workspace.TryGetEdmSpaceType((StructuralType)edmType, out structuralType); + } + + return structuralType; + } + + + /// + /// Method used to return the current of the specified + /// entity. + /// + /// The + /// The entity to return the for + /// The current of the specified entity + public static EntityState GetEntityState(ObjectContext context, object entity) + { + if (context == null) + { + throw new ArgumentNullException(nameof(context)); + } + if (entity == null) + { + throw new ArgumentNullException(nameof(entity)); + } + + ObjectStateEntry stateEntry = null; + if (!context.ObjectStateManager.TryGetObjectStateEntry(entity, out stateEntry)) + { + return EntityState.Detached; + } + return stateEntry.State; + } + + + /// + /// Determines if the specified EdmMember is a concurrency timestamp. + /// + /// Since EF doesn't expose "timestamp" as a first class + /// concept, we use the below criteria to infer this for ourselves. + /// + /// The member to check. + /// True or false. + public static bool IsConcurrencyTimestamp(EdmMember member) + { + Facet facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "ConcurrencyMode"); + if (facet == null || facet.Value == null || (ConcurrencyMode)facet.Value != ConcurrencyMode.Fixed) + { + return false; + } + + facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "FixedLength"); + if (facet == null || facet.Value == null || !((bool)facet.Value)) + { + return false; + } + + facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "MaxLength"); + if (facet == null || facet.Value == null || (int)facet.Value != 8) + { + return false; + } + + MetadataProperty md = ObjectContextUtilities.GetStoreGeneratedPattern(member); + if (md == null || facet.Value == null || (string)md.Value != "Computed") + { + return false; + } + + return true; + } + + /// + /// Gets the property value from the edm member. + /// + /// The EdmMember from which to get the StoreGeneratedPattern value. + /// The value. + public static MetadataProperty GetStoreGeneratedPattern(EdmMember member) + { + MetadataProperty md; + member.MetadataProperties.TryGetValue("http://schemas.microsoft.com/ado/2009/02/edm/annotation:StoreGeneratedPattern", /* ignoreCase */ true, out md); + return md; + } + + public static ObjectStateEntry AttachAsModifiedInternal(object current, object original, ObjectContext objectContext) + { + ObjectStateEntry stateEntry = objectContext.ObjectStateManager.GetObjectStateEntry(current); + stateEntry.ApplyOriginalValues(original); + + // For any members that don't have RoundtripOriginal applied, EF can't determine modification + // state by doing value comparisons. To avoid losing updates in these cases, we must explicitly + // mark such members as modified. + Type entityType = current.GetType(); + PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType); + AttributeCollection attributes = TypeDescriptor.GetAttributes(entityType); + bool isRoundtripType = attributes[typeof(RoundtripOriginalAttribute)] != null; + foreach (var fieldMetadata in stateEntry.CurrentValues.DataRecordInfo.FieldMetadata) + { + string memberName = stateEntry.CurrentValues.GetName(fieldMetadata.Ordinal); + PropertyDescriptor property = properties[memberName]; + if (property != null && + (property.Attributes[typeof(RoundtripOriginalAttribute)] == null && !isRoundtripType) && + property.Attributes[typeof(ExcludeAttribute)] == null) + { + stateEntry.SetModifiedProperty(memberName); + } + } + return stateEntry; + } + } +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj new file mode 100644 index 000000000..67279cef4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -0,0 +1,47 @@ + + + net472 + $(DefineConstants);SERVERFX;DBCONTEXT;net472; + + + + + + + + + + + + + True + True + DbResource.resx + + + MetadataResource.resx + True + True + + + Resource.resx + True + True + + + + + + + + PublicResXFileCodeGenerator + DbResource.Designer.cs + Designer + + + ResXFileCodeGenerator + MetadataResource.Designer.cs + System.Data.Mapping + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..d337eb49b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyCulture("")] +[assembly: InternalsVisibleTo("OpenRiaServices.Common.DomainServices.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001006165f2d838c2494ed8ed9644fbc060f22fea4941d552916f6ca7078f64b7d5a6053ff36e63eb312fa909ae4223e8393d20eed67217e46747cebb6fa5b348738c5785568d642b0bf499f7863829242e655372773636d6c974d2d5abd97c57640893f7dd390cfd1015268ee85611f51c71068e8a15a829a97ea9dad46d1619b3b0")] +[assembly: InternalsVisibleTo("OpenRiaServices.Server.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001006165f2d838c2494ed8ed9644fbc060f22fea4941d552916f6ca7078f64b7d5a6053ff36e63eb312fa909ae4223e8393d20eed67217e46747cebb6fa5b348738c5785568d642b0bf499f7863829242e655372773636d6c974d2d5abd97c57640893f7dd390cfd1015268ee85611f51c71068e8a15a829a97ea9dad46d1619b3b0")] +[assembly: InternalsVisibleTo("OpenRiaServices.Tools.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001006165f2d838c2494ed8ed9644fbc060f22fea4941d552916f6ca7078f64b7d5a6053ff36e63eb312fa909ae4223e8393d20eed67217e46747cebb6fa5b348738c5785568d642b0bf499f7863829242e655372773636d6c974d2d5abd97c57640893f7dd390cfd1015268ee85611f51c71068e8a15a829a97ea9dad46d1619b3b0")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4291e253-9e86-4a66-a9a4-8e09139f86c9")] + +[assembly: CLSCompliant(true)] +[assembly: NeutralResourcesLanguageAttribute("en-US")] + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs new file mode 100644 index 000000000..e00c13413 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace OpenRiaServices.EntityFramework +{ + static class QueryHelper + { + public static ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) + { + // EF will throw if provider is not a IDbAsyncQueryProvider + if (query.Provider is IDbAsyncQueryProvider) + return new ValueTask(query.CountAsync(cancellationToken)); + else + return new ValueTask(query.Count()); + } + + public static async ValueTask> EnumerateAsyncEnumerable(IDbAsyncEnumerable asyncEnumerable, int estimatedResultCount, CancellationToken cancellationToken) + { + using (var enumerator = asyncEnumerable.GetAsyncEnumerator()) + { + List result = new List(capacity: estimatedResultCount); + while (await enumerator.MoveNextAsync(cancellationToken).ConfigureAwait(false)) + { + result.Add(enumerator.Current); + } + + return result; + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs new file mode 100644 index 000000000..59c36df61 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OpenRiaServices.EntityFramework { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resource { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resource() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.Resource", typeof(Resource).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to DatabaseGeneratedOption value '{0}' is not defined.. + /// + internal static string DatabaseGeneratedOptionNotDefined { + get { + return ResourceManager.GetString("DatabaseGeneratedOptionNotDefined", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type '{0}' is not a valid LinqToEntitiesDomainServiceDescriptionProviderAttribute parameter because it does not derive from ObjectContext.. + /// + internal static string InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification { + get { + return ResourceManager.GetString("InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' cannot be applied to DomainService Type '{1}' because '{1}' does not derive from '{2}'.. + /// + internal static string InvalidMetadataProviderSpecification { + get { + return ResourceManager.GetString("InvalidMetadataProviderSpecification", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to retrieve association information for association '{0}'. Only models that include foreign key information are supported. See Entity Framework documentation for details on creating models that include foreign key information.. + /// + internal static string LinqToEntitiesProvider_UnableToRetrieveAssociationInfo { + get { + return ResourceManager.GetString("LinqToEntitiesProvider_UnableToRetrieveAssociationInfo", resourceCulture); + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx new file mode 100644 index 000000000..e2edb1887 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + DatabaseGeneratedOption value '{0}' is not defined. + + + Type '{0}' is not a valid LinqToEntitiesDomainServiceDescriptionProviderAttribute parameter because it does not derive from ObjectContext. + + + '{0}' cannot be applied to DomainService Type '{1}' because '{1}' does not derive from '{2}'. + + + Unable to retrieve association information for association '{0}'. Only models that include foreign key information are supported. See Entity Framework documentation for details on creating models that include foreign key information. + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs new file mode 100644 index 000000000..b0488d606 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs @@ -0,0 +1,50 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Linq; + +namespace OpenRiaServices.Server +{ + /// + /// Base class for LTS and EF type description contexts + /// + internal abstract class TypeDescriptionContextBase + { + /// + /// Given a suggested name and a collection of existing names, this method + /// creates a unique name by appending a numerix suffix as required. + /// + /// The desired name + /// Collection of existing names + /// The unique name + protected static string MakeUniqueName(string suggested, IEnumerable existing) + { + int i = 1; + string currSuggestion = suggested; + while (existing.Contains(currSuggestion)) + { + currSuggestion = suggested + (i++).ToString(CultureInfo.InvariantCulture); + } + + return currSuggestion; + } + + /// + /// Comma delimits the specified member name collection + /// + /// A collection of members. + /// A comma delimited list of member names. + protected static string FormatMemberList(IEnumerable members) + { + string memberList = string.Empty; + foreach (string name in members) + { + if (memberList.Length > 0) + { + memberList += ","; + } + memberList += name; + } + return memberList; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs new file mode 100644 index 000000000..0990fbae1 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; + +namespace OpenRiaServices.Server +{ + /// + /// CustomTypeDescriptor base type shared by LINQ To SQL and LINQ To Entities + /// + internal abstract class TypeDescriptorBase : CustomTypeDescriptor + { + private PropertyDescriptorCollection _properties; + + /// + /// Main constructor that accepts the parent custom type descriptor + /// + /// The parent custom type descriptor. + public TypeDescriptorBase(ICustomTypeDescriptor parent) + : base(parent) + { + } + + /// + /// Override of the to obtain the list + /// of properties for this type. + /// + /// + /// This method is overridden so that it can merge this class's parent attributes with those + /// it infers from the DAL-specific attributes. + /// + /// A list of properties for this type + public sealed override PropertyDescriptorCollection GetProperties() + { + // No need to lock anything... Worst case scenario we create the properties multiple times. + if (this._properties == null) + { + // Get properties from our parent + PropertyDescriptorCollection originalCollection = base.GetProperties(); + + bool customDescriptorsCreated = false; + List tempPropertyDescriptors = new List(); + + // for every property exposed by our parent, see if we have additional metadata to add + foreach (PropertyDescriptor propDescriptor in originalCollection) + { + Attribute[] newMetadata = this.GetMemberAttributes(propDescriptor).ToArray(); + if (newMetadata.Length > 0) + { + tempPropertyDescriptors.Add(new MetadataPropertyDescriptorWrapper(propDescriptor, newMetadata)); + customDescriptorsCreated = true; + } + else + { + tempPropertyDescriptors.Add(propDescriptor); + } + } + + if (customDescriptorsCreated) + { + this._properties = new PropertyDescriptorCollection(tempPropertyDescriptors.ToArray(), true); + } + else + { + this._properties = originalCollection; + } + } + + return this._properties; + } + + /// + /// Abstract method specific DAL implementations must override to return the + /// list of RIA s implied by their DAL-specific attributes + /// + /// A to examine. + /// A list of RIA attributes implied by the DAL specific attributes + protected abstract IEnumerable GetMemberAttributes(PropertyDescriptor pd); + + /// + /// Returns true if the given type is a + /// + /// The type to test + /// true if the given type is a nullable type + public static bool IsNullableType(Type type) + { + return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config new file mode 100644 index 000000000..ba200051a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config @@ -0,0 +1,13 @@ + + + + +
+ + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs new file mode 100644 index 000000000..e981a6c45 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs @@ -0,0 +1,24 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + + public partial class Category + { + public Category() + { + this.Products = new HashSet(); + } + + [ConcurrencyCheck] + public int CategoryID { get; set; } + [Required] + [StringLength(15)] + public string CategoryName { get; set; } + public string Description { get; set; } + public byte[] Picture { get; set; } + + public virtual ICollection Products { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs new file mode 100644 index 000000000..47d6cf2c1 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs @@ -0,0 +1,52 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + + public partial class Customer + { + public Customer() + { + this.Orders = new HashSet(); + this.CustomerDemographics = new HashSet(); + } + + [StringLength(15)] + [ConcurrencyCheck] + public string CustomerID { get; set; } + [StringLength(40)] + [ConcurrencyCheck] + public string CompanyName { get; set; } + [StringLength(30)] + [ConcurrencyCheck] + public string ContactName { get; set; } + [StringLength(30)] + [ConcurrencyCheck] + public string ContactTitle { get; set; } + [StringLength(60)] + [ConcurrencyCheck] + public string Address { get; set; } + [StringLength(15)] + [ConcurrencyCheck] + public string City { get; set; } + [StringLength(15)] + [ConcurrencyCheck] + public string Region { get; set; } + [StringLength(10)] + [ConcurrencyCheck] + public string PostalCode { get; set; } + [StringLength(15)] + [ConcurrencyCheck] + public string Country { get; set; } + [StringLength(24)] + [ConcurrencyCheck] + public string Phone { get; set; } + [StringLength(24)] + [ConcurrencyCheck] + public string Fax { get; set; } + + public virtual ICollection Orders { get; set; } + public virtual ICollection CustomerDemographics { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs new file mode 100644 index 000000000..49043bd51 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs @@ -0,0 +1,20 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + + public partial class CustomerDemographic + { + public CustomerDemographic() + { + this.Customers = new HashSet(); + } + + [Key] + public string CustomerTypeID { get; set; } + public string CustomerDesc { get; set; } + + public virtual ICollection Customers { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs new file mode 100644 index 000000000..e10bd2cb6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs @@ -0,0 +1,63 @@ +using System.ComponentModel.DataAnnotations.Schema; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +using System.Runtime.Serialization; + +// These assembly attributes allow us to serialize different CLR types into the same contract +[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", + ClrNamespace = "CodeFirstModels")] + +namespace CodeFirstModels +{ + public partial class EFCFNorthwindEntities : DbContext + { + public EFCFNorthwindEntities() + : base("name=Northwind") + { + + } + + public EFCFNorthwindEntities(string connection) + : base(connection) + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.Entity() + .HasMany(c => c.Orders) + .WithOptional(c => c.Shipper) + .HasForeignKey(c => c.ShipVia); + modelBuilder.Entity().ToTable("Order Details"); + modelBuilder.Entity().ToTable("Region"); + + modelBuilder.Entity().HasMany(t => t.Employees) + .WithMany(e => e.Territories) + .Map(m => + { + m.ToTable("EmployeeTerritories"); + m.MapLeftKey("TerritoryID"); + m.MapRightKey("EmployeeID"); + }); + + modelBuilder.Entity().HasKey(r => r.RegionID) + .Property(r => r.RegionID) + .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None); + + } + + public DbSet Categories { get; set; } + public DbSet CustomerDemographics { get; set; } + public DbSet Customers { get; set; } + public DbSet Employees { get; set; } + public DbSet Order_Details { get; set; } + public DbSet Orders { get; set; } + public DbSet Products { get; set; } + public DbSet Regions { get; set; } + public DbSet Shippers { get; set; } + public DbSet Suppliers { get; set; } + public DbSet Territories { get; set; } + } +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj new file mode 100644 index 000000000..b7a6bb672 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj @@ -0,0 +1,27 @@ + + + 618 + CodeFirstModels + CodeFirstModels + net472 + $(DefineConstants);DBCONTEXT + 1.0.0.0 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs new file mode 100644 index 000000000..eab446cad --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs @@ -0,0 +1,45 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + + public partial class Employee + { + public Employee() + { + this.Employees1 = new HashSet(); + this.Orders = new HashSet(); + this.Territories = new HashSet(); + } + + [Key] + [Column("EmployeeID")] + public int EmployeeID { get; set; } + public string LastName { get; set; } + public string FirstName { get; set; } + public string Title { get; set; } + public string TitleOfCourtesy { get; set; } + public Nullable BirthDate { get; set; } + public Nullable HireDate { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string HomePhone { get; set; } + public string Extension { get; set; } + public byte[] Photo { get; set; } + public string Notes { get; set; } + [ForeignKey("Employees1")] + public Nullable ReportsTo { get; set; } + public string PhotoPath { get; set; } + + public virtual ICollection Employees1 { get; set; } + public virtual Employee Employee1 { get; set; } + + public virtual ICollection Orders { get; set; } + public virtual ICollection Territories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs new file mode 100644 index 000000000..a24677d06 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs @@ -0,0 +1,69 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Runtime.Serialization; + using OpenRiaServices.Server; + + public partial class Order + { + public Order() + { + this.Order_Details = new HashSet(); + } + + [ConcurrencyCheck] + public int OrderID { get; set; } + [StringLength(5)] + [ConcurrencyCheck] + public string CustomerID { get; set; } + [ConcurrencyCheck] + public Nullable EmployeeID { get; set; } + [ConcurrencyCheck] + public Nullable OrderDate { get; set; } + [ConcurrencyCheck] + public Nullable RequiredDate { get; set; } + [ConcurrencyCheck] + public Nullable ShippedDate { get; set; } + [ConcurrencyCheck] + public Nullable ShipVia { get; set; } + [ConcurrencyCheck] + public Nullable Freight { get; set; } + [StringLength(40)] + [ConcurrencyCheck] + public string ShipName { get; set; } + [StringLength(60)] + [ConcurrencyCheck] + public string ShipAddress { get; set; } + [StringLength(15)] + [ConcurrencyCheck] + public string ShipCity { get; set; } + [StringLength(15)] + [ConcurrencyCheck] + public string ShipRegion { get; set; } + [StringLength(10)] + [ConcurrencyCheck] + public string ShipPostalCode { get; set; } + [StringLength(15)] + [ConcurrencyCheck] + public string ShipCountry { get; set; } + + public virtual Customer Customer { get; set; } + public virtual Employee Employee { get; set; } + [Include] + public virtual ICollection Order_Details { get; set; } + public virtual Shipper Shipper { get; set; } + + // Calculated property. Used to test that user-defined properties work properly. + [NotMapped] + public string FormattedName + { + get + { + return "OrderID: " + this.OrderID.ToString(); + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs new file mode 100644 index 000000000..72d35f454 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs @@ -0,0 +1,33 @@ + + +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using OpenRiaServices.Server; + using System.ComponentModel.DataAnnotations.Schema; + public partial class Order_Detail + { + [Key] + [Column(Order=0)] + [ConcurrencyCheck] + public int OrderID { get; set; } + [Key] + [Column(Order = 1)] + [ConcurrencyCheck] + public int ProductID { get; set; } + [ConcurrencyCheck] + public decimal UnitPrice { get; set; } + [ConcurrencyCheck] + public short Quantity { get; set; } + [ConcurrencyCheck] + public float Discount { get; set; } + + [ForeignKey("OrderID")] + public virtual Order Order { get; set; } + [Include] + [ForeignKey("ProductID")] + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs new file mode 100644 index 000000000..04dcd9db0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs @@ -0,0 +1,65 @@ + + +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using System.ComponentModel.DataAnnotations.Schema; + using System.Runtime.Serialization; + using OpenRiaServices.Server; + + public partial class Product + { + public Product() + { + this.Order_Details = new HashSet(); + } + + public int ProductID { get; set; } + [Required] + [StringLength(40)] + [ConcurrencyCheck] + public string ProductName { get; set; } + [ConcurrencyCheck] + public Nullable SupplierID { get; set; } + [ConcurrencyCheck] + public Nullable CategoryID { get; set; } + [StringLength(20)] + [ConcurrencyCheck] + public string QuantityPerUnit { get; set; } + [ConcurrencyCheck] + public Nullable UnitPrice { get; set; } + [ConcurrencyCheck] + public Nullable UnitsInStock { get; set; } + [ConcurrencyCheck] + public Nullable UnitsOnOrder { get; set; } + [ConcurrencyCheck] + public Nullable ReorderLevel { get; set; } + [ConcurrencyCheck] + public bool Discontinued { get; set; } + + [Include("CategoryName", "CategoryName")] + public virtual Category Category { get; set; } + + public virtual ICollection Order_Details { get; set; } + + [Include("CompanyName", "SupplierName")] + public virtual Supplier Supplier { get; set; } + + private string _resolveMethod = String.Empty; + [DataMember] + [NotMapped] + public string ResolveMethod + { + get + { + return _resolveMethod; + } + set + { + _resolveMethod = value; + } + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs new file mode 100644 index 000000000..447677bd5 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel.DataAnnotations; + +namespace CodeFirstModels +{ + public class ProductInfo + { + public static ProductInfo CreateProductInfo(int productID, string productName, string categoryName, string supplierName) + { + ProductInfo prodInfo = new ProductInfo(); + prodInfo.ProductID = productID; + prodInfo.ProductName = productName; + prodInfo.CategoryName = categoryName; + prodInfo.SupplierName = supplierName; + return prodInfo; + } + + [Key] + public int ProductID + { + get; + set; + } + + public string ProductName + { + get; + set; + } + + [Editable(false)] + public string CategoryName + { + get; + set; + } + + [Editable(false)] + public string SupplierName + { + get; + set; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..16eb2068a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs @@ -0,0 +1,13 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; + +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM componenets. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a122da4b-cec9-4958-a0aa-ebf197bc5cfd")] diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs new file mode 100644 index 000000000..6583f12fa --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs @@ -0,0 +1,22 @@ +namespace CodeFirstModels +{ + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + using OpenRiaServices.Server; + + public partial class Region + { + public Region() + { + this.Territories = new HashSet(); + } + + public int RegionID { get; set; } + [StringLength(50)] + public string RegionDescription { get; set; } + + [Composition] + [Include] + public virtual ICollection Territories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs new file mode 100644 index 000000000..5d87c110b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs @@ -0,0 +1,19 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + + public partial class Shipper + { + public Shipper() + { + this.Orders = new HashSet(); + } + + public int ShipperID { get; set; } + public string CompanyName { get; set; } + public string Phone { get; set; } + + public virtual ICollection Orders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs new file mode 100644 index 000000000..124899a01 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs @@ -0,0 +1,28 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + + public partial class Supplier + { + public Supplier() + { + this.Products = new HashSet(); + } + + public int SupplierID { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string ContactTitle { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Phone { get; set; } + public string Fax { get; set; } + public string HomePage { get; set; } + + public virtual ICollection Products { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs new file mode 100644 index 000000000..5ab81d8e9 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs @@ -0,0 +1,23 @@ +namespace CodeFirstModels +{ + using System; + using System.Collections.Generic; + using System.ComponentModel.DataAnnotations; + + public partial class Territory + { + public Territory() + { + this.Employees = new HashSet(); + } + + [StringLength(20)] + public string TerritoryID { get; set; } + [StringLength(50)] + public string TerritoryDescription { get; set; } + public int RegionID { get; set; } + + public virtual Region Region { get; set; } + public virtual ICollection Employees { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs new file mode 100644 index 000000000..0c909f134 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class AWBuildVersion + { + public byte SystemInformationID { get; set; } + public string Database_Version { get; set; } + public System.DateTime VersionDate { get; set; } + public System.DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs new file mode 100644 index 000000000..8c14788a0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Address + { + public Address() + { + this.EmployeeAddresses = new HashSet(); + this.CustomerAddresses = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + this.SalesOrderHeaders1 = new HashSet(); + this.VendorAddresses = new HashSet(); + } + + public int AddressID { get; set; } + public string AddressLine1 { get; set; } + public string AddressLine2 { get; set; } + public string City { get; set; } + public int StateProvinceID { get; set; } + public string PostalCode { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection EmployeeAddresses { get; set; } + public virtual StateProvince StateProvince { get; set; } + public virtual ICollection CustomerAddresses { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual ICollection SalesOrderHeaders1 { get; set; } + public virtual ICollection VendorAddresses { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs new file mode 100644 index 000000000..0253e8ccc --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class AddressType + { + public AddressType() + { + this.CustomerAddresses = new HashSet(); + this.VendorAddresses = new HashSet(); + } + + public int AddressTypeID { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection CustomerAddresses { get; set; } + public virtual ICollection VendorAddresses { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs new file mode 100644 index 000000000..cb997d479 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs @@ -0,0 +1,100 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Infrastructure; + + public partial class DbCtxAdventureWorksEntities : DbContext + { + public DbCtxAdventureWorksEntities() + : base("name=DbCtxAdventureWorksEntities") + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + + public DbSet AWBuildVersions { get; set; } + public DbSet DatabaseLogs { get; set; } + public DbSet ErrorLogs { get; set; } + public DbSet sysdiagrams { get; set; } + public DbSet Departments { get; set; } + public DbSet Employees { get; set; } + public DbSet EmployeeAddresses { get; set; } + public DbSet EmployeeDepartmentHistories { get; set; } + public DbSet EmployeePayHistories { get; set; } + public DbSet JobCandidates { get; set; } + public DbSet Shifts { get; set; } + public DbSet
Addresses { get; set; } + public DbSet AddressTypes { get; set; } + public DbSet Contacts { get; set; } + public DbSet ContactTypes { get; set; } + public DbSet CountryRegions { get; set; } + public DbSet StateProvinces { get; set; } + public DbSet BillOfMaterials { get; set; } + public DbSet Cultures { get; set; } + public DbSet Documents { get; set; } + public DbSet Illustrations { get; set; } + public DbSet Locations { get; set; } + public DbSet Products { get; set; } + public DbSet ProductCategories { get; set; } + public DbSet ProductCostHistories { get; set; } + public DbSet ProductDescriptions { get; set; } + public DbSet ProductDocuments { get; set; } + public DbSet ProductInventories { get; set; } + public DbSet ProductListPriceHistories { get; set; } + public DbSet ProductModels { get; set; } + public DbSet ProductModelIllustrations { get; set; } + public DbSet ProductModelProductDescriptionCultures { get; set; } + public DbSet ProductPhotoes { get; set; } + public DbSet ProductProductPhotoes { get; set; } + public DbSet ProductReviews { get; set; } + public DbSet ProductSubcategories { get; set; } + public DbSet ScrapReasons { get; set; } + public DbSet TransactionHistories { get; set; } + public DbSet TransactionHistoryArchives { get; set; } + public DbSet UnitMeasures { get; set; } + public DbSet WorkOrders { get; set; } + public DbSet WorkOrderRoutings { get; set; } + public DbSet ProductVendors { get; set; } + public DbSet PurchaseOrderDetails { get; set; } + public DbSet PurchaseOrders { get; set; } + public DbSet ShipMethods { get; set; } + public DbSet Vendors { get; set; } + public DbSet VendorAddresses { get; set; } + public DbSet VendorContacts { get; set; } + public DbSet ContactCreditCards { get; set; } + public DbSet CountryRegionCurrencies { get; set; } + public DbSet CreditCards { get; set; } + public DbSet Currencies { get; set; } + public DbSet CurrencyRates { get; set; } + public DbSet Customers { get; set; } + public DbSet CustomerAddresses { get; set; } + public DbSet Individuals { get; set; } + public DbSet SalesOrderDetails { get; set; } + public DbSet SalesOrderHeaders { get; set; } + public DbSet SalesOrderHeaderSalesReasons { get; set; } + public DbSet SalesPersons { get; set; } + public DbSet SalesPersonQuotaHistories { get; set; } + public DbSet SalesReasons { get; set; } + public DbSet SalesTaxRates { get; set; } + public DbSet SalesTerritories { get; set; } + public DbSet SalesTerritoryHistories { get; set; } + public DbSet ShoppingCartItems { get; set; } + public DbSet SpecialOffers { get; set; } + public DbSet SpecialOfferProducts { get; set; } + public DbSet Stores { get; set; } + public DbSet StoreContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt new file mode 100644 index 000000000..97de62047 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt @@ -0,0 +1,194 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +var loader = new MetadataLoader(this); +var region = new CodeRegion(this); +var inputFile = @"AdventureWorksDbCtx.edmx"; +var ItemCollection = loader.CreateEdmItemCollection(inputFile); + +Code = new CodeGenerationTools(this); +EFTools = new MetadataTools(this); +ObjectNamespace = Code.VsNamespaceSuggestion(); +ModelNamespace = loader.GetModelNamespace(inputFile); + +EntityContainer container = ItemCollection.GetItems().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +if (!String.IsNullOrEmpty(ObjectNamespace)) +{ +#> +namespace <#=Code.EscapeNamespace(ObjectNamespace)#> +{ +<# + PushIndent(CodeRegion.GetIndent(1)); +} + +#> +using System; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +<# +if (container.FunctionImports.Any()) +{ +#> +using System.Data.Objects; +<# +} +#> + +<#=Accessibility.ForType(container)#> partial class <#=Code.Escape(container)#> : DbContext +{ + public <#=Code.Escape(container)#>() + : base("name=<#=container.Name#>") + { +<# + WriteLazyLoadingEnabled(container); +#> + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + +<# + foreach (var entitySet in container.BaseEntitySets.OfType()) + { +#> + <#=Accessibility.ForReadOnlyProperty(entitySet)#> DbSet<<#=Code.Escape(entitySet.ElementType)#>> <#=Code.Escape(entitySet)#> { get; set; } +<# + } + + foreach (var edmFunction in container.FunctionImports) + { + WriteFunctionImport(edmFunction, false); + } +#> +} +<# + +if (!String.IsNullOrEmpty(ObjectNamespace)) +{ + PopIndent(); +#> +} +<# +} +#> +<#+ +string ModelNamespace { get; set; } +string ObjectNamespace { get; set; } +CodeGenerationTools Code { get; set; } +MetadataTools EFTools { get; set; } + +string GetResourceString(string resourceName) +{ + if(_resourceManager == null) + { + _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); + } + + return _resourceManager.GetString(resourceName, null); +} +System.Resources.ResourceManager _resourceManager; + +void WriteLazyLoadingEnabled(EntityContainer container) +{ + string lazyLoadingAttributeValue = null; + var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; + if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) + { + bool isLazyLoading; + if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading) && !isLazyLoading) + { +#> + this.Configuration.LazyLoadingEnabled = false; +<#+ + } + } +} + +void WriteFunctionImport(EdmFunction edmFunction, bool includeMergeOption) +{ + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, Code, EFTools); + var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); + var returnType = edmFunction.ReturnParameter == null ? null : EFTools.GetElementType(edmFunction.ReturnParameter.TypeUsage); + var processedReturn = returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType) + ">"; + + if (includeMergeOption) + { + paramList = Code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } +#> + + <#=AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction))#> <#=processedReturn#> <#=Code.Escape(edmFunction)#>(<#=paramList#>) + { +<#+ + if(returnType != null && (returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || + returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) + { +#> + ((IObjectContextAdapter)this).ObjectContext.MetadataWorkspace.LoadFromAssembly(typeof(<#=MultiSchemaEscape(returnType)#>).Assembly); + +<#+ + } + + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))"; +#> + var <#=parameter.LocalVariableName#> = <#=isNotNull#> ? + <#=notNullInit#> : + <#=nullInit#>; + +<#+ + } + + var genericArg = returnType == null ? "" : "<" + MultiSchemaEscape(returnType) + ">"; + var callParams = Code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } +#> + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<#=genericArg#>("<#=edmFunction.Name#>"<#=callParams#>); + } +<#+ + if(!includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { + WriteFunctionImport(edmFunction, true); + } +} + +string AccessibilityAndVirtual(string accessibility) +{ + return accessibility + (accessibility != "private" ? " virtual" : ""); +} + +string MultiSchemaEscape(TypeUsage usage) +{ + var type = usage.EdmType as StructuralType; + return type != null && type.NamespaceName != ModelNamespace ? + Code.CreateFullName(Code.EscapeNamespace(type.NamespaceName), Code.Escape(type)) : + Code.Escape(usage); +} + +#> \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs new file mode 100644 index 000000000..a1659b392 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs @@ -0,0 +1,4 @@ +// Default code generation is disabled for model 'D:\dd\Alex_AppFx_1\src\AppFx\RiaServices\Main\OpenRiaServices.EntityFramework\Test\DbContextModel\AdventureWorks\AdventureWorksDbCtx.edmx'. +// To enable default code generation, change the value of the 'Code Generation Strategy' designer +// property to an alternate value. This property is available in the Properties Window when the model is +// open in the designer. \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs new file mode 100644 index 000000000..0c4c97d77 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx new file mode 100644 index 000000000..e66327900 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx @@ -0,0 +1,6405 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt new file mode 100644 index 000000000..097b51b40 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt @@ -0,0 +1,280 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +CodeGenerationTools code = new CodeGenerationTools(this); +MetadataLoader loader = new MetadataLoader(this); +CodeRegion region = new CodeRegion(this, 1); +MetadataTools ef = new MetadataTools(this); + +string inputFile = @"AdventureWorksDbCtx.edmx"; +EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile); +string namespaceName = code.VsNamespaceSuggestion(); + +EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this); +WriteHeader(fileManager); + +foreach (var entity in ItemCollection.GetItems().OrderBy(e => e.Name)) +{ + fileManager.StartNewFile(entity.Name + ".cs"); + BeginNamespace(namespaceName, code); +#> +using System; +using System.Collections.Generic; + +<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#><#=code.StringBefore(" : ", code.Escape(entity.BaseType))#> +{ +<# + var propertiesWithDefaultValues = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity && p.DefaultValue != null); + var collectionNavigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + var complexProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == entity); + + if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(entity)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var navigationProperty in collectionNavigationProperties) + { +#> + this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=code.Escape(navigationProperty.ToEndMember.GetEntityType())#>>(); +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var primitiveProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity); + if (primitiveProperties.Any()) + { + foreach (var edmProperty in primitiveProperties) + { + WriteProperty(code, edmProperty); + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var complexProperty in complexProperties) + { + WriteProperty(code, complexProperty); + } + } + + var navigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity); + if (navigationProperties.Any()) + { +#> + +<# + foreach (var navigationProperty in navigationProperties) + { + WriteNavigationProperty(code, navigationProperty); + } + } +#> +} +<# + EndNamespace(namespaceName); +} + +foreach (var complex in ItemCollection.GetItems().OrderBy(e => e.Name)) +{ + fileManager.StartNewFile(complex.Name + ".cs"); + BeginNamespace(namespaceName, code); +#> +using System; + +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> +{ +<# + var complexProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == complex); + var propertiesWithDefaultValues = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex && p.DefaultValue != null); + + if (propertiesWithDefaultValues.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(complex)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var primitiveProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex); + if (primitiveProperties.Any()) + { + foreach(var edmProperty in primitiveProperties) + { + WriteProperty(code, edmProperty); + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var edmProperty in complexProperties) + { + WriteProperty(code, edmProperty); + } + } +#> +} +<# + EndNamespace(namespaceName); +} + +if (!VerifyTypesAreCaseInsensitiveUnique(ItemCollection)) +{ + return ""; +} + +fileManager.Process(); + +#> +<#+ +string GetResourceString(string resourceName) +{ + if(_resourceManager == null) + { + _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); + } + + return _resourceManager.GetString(resourceName, null); +} +System.Resources.ResourceManager _resourceManager; + +void WriteHeader(EntityFrameworkTemplateFileManager fileManager) +{ + fileManager.StartHeader(); +#> +//------------------------------------------------------------------------------ +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<#+ + fileManager.EndBlock(); +} + +void BeginNamespace(string namespaceName, CodeGenerationTools code) +{ + CodeRegion region = new CodeRegion(this); + if (!String.IsNullOrEmpty(namespaceName)) + { +#> +namespace <#=code.EscapeNamespace(namespaceName)#> +{ +<#+ + PushIndent(CodeRegion.GetIndent(1)); + } +} + + +void EndNamespace(string namespaceName) +{ + if (!String.IsNullOrEmpty(namespaceName)) + { + PopIndent(); +#> +} +<#+ + } +} + +void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty) +{ + WriteProperty(Accessibility.ForProperty(edmProperty), + code.Escape(edmProperty.TypeUsage), + code.Escape(edmProperty), + code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + code.SpaceAfter(Accessibility.ForSetter(edmProperty))); +} + +void WriteNavigationProperty(CodeGenerationTools code, NavigationProperty navigationProperty) +{ + var endType = code.Escape(navigationProperty.ToEndMember.GetEntityType()); + WriteProperty(PropertyVirtualModifier(Accessibility.ForProperty(navigationProperty)), + navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + code.Escape(navigationProperty), + code.SpaceAfter(Accessibility.ForGetter(navigationProperty)), + code.SpaceAfter(Accessibility.ForSetter(navigationProperty))); +} + +void WriteProperty(string accessibility, string type, string name, string getterAccessibility, string setterAccessibility) +{ +#> + <#=accessibility#> <#=type#> <#=name#> { <#=getterAccessibility#>get; <#=setterAccessibility#>set; } +<#+ +} + +string PropertyVirtualModifier(string accessibility) +{ + return accessibility + (accessibility != "private" ? " virtual" : ""); +} + +bool VerifyTypesAreCaseInsensitiveUnique(EdmItemCollection itemCollection) +{ + var alreadySeen = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach(var type in itemCollection.GetItems()) + { + if (!(type is EntityType || type is ComplexType)) + { + continue; + } + + if (alreadySeen.ContainsKey(type.FullName)) + { + Error(String.Format(CultureInfo.CurrentCulture, "This template does not support types that differ only by case, the types {0} are not supported", type.FullName)); + return false; + } + else + { + alreadySeen.Add(type.FullName, true); + } + } + + return true; +} +#> diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs new file mode 100644 index 000000000..be7bdc6fb --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs @@ -0,0 +1,103 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using OpenRiaServices.Server; + +// These assembly attributes allow us to serialize different CLR types into the same contract +[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks", + ClrNamespace = "DbContextModels.AdventureWorks")] + +namespace DbContextModels.AdventureWorks +{ + public partial class DbCtxAdventureWorksEntities + { + public DbCtxAdventureWorksEntities(string connectionString) + : base(connectionString) + { + } + } + + [MetadataType(typeof(PurchaseOrderMetadata))] + public partial class PurchaseOrder + { + } + + [MetadataType(typeof(PurchaseOrderDetailMetadata))] + public partial class PurchaseOrderDetail + { + } + + public static class PurchaseOrderMetadata + { + [Include] + public static object PurchaseOrderDetails; + } + + public static class PurchaseOrderDetailMetadata + { + [Include] + public static object Product; + } + + [MetadataType(typeof(ProductMetadata))] + public partial class Product + { + } + + public static class ProductMetadata + { + [Exclude] + public static object SafetyStockLevel; + + [RoundtripOriginal] + public static object Weight; + } + + [MetadataType(typeof(EmployeeMetadata))] + public partial class Employee + { + } + + public static class EmployeeMetadata + { + [Include] + public static object Manager; + } + + public class EmployeeInfo + { + public static EmployeeInfo CreateEmployeeInfo(int employeeID, string firstName, string lastName, int territoryID) + { + EmployeeInfo empInfo = new EmployeeInfo(); + empInfo.EmployeeID = employeeID; + empInfo.FirstName = firstName; + empInfo.LastName = lastName; + empInfo.TerritoryID = territoryID; + return empInfo; + } + + [Key] + public int EmployeeID + { + get; + set; + } + + public string FirstName + { + get; + set; + } + public string LastName + { + get; + set; + } + public int TerritoryID + { + get; + set; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs new file mode 100644 index 000000000..c557c7a36 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class BillOfMaterial + { + public int BillOfMaterialsID { get; set; } + public Nullable ProductAssemblyID { get; set; } + public int ComponentID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public string UnitMeasureCode { get; set; } + public short BOMLevel { get; set; } + public decimal PerAssemblyQty { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual Product Product1 { get; set; } + public virtual UnitMeasure UnitMeasure { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs new file mode 100644 index 000000000..61adf5887 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Contact + { + public Contact() + { + this.Employees = new HashSet(); + this.ContactCreditCards = new HashSet(); + this.Individuals = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + this.StoreContacts = new HashSet(); + this.VendorContacts = new HashSet(); + } + + public int ContactID { get; set; } + public bool NameStyle { get; set; } + public string Title { get; set; } + public string FirstName { get; set; } + public string MiddleName { get; set; } + public string LastName { get; set; } + public string Suffix { get; set; } + public string EmailAddress { get; set; } + public int EmailPromotion { get; set; } + public string Phone { get; set; } + public string PasswordHash { get; set; } + public string PasswordSalt { get; set; } + public string AdditionalContactInfo { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection Employees { get; set; } + public virtual ICollection ContactCreditCards { get; set; } + public virtual ICollection Individuals { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual ICollection StoreContacts { get; set; } + public virtual ICollection VendorContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs new file mode 100644 index 000000000..d589fc7e6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ContactCreditCard + { + public int ContactID { get; set; } + public int CreditCardID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual CreditCard CreditCard { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs new file mode 100644 index 000000000..e6b0dc880 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ContactType + { + public ContactType() + { + this.StoreContacts = new HashSet(); + this.VendorContacts = new HashSet(); + } + + public int ContactTypeID { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection StoreContacts { get; set; } + public virtual ICollection VendorContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs new file mode 100644 index 000000000..1e82bc408 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class CountryRegion + { + public CountryRegion() + { + this.CountryRegionCurrencies = new HashSet(); + this.StateProvinces = new HashSet(); + } + + public string CountryRegionCode { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection CountryRegionCurrencies { get; set; } + public virtual ICollection StateProvinces { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs new file mode 100644 index 000000000..6fa408c39 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class CountryRegionCurrency + { + public string CountryRegionCode { get; set; } + public string CurrencyCode { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual CountryRegion CountryRegion { get; set; } + public virtual Currency Currency { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs new file mode 100644 index 000000000..b90d6ec27 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class CreditCard + { + public CreditCard() + { + this.ContactCreditCards = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + } + + public int CreditCardID { get; set; } + public string CardType { get; set; } + public string CardNumber { get; set; } + public byte ExpMonth { get; set; } + public short ExpYear { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ContactCreditCards { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs new file mode 100644 index 000000000..a702328e6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Culture + { + public Culture() + { + this.ProductModelProductDescriptionCultures = new HashSet(); + } + + public string CultureID { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs new file mode 100644 index 000000000..f56cb6978 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Currency + { + public Currency() + { + this.CountryRegionCurrencies = new HashSet(); + this.CurrencyRates = new HashSet(); + this.CurrencyRates1 = new HashSet(); + } + + public string CurrencyCode { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection CountryRegionCurrencies { get; set; } + public virtual ICollection CurrencyRates { get; set; } + public virtual ICollection CurrencyRates1 { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs new file mode 100644 index 000000000..d571d24a9 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class CurrencyRate + { + public CurrencyRate() + { + this.SalesOrderHeaders = new HashSet(); + } + + public int CurrencyRateID { get; set; } + public System.DateTime CurrencyRateDate { get; set; } + public string FromCurrencyCode { get; set; } + public string ToCurrencyCode { get; set; } + public decimal AverageRate { get; set; } + public decimal EndOfDayRate { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Currency Currency { get; set; } + public virtual Currency Currency1 { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs new file mode 100644 index 000000000..9ba787ccb --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Customer + { + public Customer() + { + this.CustomerAddresses = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + } + + public int CustomerID { get; set; } + public Nullable TerritoryID { get; set; } + public string AccountNumber { get; set; } + public string CustomerType { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesTerritory SalesTerritory { get; set; } + public virtual ICollection CustomerAddresses { get; set; } + public virtual Individual Individual { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual Store Store { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs new file mode 100644 index 000000000..5d4bff4e6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class CustomerAddress + { + public int CustomerID { get; set; } + public int AddressID { get; set; } + public int AddressTypeID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Address Address { get; set; } + public virtual AddressType AddressType { get; set; } + public virtual Customer Customer { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs new file mode 100644 index 000000000..0f3c3cbf6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class DatabaseLog + { + public int DatabaseLogID { get; set; } + public System.DateTime PostTime { get; set; } + public string DatabaseUser { get; set; } + public string Event { get; set; } + public string Schema { get; set; } + public string Object { get; set; } + public string TSQL { get; set; } + public string XmlEvent { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs new file mode 100644 index 000000000..49c33d7ca --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Department + { + public Department() + { + this.EmployeeDepartmentHistories = new HashSet(); + } + + public short DepartmentID { get; set; } + public string Name { get; set; } + public string GroupName { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection EmployeeDepartmentHistories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs new file mode 100644 index 000000000..fc30ae8ed --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Document + { + public Document() + { + this.ProductDocuments = new HashSet(); + } + + public int DocumentID { get; set; } + public string Title { get; set; } + public string FileName { get; set; } + public string FileExtension { get; set; } + public string Revision { get; set; } + public int ChangeNumber { get; set; } + public byte Status { get; set; } + public string DocumentSummary { get; set; } + public byte[] Document1 { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductDocuments { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs new file mode 100644 index 000000000..28764fd6d --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Employee + { + public Employee() + { + this.Reports = new HashSet(); + this.EmployeeAddresses = new HashSet(); + this.EmployeeDepartmentHistories = new HashSet(); + this.EmployeePayHistories = new HashSet(); + this.JobCandidates = new HashSet(); + this.PurchaseOrders = new HashSet(); + } + + public int EmployeeID { get; set; } + public string NationalIDNumber { get; set; } + public int ContactID { get; set; } + public string LoginID { get; set; } + public Nullable ManagerID { get; set; } + public string Title { get; set; } + public System.DateTime BirthDate { get; set; } + public string MaritalStatus { get; set; } + public string Gender { get; set; } + public System.DateTime HireDate { get; set; } + public bool SalariedFlag { get; set; } + public short VacationHours { get; set; } + public short SickLeaveHours { get; set; } + public bool CurrentFlag { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual ICollection Reports { get; set; } + public virtual Employee Manager { get; set; } + public virtual ICollection EmployeeAddresses { get; set; } + public virtual ICollection EmployeeDepartmentHistories { get; set; } + public virtual ICollection EmployeePayHistories { get; set; } + public virtual ICollection JobCandidates { get; set; } + public virtual ICollection PurchaseOrders { get; set; } + public virtual SalesPerson SalesPerson { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs new file mode 100644 index 000000000..193df3e54 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class EmployeeAddress + { + public int EmployeeID { get; set; } + public int AddressID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + public virtual Address Address { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs new file mode 100644 index 000000000..a2abcb742 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class EmployeeDepartmentHistory + { + public int EmployeeID { get; set; } + public short DepartmentID { get; set; } + public byte ShiftID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Department Department { get; set; } + public virtual Employee Employee { get; set; } + public virtual Shift Shift { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs new file mode 100644 index 000000000..9c0451091 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class EmployeePayHistory + { + public int EmployeeID { get; set; } + public System.DateTime RateChangeDate { get; set; } + public decimal Rate { get; set; } + public byte PayFrequency { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs new file mode 100644 index 000000000..3201be4b9 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ErrorLog + { + public int ErrorLogID { get; set; } + public System.DateTime ErrorTime { get; set; } + public string UserName { get; set; } + public int ErrorNumber { get; set; } + public Nullable ErrorSeverity { get; set; } + public Nullable ErrorState { get; set; } + public string ErrorProcedure { get; set; } + public Nullable ErrorLine { get; set; } + public string ErrorMessage { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs new file mode 100644 index 000000000..c00b272dd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Illustration + { + public Illustration() + { + this.ProductModelIllustrations = new HashSet(); + } + + public int IllustrationID { get; set; } + public string Diagram { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductModelIllustrations { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs new file mode 100644 index 000000000..83a39d9f2 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Individual + { + public int CustomerID { get; set; } + public int ContactID { get; set; } + public string Demographics { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual Customer Customer { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs new file mode 100644 index 000000000..e4d7b4428 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class JobCandidate + { + public int JobCandidateID { get; set; } + public Nullable EmployeeID { get; set; } + public string Resume { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs new file mode 100644 index 000000000..40f1e6c40 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Location + { + public Location() + { + this.ProductInventories = new HashSet(); + this.WorkOrderRoutings = new HashSet(); + } + + public short LocationID { get; set; } + public string Name { get; set; } + public decimal CostRate { get; set; } + public decimal Availability { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductInventories { get; set; } + public virtual ICollection WorkOrderRoutings { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs new file mode 100644 index 000000000..a0a0ea4fe --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Product + { + public Product() + { + this.BillOfMaterials = new HashSet(); + this.BillOfMaterials1 = new HashSet(); + this.ProductCostHistories = new HashSet(); + this.ProductDocuments = new HashSet(); + this.ProductInventories = new HashSet(); + this.ProductListPriceHistories = new HashSet(); + this.ProductProductPhotoes = new HashSet(); + this.ProductReviews = new HashSet(); + this.ProductVendors = new HashSet(); + this.PurchaseOrderDetails = new HashSet(); + this.ShoppingCartItems = new HashSet(); + this.SpecialOfferProducts = new HashSet(); + this.TransactionHistories = new HashSet(); + this.WorkOrders = new HashSet(); + } + + public int ProductID { get; set; } + public string Name { get; set; } + public string ProductNumber { get; set; } + public bool MakeFlag { get; set; } + public bool FinishedGoodsFlag { get; set; } + public string Color { get; set; } + public short SafetyStockLevel { get; set; } + public short ReorderPoint { get; set; } + public decimal StandardCost { get; set; } + public decimal ListPrice { get; set; } + public string Size { get; set; } + public string SizeUnitMeasureCode { get; set; } + public string WeightUnitMeasureCode { get; set; } + public Nullable Weight { get; set; } + public int DaysToManufacture { get; set; } + public string ProductLine { get; set; } + public string Class { get; set; } + public string Style { get; set; } + public Nullable ProductSubcategoryID { get; set; } + public Nullable ProductModelID { get; set; } + public System.DateTime SellStartDate { get; set; } + public Nullable SellEndDate { get; set; } + public Nullable DiscontinuedDate { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection BillOfMaterials { get; set; } + public virtual ICollection BillOfMaterials1 { get; set; } + public virtual ProductModel ProductModel { get; set; } + public virtual ProductSubcategory ProductSubcategory { get; set; } + public virtual UnitMeasure UnitMeasure { get; set; } + public virtual UnitMeasure UnitMeasure1 { get; set; } + public virtual ICollection ProductCostHistories { get; set; } + public virtual ICollection ProductDocuments { get; set; } + public virtual ICollection ProductInventories { get; set; } + public virtual ICollection ProductListPriceHistories { get; set; } + public virtual ICollection ProductProductPhotoes { get; set; } + public virtual ICollection ProductReviews { get; set; } + public virtual ICollection ProductVendors { get; set; } + public virtual ICollection PurchaseOrderDetails { get; set; } + public virtual ICollection ShoppingCartItems { get; set; } + public virtual ICollection SpecialOfferProducts { get; set; } + public virtual ICollection TransactionHistories { get; set; } + public virtual ICollection WorkOrders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs new file mode 100644 index 000000000..4b34b25e4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductCategory + { + public ProductCategory() + { + this.ProductSubcategories = new HashSet(); + } + + public int ProductCategoryID { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductSubcategories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs new file mode 100644 index 000000000..6afdd0129 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductCostHistory + { + public int ProductID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public decimal StandardCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs new file mode 100644 index 000000000..c6b586ea7 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductDescription + { + public ProductDescription() + { + this.ProductModelProductDescriptionCultures = new HashSet(); + } + + public int ProductDescriptionID { get; set; } + public string Description { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs new file mode 100644 index 000000000..5e3f0b166 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductDocument + { + public int ProductID { get; set; } + public int DocumentID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Document Document { get; set; } + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs new file mode 100644 index 000000000..19cc6db94 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductInventory + { + public int ProductID { get; set; } + public short LocationID { get; set; } + public string Shelf { get; set; } + public byte Bin { get; set; } + public short Quantity { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Location Location { get; set; } + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs new file mode 100644 index 000000000..1f002b0e4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductListPriceHistory + { + public int ProductID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public decimal ListPrice { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs new file mode 100644 index 000000000..bce8c05a1 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductModel + { + public ProductModel() + { + this.Products = new HashSet(); + this.ProductModelIllustrations = new HashSet(); + this.ProductModelProductDescriptionCultures = new HashSet(); + } + + public int ProductModelID { get; set; } + public string Name { get; set; } + public string CatalogDescription { get; set; } + public string Instructions { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection Products { get; set; } + public virtual ICollection ProductModelIllustrations { get; set; } + public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs new file mode 100644 index 000000000..a4502e58e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductModelIllustration + { + public int ProductModelID { get; set; } + public int IllustrationID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Illustration Illustration { get; set; } + public virtual ProductModel ProductModel { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs new file mode 100644 index 000000000..114811a47 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductModelProductDescriptionCulture + { + public int ProductModelID { get; set; } + public int ProductDescriptionID { get; set; } + public string CultureID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Culture Culture { get; set; } + public virtual ProductDescription ProductDescription { get; set; } + public virtual ProductModel ProductModel { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs new file mode 100644 index 000000000..583ec0765 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductPhoto + { + public ProductPhoto() + { + this.ProductProductPhotoes = new HashSet(); + } + + public int ProductPhotoID { get; set; } + public byte[] ThumbNailPhoto { get; set; } + public string ThumbnailPhotoFileName { get; set; } + public byte[] LargePhoto { get; set; } + public string LargePhotoFileName { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductProductPhotoes { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs new file mode 100644 index 000000000..d8bcacb43 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductProductPhoto + { + public int ProductID { get; set; } + public int ProductPhotoID { get; set; } + public bool Primary { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual ProductPhoto ProductPhoto { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs new file mode 100644 index 000000000..d47e840fd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductReview + { + public int ProductReviewID { get; set; } + public int ProductID { get; set; } + public string ReviewerName { get; set; } + public System.DateTime ReviewDate { get; set; } + public string EmailAddress { get; set; } + public int Rating { get; set; } + public string Comments { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs new file mode 100644 index 000000000..6ed91040a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductSubcategory + { + public ProductSubcategory() + { + this.Products = new HashSet(); + } + + public int ProductSubcategoryID { get; set; } + public int ProductCategoryID { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection Products { get; set; } + public virtual ProductCategory ProductCategory { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs new file mode 100644 index 000000000..09bc92acd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ProductVendor + { + public int ProductID { get; set; } + public int VendorID { get; set; } + public int AverageLeadTime { get; set; } + public decimal StandardPrice { get; set; } + public Nullable LastReceiptCost { get; set; } + public Nullable LastReceiptDate { get; set; } + public int MinOrderQty { get; set; } + public int MaxOrderQty { get; set; } + public Nullable OnOrderQty { get; set; } + public string UnitMeasureCode { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual UnitMeasure UnitMeasure { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs new file mode 100644 index 000000000..083d90774 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class PurchaseOrder + { + public PurchaseOrder() + { + this.PurchaseOrderDetails = new HashSet(); + } + + public int PurchaseOrderID { get; set; } + public byte RevisionNumber { get; set; } + public byte Status { get; set; } + public int EmployeeID { get; set; } + public int VendorID { get; set; } + public int ShipMethodID { get; set; } + public System.DateTime OrderDate { get; set; } + public Nullable ShipDate { get; set; } + public decimal SubTotal { get; set; } + public decimal TaxAmt { get; set; } + public decimal Freight { get; set; } + public decimal TotalDue { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + public virtual ICollection PurchaseOrderDetails { get; set; } + public virtual ShipMethod ShipMethod { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs new file mode 100644 index 000000000..e18d2e8af --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class PurchaseOrderDetail + { + public int PurchaseOrderID { get; set; } + public int PurchaseOrderDetailID { get; set; } + public System.DateTime DueDate { get; set; } + public short OrderQty { get; set; } + public int ProductID { get; set; } + public decimal UnitPrice { get; set; } + public decimal LineTotal { get; set; } + public decimal ReceivedQty { get; set; } + public decimal RejectedQty { get; set; } + public decimal StockedQty { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual PurchaseOrder PurchaseOrder { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs new file mode 100644 index 000000000..a7cb4cf5b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesOrderDetail + { + public int SalesOrderID { get; set; } + public int SalesOrderDetailID { get; set; } + public string CarrierTrackingNumber { get; set; } + public short OrderQty { get; set; } + public int ProductID { get; set; } + public int SpecialOfferID { get; set; } + public decimal UnitPrice { get; set; } + public decimal UnitPriceDiscount { get; set; } + public decimal LineTotal { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesOrderHeader SalesOrderHeader { get; set; } + public virtual SpecialOfferProduct SpecialOfferProduct { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs new file mode 100644 index 000000000..44d88c879 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesOrderHeader + { + public SalesOrderHeader() + { + this.SalesOrderDetails = new HashSet(); + this.SalesOrderHeaderSalesReasons = new HashSet(); + } + + public int SalesOrderID { get; set; } + public byte RevisionNumber { get; set; } + public System.DateTime OrderDate { get; set; } + public System.DateTime DueDate { get; set; } + public Nullable ShipDate { get; set; } + public byte Status { get; set; } + public bool OnlineOrderFlag { get; set; } + public string SalesOrderNumber { get; set; } + public string PurchaseOrderNumber { get; set; } + public string AccountNumber { get; set; } + public int CustomerID { get; set; } + public int ContactID { get; set; } + public Nullable SalesPersonID { get; set; } + public Nullable TerritoryID { get; set; } + public int BillToAddressID { get; set; } + public int ShipToAddressID { get; set; } + public int ShipMethodID { get; set; } + public Nullable CreditCardID { get; set; } + public string CreditCardApprovalCode { get; set; } + public Nullable CurrencyRateID { get; set; } + public decimal SubTotal { get; set; } + public decimal TaxAmt { get; set; } + public decimal Freight { get; set; } + public decimal TotalDue { get; set; } + public string Comment { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Address Address { get; set; } + public virtual Address Address1 { get; set; } + public virtual Contact Contact { get; set; } + public virtual ShipMethod ShipMethod { get; set; } + public virtual CreditCard CreditCard { get; set; } + public virtual CurrencyRate CurrencyRate { get; set; } + public virtual Customer Customer { get; set; } + public virtual ICollection SalesOrderDetails { get; set; } + public virtual SalesPerson SalesPerson { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs new file mode 100644 index 000000000..ab22701e7 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesOrderHeaderSalesReason + { + public int SalesOrderID { get; set; } + public int SalesReasonID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesOrderHeader SalesOrderHeader { get; set; } + public virtual SalesReason SalesReason { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs new file mode 100644 index 000000000..92df3f961 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesPerson + { + public SalesPerson() + { + this.SalesOrderHeaders = new HashSet(); + this.SalesPersonQuotaHistories = new HashSet(); + this.SalesTerritoryHistories = new HashSet(); + this.Stores = new HashSet(); + } + + public int SalesPersonID { get; set; } + public Nullable TerritoryID { get; set; } + public Nullable SalesQuota { get; set; } + public decimal Bonus { get; set; } + public decimal CommissionPct { get; set; } + public decimal SalesYTD { get; set; } + public decimal SalesLastYear { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + public virtual ICollection SalesPersonQuotaHistories { get; set; } + public virtual ICollection SalesTerritoryHistories { get; set; } + public virtual ICollection Stores { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs new file mode 100644 index 000000000..a183c0456 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesPersonQuotaHistory + { + public int SalesPersonID { get; set; } + public System.DateTime QuotaDate { get; set; } + public decimal SalesQuota { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesPerson SalesPerson { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs new file mode 100644 index 000000000..0fbb5e5a1 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesReason + { + public SalesReason() + { + this.SalesOrderHeaderSalesReasons = new HashSet(); + } + + public int SalesReasonID { get; set; } + public string Name { get; set; } + public string ReasonType { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs new file mode 100644 index 000000000..d09f0e529 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesTaxRate + { + public int SalesTaxRateID { get; set; } + public int StateProvinceID { get; set; } + public byte TaxType { get; set; } + public decimal TaxRate { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual StateProvince StateProvince { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs new file mode 100644 index 000000000..95459b5a9 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesTerritory + { + public SalesTerritory() + { + this.StateProvinces = new HashSet(); + this.Customers = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + this.SalesPersons = new HashSet(); + this.SalesTerritoryHistories = new HashSet(); + } + + public int TerritoryID { get; set; } + public string Name { get; set; } + public string CountryRegionCode { get; set; } + public string Group { get; set; } + public decimal SalesYTD { get; set; } + public decimal SalesLastYear { get; set; } + public decimal CostYTD { get; set; } + public decimal CostLastYear { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection StateProvinces { get; set; } + public virtual ICollection Customers { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual ICollection SalesPersons { get; set; } + public virtual ICollection SalesTerritoryHistories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs new file mode 100644 index 000000000..2597d6a70 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SalesTerritoryHistory + { + public int SalesPersonID { get; set; } + public int TerritoryID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesPerson SalesPerson { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs new file mode 100644 index 000000000..a80122d7f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ScrapReason + { + public ScrapReason() + { + this.WorkOrders = new HashSet(); + } + + public short ScrapReasonID { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection WorkOrders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs new file mode 100644 index 000000000..51c52c4df --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Shift + { + public Shift() + { + this.EmployeeDepartmentHistories = new HashSet(); + } + + public byte ShiftID { get; set; } + public string Name { get; set; } + public System.DateTime StartTime { get; set; } + public System.DateTime EndTime { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection EmployeeDepartmentHistories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs new file mode 100644 index 000000000..49db4a191 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ShipMethod + { + public ShipMethod() + { + this.PurchaseOrderHeaders = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + } + + public int ShipMethodID { get; set; } + public string Name { get; set; } + public decimal ShipBase { get; set; } + public decimal ShipRate { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection PurchaseOrderHeaders { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs new file mode 100644 index 000000000..1ea6b5b4f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class ShoppingCartItem + { + public int ShoppingCartItemID { get; set; } + public string ShoppingCartID { get; set; } + public int Quantity { get; set; } + public int ProductID { get; set; } + public System.DateTime DateCreated { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs new file mode 100644 index 000000000..0c3b51a53 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SpecialOffer + { + public SpecialOffer() + { + this.SpecialOfferProducts = new HashSet(); + } + + public int SpecialOfferID { get; set; } + public string Description { get; set; } + public decimal DiscountPct { get; set; } + public string Type { get; set; } + public string Category { get; set; } + public System.DateTime StartDate { get; set; } + public System.DateTime EndDate { get; set; } + public int MinQty { get; set; } + public Nullable MaxQty { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection SpecialOfferProducts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs new file mode 100644 index 000000000..d7176273c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class SpecialOfferProduct + { + public SpecialOfferProduct() + { + this.SalesOrderDetails = new HashSet(); + } + + public int SpecialOfferID { get; set; } + public int ProductID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual ICollection SalesOrderDetails { get; set; } + public virtual SpecialOffer SpecialOffer { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs new file mode 100644 index 000000000..945bda4a8 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class StateProvince + { + public StateProvince() + { + this.Addresses = new HashSet
(); + this.SalesTaxRates = new HashSet(); + } + + public int StateProvinceID { get; set; } + public string StateProvinceCode { get; set; } + public string CountryRegionCode { get; set; } + public bool IsOnlyStateProvinceFlag { get; set; } + public string Name { get; set; } + public int TerritoryID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection
Addresses { get; set; } + public virtual CountryRegion CountryRegion { get; set; } + public virtual ICollection SalesTaxRates { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs new file mode 100644 index 000000000..a004f9480 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Store + { + public Store() + { + this.StoreContacts = new HashSet(); + } + + public int CustomerID { get; set; } + public string Name { get; set; } + public Nullable SalesPersonID { get; set; } + public string Demographics { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Customer Customer { get; set; } + public virtual SalesPerson SalesPerson { get; set; } + public virtual ICollection StoreContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs new file mode 100644 index 000000000..dec9448b9 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class StoreContact + { + public int CustomerID { get; set; } + public int ContactID { get; set; } + public int ContactTypeID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual ContactType ContactType { get; set; } + public virtual Store Store { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs new file mode 100644 index 000000000..164295e4a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class TransactionHistory + { + public int TransactionID { get; set; } + public int ProductID { get; set; } + public int ReferenceOrderID { get; set; } + public int ReferenceOrderLineID { get; set; } + public System.DateTime TransactionDate { get; set; } + public string TransactionType { get; set; } + public int Quantity { get; set; } + public decimal ActualCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs new file mode 100644 index 000000000..3fd312a2c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class TransactionHistoryArchive + { + public int TransactionID { get; set; } + public int ProductID { get; set; } + public int ReferenceOrderID { get; set; } + public int ReferenceOrderLineID { get; set; } + public System.DateTime TransactionDate { get; set; } + public string TransactionType { get; set; } + public int Quantity { get; set; } + public decimal ActualCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs new file mode 100644 index 000000000..7b88b1145 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class UnitMeasure + { + public UnitMeasure() + { + this.BillOfMaterials = new HashSet(); + this.Products = new HashSet(); + this.Products1 = new HashSet(); + this.ProductVendors = new HashSet(); + } + + public string UnitMeasureCode { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection BillOfMaterials { get; set; } + public virtual ICollection Products { get; set; } + public virtual ICollection Products1 { get; set; } + public virtual ICollection ProductVendors { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs new file mode 100644 index 000000000..99bb7bd1f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class Vendor + { + public Vendor() + { + this.ProductVendors = new HashSet(); + this.PurchaseOrderHeaders = new HashSet(); + this.VendorAddresses = new HashSet(); + this.VendorContacts = new HashSet(); + } + + public int VendorID { get; set; } + public string AccountNumber { get; set; } + public string Name { get; set; } + public byte CreditRating { get; set; } + public bool PreferredVendorStatus { get; set; } + public bool ActiveFlag { get; set; } + public string PurchasingWebServiceURL { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductVendors { get; set; } + public virtual ICollection PurchaseOrderHeaders { get; set; } + public virtual ICollection VendorAddresses { get; set; } + public virtual ICollection VendorContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs new file mode 100644 index 000000000..dde11eaf3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class VendorAddress + { + public int VendorID { get; set; } + public int AddressID { get; set; } + public int AddressTypeID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Address Address { get; set; } + public virtual AddressType AddressType { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs new file mode 100644 index 000000000..8cb0fa1f4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class VendorContact + { + public int VendorID { get; set; } + public int ContactID { get; set; } + public int ContactTypeID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual ContactType ContactType { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs new file mode 100644 index 000000000..ee1446abb --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class WorkOrder + { + public WorkOrder() + { + this.WorkOrderRoutings = new HashSet(); + } + + public int WorkOrderID { get; set; } + public int ProductID { get; set; } + public int OrderQty { get; set; } + public int StockedQty { get; set; } + public short ScrappedQty { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public System.DateTime DueDate { get; set; } + public Nullable ScrapReasonID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual ScrapReason ScrapReason { get; set; } + public virtual ICollection WorkOrderRoutings { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs new file mode 100644 index 000000000..32b6792da --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class WorkOrderRouting + { + public int WorkOrderID { get; set; } + public int ProductID { get; set; } + public short OperationSequence { get; set; } + public short LocationID { get; set; } + public System.DateTime ScheduledStartDate { get; set; } + public System.DateTime ScheduledEndDate { get; set; } + public Nullable ActualStartDate { get; set; } + public Nullable ActualEndDate { get; set; } + public Nullable ActualResourceHrs { get; set; } + public decimal PlannedCost { get; set; } + public Nullable ActualCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Location Location { get; set; } + public virtual WorkOrder WorkOrder { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs new file mode 100644 index 000000000..a79b94091 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + + public partial class sysdiagram + { + public string name { get; set; } + public int principal_id { get; set; } + public int diagram_id { get; set; } + public Nullable version { get; set; } + public byte[] definition { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config new file mode 100644 index 000000000..ba200051a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config @@ -0,0 +1,13 @@ + + + + +
+ + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj new file mode 100644 index 000000000..b011aabe8 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj @@ -0,0 +1,334 @@ + + + 618 + DbContextModels + DbContextModels + net472 + 1.0.0.0 + + + + + + + + + + + + + + + + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + True + True + AdventureWorksDbCtx.Context.tt + + + True + True + AdventureWorksDbCtx.tt + + + True + True + AdventureWorksDbCtx.edmx + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + True + True + NorthwindDbCtx.edmx + + + True + True + NorthwindEntities.Context.tt + + + True + True + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + NorthwindEntities.tt + + + + + EntityModelCodeGenerator + NorthwindDbCtx.Designer.cs + DbContextModels + + + + + EntityModelCodeGenerator + AdventureWorksDbCtx.Designer.cs + DbContextModels.AdventureWorks + + + TextTemplatingFileGenerator + AdventureWorksDbCtx.Context.cs + + + TextTemplatingFileGenerator + AdventureWorksDbCtx.cs + + + TextTemplatingFileGenerator + NorthwindEntities.Context.cs + + + TextTemplatingFileGenerator + NorthwindEntities.cs + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs new file mode 100644 index 000000000..dd67ce34f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Category + { + public Category() + { + this.Products = new HashSet(); + } + + public int CategoryID { get; set; } + public string CategoryName { get; set; } + public string Description { get; set; } + public byte[] Picture { get; set; } + + public virtual ICollection Products { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs new file mode 100644 index 000000000..086dc623f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Customer + { + public Customer() + { + this.Orders = new HashSet(); + this.CustomerDemographics = new HashSet(); + } + + public string CustomerID { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string ContactTitle { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Phone { get; set; } + public string Fax { get; set; } + + public virtual ICollection Orders { get; set; } + public virtual ICollection CustomerDemographics { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs new file mode 100644 index 000000000..d5b21a10f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class CustomerDemographic + { + public CustomerDemographic() + { + this.Customers = new HashSet(); + } + + public string CustomerTypeID { get; set; } + public string CustomerDesc { get; set; } + + public virtual ICollection Customers { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs new file mode 100644 index 000000000..2d815246b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Employee + { + public Employee() + { + this.Employees1 = new HashSet(); + this.Orders = new HashSet(); + this.Territories = new HashSet(); + } + + public int EmployeeID { get; set; } + public string LastName { get; set; } + public string FirstName { get; set; } + public string Title { get; set; } + public string TitleOfCourtesy { get; set; } + public Nullable BirthDate { get; set; } + public Nullable HireDate { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string HomePhone { get; set; } + public string Extension { get; set; } + public byte[] Photo { get; set; } + public string Notes { get; set; } + public Nullable ReportsTo { get; set; } + public string PhotoPath { get; set; } + + public virtual ICollection Employees1 { get; set; } + public virtual Employee Employee1 { get; set; } + public virtual ICollection Orders { get; set; } + public virtual ICollection Territories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs new file mode 100644 index 000000000..43bce608d --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs @@ -0,0 +1,4 @@ +// Default code generation is disabled for model 'D:\dd\Alex_AppFx_1\src\AppFx\RiaServices\Main\OpenRiaServices.EntityFramework\Test\DbContextModel\Northwind\NorthwindDbCtx.edmx'. +// To enable default code generation, change the value of the 'Code Generation Strategy' designer +// property to an alternate value. This property is available in the Properties Window when the model is +// open in the designer. \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx new file mode 100644 index 000000000..264a90efc --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx @@ -0,0 +1,934 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs new file mode 100644 index 000000000..40c77642a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Data.Entity; + using System.Data.Entity.Infrastructure; + + public partial class DbCtxNorthwindEntities : DbContext + { + public DbCtxNorthwindEntities() + : base("name=DbCtxNorthwindEntities") + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + + public DbSet Categories { get; set; } + public DbSet CustomerDemographics { get; set; } + public DbSet Customers { get; set; } + public DbSet Employees { get; set; } + public DbSet Order_Details { get; set; } + public DbSet Orders { get; set; } + public DbSet Products { get; set; } + public DbSet Regions { get; set; } + public DbSet Shippers { get; set; } + public DbSet Suppliers { get; set; } + public DbSet Territories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt new file mode 100644 index 000000000..b3ee0b480 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt @@ -0,0 +1,194 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +var loader = new MetadataLoader(this); +var region = new CodeRegion(this); +var inputFile = @"NorthwindDbCtx.edmx"; +var ItemCollection = loader.CreateEdmItemCollection(inputFile); + +Code = new CodeGenerationTools(this); +EFTools = new MetadataTools(this); +ObjectNamespace = Code.VsNamespaceSuggestion(); +ModelNamespace = loader.GetModelNamespace(inputFile); + +EntityContainer container = ItemCollection.GetItems().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +if (!String.IsNullOrEmpty(ObjectNamespace)) +{ +#> +namespace <#=Code.EscapeNamespace(ObjectNamespace)#> +{ +<# + PushIndent(CodeRegion.GetIndent(1)); +} + +#> +using System; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +<# +if (container.FunctionImports.Any()) +{ +#> +using System.Data.Objects; +<# +} +#> + +<#=Accessibility.ForType(container)#> partial class <#=Code.Escape(container)#> : DbContext +{ + public <#=Code.Escape(container)#>() + : base("name=<#=container.Name#>") + { +<# + WriteLazyLoadingEnabled(container); +#> + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + +<# + foreach (var entitySet in container.BaseEntitySets.OfType()) + { +#> + <#=Accessibility.ForReadOnlyProperty(entitySet)#> DbSet<<#=Code.Escape(entitySet.ElementType)#>> <#=Code.Escape(entitySet)#> { get; set; } +<# + } + + foreach (var edmFunction in container.FunctionImports) + { + WriteFunctionImport(edmFunction, false); + } +#> +} +<# + +if (!String.IsNullOrEmpty(ObjectNamespace)) +{ + PopIndent(); +#> +} +<# +} +#> +<#+ +string ModelNamespace { get; set; } +string ObjectNamespace { get; set; } +CodeGenerationTools Code { get; set; } +MetadataTools EFTools { get; set; } + +string GetResourceString(string resourceName) +{ + if(_resourceManager == null) + { + _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); + } + + return _resourceManager.GetString(resourceName, null); +} +System.Resources.ResourceManager _resourceManager; + +void WriteLazyLoadingEnabled(EntityContainer container) +{ + string lazyLoadingAttributeValue = null; + var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; + if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) + { + bool isLazyLoading; + if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading) && !isLazyLoading) + { +#> + this.Configuration.LazyLoadingEnabled = false; +<#+ + } + } +} + +void WriteFunctionImport(EdmFunction edmFunction, bool includeMergeOption) +{ + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, Code, EFTools); + var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); + var returnType = edmFunction.ReturnParameter == null ? null : EFTools.GetElementType(edmFunction.ReturnParameter.TypeUsage); + var processedReturn = returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType) + ">"; + + if (includeMergeOption) + { + paramList = Code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } +#> + + <#=AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction))#> <#=processedReturn#> <#=Code.Escape(edmFunction)#>(<#=paramList#>) + { +<#+ + if(returnType != null && (returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || + returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) + { +#> + ((IObjectContextAdapter)this).ObjectContext.MetadataWorkspace.LoadFromAssembly(typeof(<#=MultiSchemaEscape(returnType)#>).Assembly); + +<#+ + } + + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))"; +#> + var <#=parameter.LocalVariableName#> = <#=isNotNull#> ? + <#=notNullInit#> : + <#=nullInit#>; + +<#+ + } + + var genericArg = returnType == null ? "" : "<" + MultiSchemaEscape(returnType) + ">"; + var callParams = Code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } +#> + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<#=genericArg#>("<#=edmFunction.Name#>"<#=callParams#>); + } +<#+ + if(!includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { + WriteFunctionImport(edmFunction, true); + } +} + +string AccessibilityAndVirtual(string accessibility) +{ + return accessibility + (accessibility != "private" ? " virtual" : ""); +} + +string MultiSchemaEscape(TypeUsage usage) +{ + var type = usage.EdmType as StructuralType; + return type != null && type.NamespaceName != ModelNamespace ? + Code.CreateFullName(Code.EscapeNamespace(type.NamespaceName), Code.Escape(type)) : + Code.Escape(usage); +} + +#> \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs new file mode 100644 index 000000000..0c4c97d77 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt new file mode 100644 index 000000000..b471b6d41 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt @@ -0,0 +1,280 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +CodeGenerationTools code = new CodeGenerationTools(this); +MetadataLoader loader = new MetadataLoader(this); +CodeRegion region = new CodeRegion(this, 1); +MetadataTools ef = new MetadataTools(this); + +string inputFile = @"NorthwindDbCtx.edmx"; +EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile); +string namespaceName = code.VsNamespaceSuggestion(); + +EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this); +WriteHeader(fileManager); + +foreach (var entity in ItemCollection.GetItems().OrderBy(e => e.Name)) +{ + fileManager.StartNewFile(entity.Name + ".cs"); + BeginNamespace(namespaceName, code); +#> +using System; +using System.Collections.Generic; + +<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#><#=code.StringBefore(" : ", code.Escape(entity.BaseType))#> +{ +<# + var propertiesWithDefaultValues = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity && p.DefaultValue != null); + var collectionNavigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + var complexProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == entity); + + if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(entity)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var navigationProperty in collectionNavigationProperties) + { +#> + this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=code.Escape(navigationProperty.ToEndMember.GetEntityType())#>>(); +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var primitiveProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity); + if (primitiveProperties.Any()) + { + foreach (var edmProperty in primitiveProperties) + { + WriteProperty(code, edmProperty); + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var complexProperty in complexProperties) + { + WriteProperty(code, complexProperty); + } + } + + var navigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity); + if (navigationProperties.Any()) + { +#> + +<# + foreach (var navigationProperty in navigationProperties) + { + WriteNavigationProperty(code, navigationProperty); + } + } +#> +} +<# + EndNamespace(namespaceName); +} + +foreach (var complex in ItemCollection.GetItems().OrderBy(e => e.Name)) +{ + fileManager.StartNewFile(complex.Name + ".cs"); + BeginNamespace(namespaceName, code); +#> +using System; + +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> +{ +<# + var complexProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == complex); + var propertiesWithDefaultValues = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex && p.DefaultValue != null); + + if (propertiesWithDefaultValues.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(complex)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var primitiveProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex); + if (primitiveProperties.Any()) + { + foreach(var edmProperty in primitiveProperties) + { + WriteProperty(code, edmProperty); + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var edmProperty in complexProperties) + { + WriteProperty(code, edmProperty); + } + } +#> +} +<# + EndNamespace(namespaceName); +} + +if (!VerifyTypesAreCaseInsensitiveUnique(ItemCollection)) +{ + return ""; +} + +fileManager.Process(); + +#> +<#+ +string GetResourceString(string resourceName) +{ + if(_resourceManager == null) + { + _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); + } + + return _resourceManager.GetString(resourceName, null); +} +System.Resources.ResourceManager _resourceManager; + +void WriteHeader(EntityFrameworkTemplateFileManager fileManager) +{ + fileManager.StartHeader(); +#> +//------------------------------------------------------------------------------ +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<#+ + fileManager.EndBlock(); +} + +void BeginNamespace(string namespaceName, CodeGenerationTools code) +{ + CodeRegion region = new CodeRegion(this); + if (!String.IsNullOrEmpty(namespaceName)) + { +#> +namespace <#=code.EscapeNamespace(namespaceName)#> +{ +<#+ + PushIndent(CodeRegion.GetIndent(1)); + } +} + + +void EndNamespace(string namespaceName) +{ + if (!String.IsNullOrEmpty(namespaceName)) + { + PopIndent(); +#> +} +<#+ + } +} + +void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty) +{ + WriteProperty(Accessibility.ForProperty(edmProperty), + code.Escape(edmProperty.TypeUsage), + code.Escape(edmProperty), + code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + code.SpaceAfter(Accessibility.ForSetter(edmProperty))); +} + +void WriteNavigationProperty(CodeGenerationTools code, NavigationProperty navigationProperty) +{ + var endType = code.Escape(navigationProperty.ToEndMember.GetEntityType()); + WriteProperty(PropertyVirtualModifier(Accessibility.ForProperty(navigationProperty)), + navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + code.Escape(navigationProperty), + code.SpaceAfter(Accessibility.ForGetter(navigationProperty)), + code.SpaceAfter(Accessibility.ForSetter(navigationProperty))); +} + +void WriteProperty(string accessibility, string type, string name, string getterAccessibility, string setterAccessibility) +{ +#> + <#=accessibility#> <#=type#> <#=name#> { <#=getterAccessibility#>get; <#=setterAccessibility#>set; } +<#+ +} + +string PropertyVirtualModifier(string accessibility) +{ + return accessibility + (accessibility != "private" ? " virtual" : ""); +} + +bool VerifyTypesAreCaseInsensitiveUnique(EdmItemCollection itemCollection) +{ + var alreadySeen = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach(var type in itemCollection.GetItems()) + { + if (!(type is EntityType || type is ComplexType)) + { + continue; + } + + if (alreadySeen.ContainsKey(type.FullName)) + { + Error(String.Format(CultureInfo.CurrentCulture, "This template does not support types that differ only by case, the types {0} are not supported", type.FullName)); + return false; + } + else + { + alreadySeen.Add(type.FullName, true); + } + } + + return true; +} +#> diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs new file mode 100644 index 000000000..d1ff0e33e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs @@ -0,0 +1,135 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using OpenRiaServices.Server; + +// These assembly attributes allow us to serialize different CLR types into the same contract +[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", + ClrNamespace = "DbContextModels.Northwind")] + +namespace DbContextModels.Northwind +{ + public partial class DbCtxNorthwindEntities + { + public DbCtxNorthwindEntities(string connection) + : base(connection) + { + } + } + + [MetadataType(typeof(RegionMetadata))] + public partial class Region + { + } + + public static class RegionMetadata + { + [Composition] + [Include] + public static object Territories; + } + + /// + /// Non DAL projection type used to verify that such types can be returned + /// from the provider + /// + public class ProductInfo + { + public static ProductInfo CreateProductInfo(int productID, string productName, string categoryName, string supplierName) + { + ProductInfo prodInfo = new ProductInfo(); + prodInfo.ProductID = productID; + prodInfo.ProductName = productName; + prodInfo.CategoryName = categoryName; + prodInfo.SupplierName = supplierName; + return prodInfo; + } + + [Key] + public int ProductID + { + get; + set; + } + + public string ProductName + { + get; + set; + } + + [Editable(false)] + public string CategoryName + { + get; + set; + } + + [Editable(false)] + public string SupplierName + { + get; + set; + } + } + + [MetadataType(typeof(OrderMetadata))] + public partial class Order + { + // Calculated property. Used to test that user-defined properties work properly. + [DataMember] + public string FormattedName + { + get + { + return "OrderID: " + this.OrderID.ToString(); + } + } + } + + [MetadataType(typeof(OrderDetailMetadata))] + public partial class Order_Detail + { + } + + public static class OrderMetadata + { + [Include] + public static object Order_Details; + } + + public static class OrderDetailMetadata + { + [Include] + public static object Product; + } + + [MetadataType(typeof(ProductMetadata))] + public partial class Product + { + private string _resolveMethod = String.Empty; + + // Additional data member to enable resolve logic to differ based on the test scenario string being passed in + [DataMember] + public string ResolveMethod + { + get + { + return _resolveMethod; + } + set + { + _resolveMethod = value; + } + } + } + + public static class ProductMetadata + { + [Include("CategoryName", "CategoryName")] + public static object Category; + + [Include("CompanyName", "SupplierName")] + public static object Supplier; + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs new file mode 100644 index 000000000..97ff7df75 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Order + { + public Order() + { + this.Order_Details = new HashSet(); + } + + public int OrderID { get; set; } + public string CustomerID { get; set; } + public Nullable EmployeeID { get; set; } + public Nullable OrderDate { get; set; } + public Nullable RequiredDate { get; set; } + public Nullable ShippedDate { get; set; } + public Nullable ShipVia { get; set; } + public Nullable Freight { get; set; } + public string ShipName { get; set; } + public string ShipAddress { get; set; } + public string ShipCity { get; set; } + public string ShipRegion { get; set; } + public string ShipPostalCode { get; set; } + public string ShipCountry { get; set; } + + public virtual Customer Customer { get; set; } + public virtual Employee Employee { get; set; } + public virtual ICollection Order_Details { get; set; } + public virtual Shipper Shipper { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs new file mode 100644 index 000000000..7935da1e5 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Order_Detail + { + public int OrderID { get; set; } + public int ProductID { get; set; } + public decimal UnitPrice { get; set; } + public short Quantity { get; set; } + public float Discount { get; set; } + + public virtual Order Order { get; set; } + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs new file mode 100644 index 000000000..d8f6ef3bb --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Product + { + public Product() + { + this.Order_Details = new HashSet(); + } + + public int ProductID { get; set; } + public string ProductName { get; set; } + public Nullable SupplierID { get; set; } + public Nullable CategoryID { get; set; } + public string QuantityPerUnit { get; set; } + public Nullable UnitPrice { get; set; } + public Nullable UnitsInStock { get; set; } + public Nullable UnitsOnOrder { get; set; } + public Nullable ReorderLevel { get; set; } + public bool Discontinued { get; set; } + + public virtual Category Category { get; set; } + public virtual ICollection Order_Details { get; set; } + public virtual Supplier Supplier { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs new file mode 100644 index 000000000..b66528e8d --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Region + { + public Region() + { + this.Territories = new HashSet(); + } + + public int RegionID { get; set; } + public string RegionDescription { get; set; } + + public virtual ICollection Territories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs new file mode 100644 index 000000000..fc9b1173b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Shipper + { + public Shipper() + { + this.Orders = new HashSet(); + } + + public int ShipperID { get; set; } + public string CompanyName { get; set; } + public string Phone { get; set; } + + public virtual ICollection Orders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs new file mode 100644 index 000000000..f16a1b9b4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Supplier + { + public Supplier() + { + this.Products = new HashSet(); + } + + public int SupplierID { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string ContactTitle { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Phone { get; set; } + public string Fax { get; set; } + public string HomePage { get; set; } + + public virtual ICollection Products { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs new file mode 100644 index 000000000..d061a28aa --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + using System; + using System.Collections.Generic; + + public partial class Territory + { + public Territory() + { + this.Employees = new HashSet(); + } + + public string TerritoryID { get; set; } + public string TerritoryDescription { get; set; } + public int RegionID { get; set; } + + public virtual Region Region { get; set; } + public virtual ICollection Employees { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Properties/AssemblyInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..33e967e9e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM componenets. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a122da4b-cec9-4958-a0aa-ebf197bc5cfd")] + +// TODO: review -- v4.0 security model assumes transparent, making unit tests fail to build if this is set +// [assembly: AllowPartiallyTrustedCallers] diff --git a/src/RiaServices.sln b/src/RiaServices.sln index 6f929ff16..dbdd62789 100644 --- a/src/RiaServices.sln +++ b/src/RiaServices.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31717.71 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31624.102 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{1CED8364-77AC-4254-869F-1E4EC5A33416}" EndProject @@ -140,6 +140,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Server.Unit EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Client.DomainClients.Http", "OpenRiaServices.Client.DomainClients.Http\Framework\OpenRiaServices.Client.DomainClients.Http.csproj", "{92A7B751-DF5E-40AA-8846-C9ABAD8DA6AA}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Server.EntityFrameworkCore", "OpenRiaServices.Server.EntityFrameworkCore\Framework\OpenRiaServices.Server.EntityFrameworkCore.csproj", "{B8D39090-3B76-41BB-A139-956E42619E91}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreCodeFirstModels", "OpenRiaServices.Server.EntityFrameworkCore\Test\CodeFirstModel\EFCoreCodeFirstModels.csproj", "{D18943F4-49C8-49E5-A658-1FD4E59C7E0D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreDbContextModels", "OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\EFCoreDbContextModels.csproj", "{6F468ADB-5799-4C24-93C5-765120AAAA4E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -338,6 +344,18 @@ Global {92A7B751-DF5E-40AA-8846-C9ABAD8DA6AA}.Debug|Any CPU.Build.0 = Debug|Any CPU {92A7B751-DF5E-40AA-8846-C9ABAD8DA6AA}.Release|Any CPU.ActiveCfg = Release|Any CPU {92A7B751-DF5E-40AA-8846-C9ABAD8DA6AA}.Release|Any CPU.Build.0 = Release|Any CPU + {B8D39090-3B76-41BB-A139-956E42619E91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B8D39090-3B76-41BB-A139-956E42619E91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B8D39090-3B76-41BB-A139-956E42619E91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B8D39090-3B76-41BB-A139-956E42619E91}.Release|Any CPU.Build.0 = Release|Any CPU + {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Release|Any CPU.Build.0 = Release|Any CPU + {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -403,6 +421,9 @@ Global {91239B86-30A2-42A8-AA8D-E6F0D2BB2F00} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} {7026BE35-4A31-4C10-B9C8-98BA36D333C5} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} {92A7B751-DF5E-40AA-8846-C9ABAD8DA6AA} = {5612B0C3-4314-4795-ACA9-DDC5F25AE04D} + {B8D39090-3B76-41BB-A139-956E42619E91} = {2095B11C-903C-47FF-B812-82DFA7A068AC} + {D18943F4-49C8-49E5-A658-1FD4E59C7E0D} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} + {6F468ADB-5799-4C24-93C5-765120AAAA4E} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C135CEC9-180C-4B67-92AC-3342375AE14C} From cfe67363df33b53f08ad2077b6e26e4f30b6571b Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Tue, 19 Oct 2021 12:17:19 +0200 Subject: [PATCH 02/99] Remove not needed DB context --- .../Framework/LinqToEntitiesDomainService.cs | 304 ------------------ 1 file changed, 304 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs deleted file mode 100644 index be0948749..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs +++ /dev/null @@ -1,304 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -#if DBCONTEXT -using System.Data.Entity; -using System.Data.Entity.Core; -using System.Data.Entity.Core.Objects; -using System.Data.Entity.Infrastructure; -#else -using System.Data; -using System.Data.Objects; -#endif -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using OpenRiaServices.Server; - -namespace OpenRiaServices.EntityFramework -{ - /// - /// Base class for DomainServices operating on LINQ To Entities data models - /// - /// The Type of the LINQ To Entities ObjectContext - [LinqToEntitiesDomainServiceDescriptionProvider] - public abstract class LinqToEntitiesDomainService : DomainService where TContext : ObjectContext, new() - { - private TContext _objectContext; - private TContext _refreshContext; - - /// - /// Protected constructor because this is an abstract class - /// - protected LinqToEntitiesDomainService() - { - } - - /// - /// Gets the - /// - protected internal TContext ObjectContext - { - get - { - if (this._objectContext == null) - { - this._objectContext = this.CreateObjectContext(); - } - return this._objectContext; - } - } - - /// - /// Initializes this . must be called - /// prior to invoking any operations on the instance. - /// - /// The for this - /// instance. Overrides must call the base method. - public override void Initialize(DomainServiceContext context) - { - base.Initialize(context); - - // If we're going to process a query, we want to turn deferred loading - // off, since the framework will access association members marked - // with IncludeAttribute and we don't want to cause deferred loads. However, - // for other operation types, we don't want to interfere. - if (context.OperationType == DomainOperationType.Query) - { - this.ObjectContext.ContextOptions.LazyLoadingEnabled = false; - } - - // We turn this off, since our deserializer isn't going to create - // the EF proxy types anyways. Proxies only really work if the entities - // are queried on the server. - this.ObjectContext.ContextOptions.ProxyCreationEnabled = false; - } - - /// - /// Gets the used by retrieving store values - /// - private ObjectContext RefreshContext - { - get - { - if (this._refreshContext == null) - { - this._refreshContext = this.CreateObjectContext(); - } - return this._refreshContext; - } - } - - /// - /// Creates and returns the instance that will - /// be used by this provider. - /// - /// The ObjectContext - protected virtual TContext CreateObjectContext() - { - return new TContext(); - } - - /// - /// See . - /// - /// A indicating whether or not the instance is currently disposing. - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (this._objectContext != null) - { - this._objectContext.Dispose(); - } - if (this._refreshContext != null) - { - this._refreshContext.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// Gets the number of rows in an . - /// - /// The element Type of the query. - /// The query for which the count should be returned. - /// which may be used by hosting layer to request cancellation - /// The total number of rows. - protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) - { - return QueryHelper.CountAsync(query, cancellationToken); - } - - /// - /// Enumerates the specified enumerable to guarantee eager execution. - /// If possible code similar to ToListAsync is used, but with optimizations to start with a larger initial capacity - /// - /// The element type of the enumerable. - /// The enumerable to enumerate. - /// The estimated number of items the enumerable will yield. - /// which may be used by hosting layer to request cancellation - /// A new enumerable with the results of the enumerated enumerable. - protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) - { - // EF will throw if provider is not a IDbAsyncEnumerable - if (enumerable is IDbAsyncEnumerable asyncEnumerable) - { - return QueryHelper.EnumerateAsyncEnumerable(asyncEnumerable, estimatedResultCount, cancellationToken); - } - else - { - return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); - } - } - - /// - /// This method is called to finalize changes after all the operations in the specified changeset - /// have been invoked. All changes are committed to the ObjectContext, and any resulting optimistic - /// concurrency errors are processed. - /// - /// which may be used by hosting layer to request cancellation - /// True if the was persisted successfully, false otherwise. - protected override ValueTask PersistChangeSetAsync(CancellationToken cancellationToken) - { - return new ValueTask(this.InvokeSaveChangesAsync(true, cancellationToken)); - } - - private async Task InvokeSaveChangesAsync(bool retryOnConflict, CancellationToken cancellationToken) - { - try - { - await this.ObjectContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false); - } - catch (OptimisticConcurrencyException ex) - { - // Map the operations that could have caused a conflict to an entity. - Dictionary operationConflictMap = new Dictionary(); - foreach (ObjectStateEntry conflict in ex.StateEntries) - { - ChangeSetEntry entry = this.ChangeSet.ChangeSetEntries.SingleOrDefault(p => object.ReferenceEquals(p.Entity, conflict.Entity)); - if (entry == null) - { - // If we're unable to find the object in our changeset, propagate - // the original exception - throw; - } - operationConflictMap.Add(conflict, entry); - } - - this.SetChangeSetConflicts(operationConflictMap); - - // Call out to any user resolve code and resubmit if all conflicts - // were resolved - if (retryOnConflict && this.ResolveConflicts(ex.StateEntries)) - { - // clear the conflics from the entries - foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) - { - entry.StoreEntity = null; - entry.ConflictMembers = null; - entry.IsDeleteConflict = false; - } - - // If all conflicts were resolved attempt a resubmit - return await this.InvokeSaveChangesAsync(/* retryOnConflict */ false, cancellationToken).ConfigureAwait(false); - } - - // if the conflict wasn't resolved, call the error handler - this.OnError(new DomainServiceErrorInfo(ex)); - - // if there was a conflict but no conflict information was - // extracted to the individual entries, we need to ensure the - // error makes it back to the client - if (!this.ChangeSet.HasError) - { - throw; - } - - return false; - } - - return true; - } - - /// - /// This method is called to finalize changes after all the operations in the specified changeset - /// have been invoked. All changes are committed to the ObjectContext. - /// If the submit fails due to concurrency conflicts will be called. - /// If returns true a single resubmit will be attempted. - /// - /// - /// The list of concurrency conflicts that occurred - /// Returns true if the was persisted successfully, false otherwise. - protected virtual bool ResolveConflicts(IEnumerable conflicts) - { - return false; - } - - /// - /// Updates each entry in the ChangeSet with its corresponding conflict info. - /// - /// Map of conflicts to their corresponding operations entries. - private void SetChangeSetConflicts(Dictionary operationConflictMap) - { - object storeValue; - EntityKey refreshEntityKey; - - foreach (var conflictEntry in operationConflictMap) - { - ObjectStateEntry stateEntry = conflictEntry.Key; - - if (stateEntry.State == EntityState.Unchanged) - { - continue; - } - - // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. - ChangeSetEntry operationInConflict = conflictEntry.Value; - refreshEntityKey = this.RefreshContext.CreateEntityKey(stateEntry.EntitySet.Name, stateEntry.Entity); - this.RefreshContext.TryGetObjectByKey(refreshEntityKey, out storeValue); - operationInConflict.StoreEntity = storeValue; - - // StoreEntity will be null if the entity has been deleted in the store (i.e. Delete/Delete conflict) - bool isDeleted = (operationInConflict.StoreEntity == null); - if (isDeleted) - { - operationInConflict.IsDeleteConflict = true; - } - else - { - // Determine which members are in conflict by comparing original values to the current DB values - PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); - List membersInConflict = new List(); - object originalValue; - PropertyDescriptor pd; - for (int i = 0; i < stateEntry.OriginalValues.FieldCount; i++) - { - originalValue = stateEntry.OriginalValues.GetValue(i); - if (originalValue is DBNull) - { - originalValue = null; - } - - string propertyName = stateEntry.OriginalValues.GetName(i); - pd = propDescriptors[propertyName]; - if (pd == null) - { - // This might happen in the case of a private model - // member that isn't mapped - continue; - } - - if (!object.Equals(originalValue, pd.GetValue(operationInConflict.StoreEntity))) - { - membersInConflict.Add(pd.Name); - } - } - operationInConflict.ConflictMembers = membersInConflict; - } - } - } - } -} From 4068cde24f5cff3a057f9e237c5e35058d38c1d2 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Tue, 19 Oct 2021 12:18:20 +0200 Subject: [PATCH 03/99] Added todo and added EF Core to test project EFCodeCoreFirstModel --- .../LinqToEntitiesDomainServiceDescriptionProvider.cs | 2 ++ ...LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs | 3 +++ .../OpenRiaServices.Server.EntityFrameworkCore.csproj | 4 +--- .../Test/CodeFirstModel/EFCoreCodeFirstModels.csproj | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs index 68b3e4d2e..a7a080240 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs @@ -13,6 +13,8 @@ namespace OpenRiaServices.EntityFramework { + // TODO: Remove and move code to DB context + internal class LinqToEntitiesDomainServiceDescriptionProvider : DomainServiceDescriptionProvider { private static Dictionary tdpContextMap = new Dictionary(); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs index 04202c832..01ef8b286 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs @@ -10,6 +10,9 @@ namespace OpenRiaServices.EntityFramework { + + // TODO: Remove and move code to DB context + /// /// Attribute applied to a that exposes LINQ to Entities mapped /// Types. diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 67279cef4..4a5354145 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -3,9 +3,6 @@ net472 $(DefineConstants);SERVERFX;DBCONTEXT;net472; - - - @@ -13,6 +10,7 @@ + True True diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj index b7a6bb672..cec3bcf82 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj @@ -12,7 +12,7 @@ - + From 6519ffa7a567d6fe5908539f51919d3bd8bfcbb5 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 20 Oct 2021 08:14:32 +0200 Subject: [PATCH 04/99] Made everything compile. --- .../Framework/AssociationInfo.cs | 2 +- .../Framework/DbContextExtensions.cs | 22 ++- .../Framework/DbDomainService.cs | 139 +++++------------- ...mainServiceDescriptionProviderAttribute.cs | 4 +- .../Framework/DbResource.Designer.cs | 4 +- .../Framework/GlobalSuppressions.cs | 18 +-- ...ntitiesDomainServiceDescriptionProvider.cs | 6 +- ...mainServiceDescriptionProviderAttribute.cs | 18 +-- .../LinqToEntitiesTypeDescriptionContext.cs | 7 +- .../Framework/LinqToEntitiesTypeDescriptor.cs | 15 +- .../Framework/MetadataResource.Designer.cs | 2 +- .../Framework/MetadataWorkspaceUtilities.cs | 37 +---- .../Framework/ObjectContextExtensions.cs | 91 ------------ .../Framework/ObjectContextUtilities.cs | 91 +++--------- ...Services.Server.EntityFrameworkCore.csproj | 1 + .../Framework/QueryHelper.cs | 25 +--- .../Framework/Resource.Designer.cs | 4 +- .../CodeFirstModel/CustomerDemographic.cs | 8 +- .../Test/CodeFirstModel/DbContextModel.cs | 53 ++++--- .../EFCoreCodeFirstModels.csproj | 10 ++ .../Test/CodeFirstModel/Employee.cs | 4 +- .../CodeFirstModel/EmployeeTerritories.cs | 14 ++ .../Test/CodeFirstModel/Territory.cs | 4 +- 23 files changed, 173 insertions(+), 406 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs index 19e1a187e..cca96aac6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs @@ -1,4 +1,4 @@ -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { /// /// Information about an Association diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs index 70a9cb730..dae366578 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs @@ -1,11 +1,8 @@ using System; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Data.Entity; -using System.Data.Entity.Core.Objects; -using System.Data.Entity.Infrastructure; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.ChangeTracking; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { /// /// DbContext extension methods for DbDomainService authors. @@ -21,7 +18,7 @@ public static class DbContextExtensions /// The current entity. /// The original entity. /// The corresponding - public static void AttachAsModified(this IDbSet dbSet, T current, T original, DbContext dbContext) where T : class + public static void AttachAsModified(this DbSet dbSet, T current, T original, DbContext dbContext) where T : class { if (dbSet == null) { @@ -40,7 +37,7 @@ public static void AttachAsModified(this IDbSet dbSet, T current, T origin throw new ArgumentNullException(nameof(dbContext)); } - DbEntityEntry entityEntry = dbContext.Entry(current); + EntityEntry entityEntry = dbContext.Entry(current); if (entityEntry.State == EntityState.Detached) { dbSet.Attach(current); @@ -50,8 +47,9 @@ public static void AttachAsModified(this IDbSet dbSet, T current, T origin entityEntry.State = EntityState.Modified; } - ObjectContext objectContext = (dbContext as IObjectContextAdapter).ObjectContext; - ObjectStateEntry stateEntry = ObjectContextUtilities.AttachAsModifiedInternal(current, original, objectContext); + // TODO: Look into this + var changeTracker = dbContext.ChangeTracker; + var stateEntry = ObjectContextUtilities.AttachAsModifiedInternal(current, original, changeTracker); if (stateEntry.State != EntityState.Modified) { @@ -70,7 +68,7 @@ public static void AttachAsModified(this IDbSet dbSet, T current, T origin /// The to attach to /// The current entity /// The coresponding - public static void AttachAsModified(this IDbSet dbSet, T entity, DbContext dbContext) where T : class + public static void AttachAsModified(this DbSet dbSet, T entity, DbContext dbContext) where T : class { if (dbSet == null) { @@ -85,7 +83,7 @@ public static void AttachAsModified(this IDbSet dbSet, T entity, DbContext throw new ArgumentNullException(nameof(dbContext)); } - DbEntityEntry entityEntry = dbContext.Entry(entity); + EntityEntry entityEntry = dbContext.Entry(entity); if (entityEntry.State == EntityState.Detached) { // attach the entity diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs index 888791cf4..d2089512e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs @@ -2,18 +2,14 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; -using System.Data; -using System.Data.Entity; -using System.Data.Entity.Core; -using System.Data.Entity.Core.Objects; -using System.Data.Entity.Infrastructure; -using System.Globalization; +using Microsoft.EntityFrameworkCore; using System.Linq; using System.Threading; using System.Threading.Tasks; using OpenRiaServices.Server; +using Microsoft.EntityFrameworkCore.ChangeTracking; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { /// /// Base class for DomainServices operating on LINQ To Entities DbContext based data models @@ -24,7 +20,6 @@ public abstract class DbDomainService : DomainService where TContext : DbContext, new() { private TContext _dbContext; - private ObjectContext _refreshContext; /// /// Protected constructor for the abstract class. @@ -42,20 +37,6 @@ protected DbDomainService() public override void Initialize(DomainServiceContext context) { base.Initialize(context); - - ObjectContext objectContext = ((IObjectContextAdapter)this.DbContext).ObjectContext; - // We turn this off, since our deserializer isn't going to create - // the EF proxy types anyways. Proxies only really work if the entities - // are queried on the server. - objectContext.ContextOptions.ProxyCreationEnabled = false; - - // Turn off DbContext validation. - this.DbContext.Configuration.ValidateOnSaveEnabled = false; - - // Turn off AutoDetectChanges. - this.DbContext.Configuration.AutoDetectChangesEnabled = false; - - this.DbContext.Configuration.LazyLoadingEnabled = false; } /// @@ -66,23 +47,7 @@ protected virtual TContext CreateDbContext() { return new TContext(); } - - /// - /// Gets the used for retrieving store values - /// - private ObjectContext RefreshContext - { - get - { - if (this._refreshContext == null) - { - DbContext dbContext = this.CreateDbContext(); - this._refreshContext = (dbContext as IObjectContextAdapter).ObjectContext; - } - return this._refreshContext; - } - } - + /// /// Gets the /// @@ -121,15 +86,7 @@ protected override ValueTask CountAsync(IQueryable query, Cancellatio /// A new enumerable with the results of the enumerated enumerable. protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) { - // EF will throw if provider is not a IDbAsyncEnumerable - if (enumerable is IDbAsyncEnumerable asyncEnumerable) - { - return QueryHelper.EnumerateAsyncEnumerable(asyncEnumerable, estimatedResultCount, cancellationToken); - } - else - { - return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); - } + return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); } @@ -153,7 +110,7 @@ protected override ValueTask PersistChangeSetAsync(CancellationToken cance /// /// The list of concurrency conflicts that occurred /// Returns true if the was persisted successfully, false otherwise. - protected virtual bool ResolveConflicts(IEnumerable conflicts) + protected virtual bool ResolveConflicts(IEnumerable conflicts) { return false; } @@ -170,10 +127,6 @@ protected override void Dispose(bool disposing) { this.DbContext.Dispose(); } - if (this._refreshContext != null) - { - this._refreshContext.Dispose(); - } } base.Dispose(disposing); } @@ -193,8 +146,8 @@ private async Task InvokeSaveChangesAsync(bool retryOnConflict, Cancellati catch (DbUpdateConcurrencyException ex) { // Map the operations that could have caused a conflict to an entity. - Dictionary operationConflictMap = new Dictionary(); - foreach (DbEntityEntry conflict in ex.Entries) + Dictionary operationConflictMap = new Dictionary(); + foreach (EntityEntry conflict in ex.Entries) { ChangeSetEntry entry = this.ChangeSet.ChangeSetEntries.SingleOrDefault(p => object.ReferenceEquals(p.Entity, conflict.Entity)); if (entry == null) @@ -243,71 +196,49 @@ private async Task InvokeSaveChangesAsync(bool retryOnConflict, Cancellati /// Updates each entry in the ChangeSet with its corresponding conflict info. /// /// Map of conflicts to their corresponding operations entries. - private void SetChangeSetConflicts(Dictionary operationConflictMap) + private void SetChangeSetConflicts(Dictionary operationConflictMap) { - object storeValue; - EntityKey refreshEntityKey; - - ObjectContext objectContext = ((IObjectContextAdapter)this.DbContext).ObjectContext; - ObjectStateManager objectStateManager = objectContext.ObjectStateManager; - if (objectStateManager == null) - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, DbResource.ObjectStateManagerNotFoundException, this.DbContext.GetType().Name)); - } - foreach (var conflictEntry in operationConflictMap) { - DbEntityEntry entityEntry = conflictEntry.Key; - ObjectStateEntry stateEntry = objectStateManager.GetObjectStateEntry(entityEntry.Entity); - - if (stateEntry.State == EntityState.Unchanged) + EntityEntry stateEntry = conflictEntry.Key; + + if (stateEntry.State == Microsoft.EntityFrameworkCore.EntityState.Unchanged) { continue; } // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. ChangeSetEntry operationInConflict = conflictEntry.Value; - refreshEntityKey = this.RefreshContext.CreateEntityKey(stateEntry.EntitySet.Name, stateEntry.Entity); - this.RefreshContext.TryGetObjectByKey(refreshEntityKey, out storeValue); - operationInConflict.StoreEntity = storeValue; - // StoreEntity will be null if the entity has been deleted in the store (i.e. Delete/Delete conflict) - bool isDeleted = (operationInConflict.StoreEntity == null); - if (isDeleted) - { - operationInConflict.IsDeleteConflict = true; - } - else + // Determine which members are in conflict by comparing original values to the current DB values + PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); + List membersInConflict = new List(); + object originalValue; + PropertyDescriptor pd; + foreach (var prop in stateEntry.OriginalValues.Properties) { - // Determine which members are in conflict by comparing original values to the current DB values - PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); - List membersInConflict = new List(); - object originalValue; - PropertyDescriptor pd; - for (int i = 0; i < stateEntry.OriginalValues.FieldCount; i++) + originalValue = stateEntry.OriginalValues.GetValue(prop.Name); + if (originalValue is DBNull) { - originalValue = stateEntry.OriginalValues.GetValue(i); - if (originalValue is DBNull) - { - originalValue = null; - } + originalValue = null; + } - string propertyName = stateEntry.OriginalValues.GetName(i); - pd = propDescriptors[propertyName]; - if (pd == null) - { - // This might happen in the case of a private model - // member that isn't mapped - continue; - } + string propertyName = prop.Name; + pd = propDescriptors[propertyName]; + if (pd == null) + { + // This might happen in the case of a private model + // member that isn't mapped + continue; + } - if (!object.Equals(originalValue, pd.GetValue(operationInConflict.StoreEntity))) - { - membersInConflict.Add(pd.Name); - } + if (!object.Equals(originalValue, pd.GetValue(operationInConflict.StoreEntity))) + { + membersInConflict.Add(pd.Name); } - operationInConflict.ConflictMembers = membersInConflict; } + operationInConflict.ConflictMembers = membersInConflict; + } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs index 288bfb6d2..dcfcf7206 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs @@ -1,10 +1,10 @@ using System; using System.ComponentModel; -using System.Data.Entity; +using Microsoft.EntityFrameworkCore; using System.Globalization; using OpenRiaServices.Server; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { /// /// Attribute applied to a that exposes LINQ to Entities mapped diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs index 5be5963ea..ae4181fff 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace OpenRiaServices.EntityFramework { +namespace OpenRiaServices.EntityFrameworkCore { using System; @@ -39,7 +39,7 @@ internal DbResource() { public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.DbResource", typeof(DbResource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.DbResource", typeof(DbResource).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs index 1de701ead..d87514f15 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs @@ -8,13 +8,13 @@ // "In Project Suppression File". // You do not need to add suppressions to this file manually. -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "OpenRiaServices.EntityFramework.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "OpenRiaServices.EntityFramework.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFramework.DbDomainService`1.#CreateDbContext()", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFramework.DbDomainService`1.#DbContext", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFramework.DbDomainServiceDescriptionProviderAttribute.#DbContextType", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFramework.DbContextExtensions", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFramework.DbDomainService`1", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFramework.DbDomainServiceDescriptionProviderAttribute", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainService`1.#CreateDbContext()", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainService`1.#DbContext", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainServiceDescriptionProviderAttribute.#DbContextType", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFrameworkCore.DbContextExtensions", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainService`1", Justification = "Following the naming convention of EntityFramework.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainServiceDescriptionProviderAttribute", Justification = "Following the naming convention of EntityFramework.")] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Assemblies are delay signed.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "OpenRiaServices.EntityFramework.AssociationInfo.#IsRequired", Justification = "Code shared with other projects.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.AssociationInfo.#IsRequired", Justification = "Code shared with other projects.")] diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs index a7a080240..528fbe4d7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs @@ -1,17 +1,13 @@ using System; using System.Collections.Generic; using System.ComponentModel; -#if DBCONTEXT -using System.Data.Entity.Core.Metadata.Edm; -#else using System.Data.Metadata.Edm; -#endif #if RIACONTRIB using System.ServiceModel.DomainServices.Server; #endif using OpenRiaServices.Server; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { // TODO: Remove and move code to DB context diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs index 01ef8b286..f8d8da086 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs @@ -1,14 +1,9 @@ using System; using System.ComponentModel; -#if DBCONTEXT -using System.Data.Entity.Core.Objects; -#else -using System.Data.Objects; -#endif using System.Globalization; using OpenRiaServices.Server; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { // TODO: Remove and move code to DB context @@ -72,13 +67,6 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi this._objectContextType = GetContextType(domainServiceType); } - if (!typeof(ObjectContext).IsAssignableFrom(this._objectContextType)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, - Resource.InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification, - this._objectContextType)); - } - return new LinqToEntitiesDomainServiceDescriptionProvider(domainServiceType, this._objectContextType, parent); } @@ -90,13 +78,13 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi private static Type GetContextType(Type domainServiceType) { Type efDomainServiceType = domainServiceType.BaseType; - while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(LinqToEntitiesDomainService<>)) + while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DomainService)) { if (efDomainServiceType == typeof(object)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.InvalidMetadataProviderSpecification, - typeof(LinqToEntitiesDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(LinqToEntitiesDomainService<>).Name)); + typeof(LinqToEntitiesDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DomainService).Name)); } efDomainServiceType = efDomainServiceType.BaseType; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs index 2b0e62a50..4aec671b3 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs @@ -2,17 +2,12 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Data.Mapping; -#if DBCONTEXT -using System.Data.Entity.Core.Metadata.Edm; -#else using System.Data.Metadata.Edm; -#endif using System.Globalization; using System.Linq; -using System.Reflection; using OpenRiaServices.Server; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { /// /// Metadata context for LINQ To Entities domain services diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs index 9d601d23f..1d5eb33f8 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs @@ -6,20 +6,13 @@ using System.ServiceModel.DomainServices.Server; #endif using System.ComponentModel.DataAnnotations.Schema; -#if DBCONTEXT -using System.Data.Entity.Core.Metadata.Edm; -using System.Data.Entity.Core.Objects.DataClasses; -using System.Data.Entity; -#else -using System.Data; -using System.Data.Metadata.Edm; -using System.Data.Objects.DataClasses; -#endif - +using Microsoft.EntityFrameworkCore; using System.Linq; using OpenRiaServices.Server; +using System.Data.Metadata.Edm; +using System.Data.Objects.DataClasses; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { /// /// CustomTypeDescriptor for LINQ To Entities diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs index b72fe9543..2f927a582 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs @@ -39,7 +39,7 @@ internal MetadataResource() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.MetadataResource", typeof(MetadataResource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.MetadataResource", typeof(MetadataResource).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs index 54c4d9b25..00eb04423 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs @@ -1,18 +1,10 @@ using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -#if DBCONTEXT -using System.Data.Entity.Core.Metadata.Edm; -using System.Data.Entity.Core.Objects; -using System.Data.Entity.Core.Mapping; -#else -using System.Data.Metadata.Edm; -using System.Data.Objects; -using System.Data.Mapping; -#endif using System.Globalization; using System.Linq; using System.Reflection; using OpenRiaServices; +using System.Data.Metadata.Edm; +using Microsoft.EntityFrameworkCore; namespace System.Data.Mapping { @@ -34,19 +26,17 @@ public static MetadataWorkspace CreateMetadataWorkspace(Type contextType) metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(ObjectContext)); #else - metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(System.Data.Entity.DbContext)); - if (metadataWorkspace == null && typeof(System.Data.Entity.DbContext).IsAssignableFrom(contextType)) + metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(DbContext)); + if (metadataWorkspace == null && typeof(DbContext).IsAssignableFrom(contextType)) { if (contextType.GetConstructor(Type.EmptyTypes) == null) { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFramework.DbResource.DefaultCtorNotFound, contextType.FullName)); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFrameworkCore.DbResource.DefaultCtorNotFound, contextType.FullName)); } try { - System.Data.Entity.DbContext dbContext = Activator.CreateInstance(contextType) as System.Data.Entity.DbContext; - ObjectContext objectContext = (dbContext as System.Data.Entity.Infrastructure.IObjectContextAdapter).ObjectContext; - metadataWorkspace = objectContext.MetadataWorkspace; + DbContext dbContext = Activator.CreateInstance(contextType) as DbContext; } catch (Exception efException) { @@ -55,7 +45,7 @@ public static MetadataWorkspace CreateMetadataWorkspace(Type contextType) throw; } - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFramework.DbResource.MetadataWorkspaceNotFound + ProcessException(efException), contextType.FullName), efException); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFrameworkCore.DbResource.MetadataWorkspaceNotFound + ProcessException(efException), contextType.FullName), efException); } } #endif @@ -102,20 +92,7 @@ public static MetadataWorkspace CreateMetadataWorkspaceFromResources(Type contex if (edmItemCollection.TryGetEntityContainer(currentType.Name, out container)) { StoreItemCollection store = new StoreItemCollection(workspaceInfo.Ssdl); -#if DBCONTEXT // This actually means EF6+ - MetadataWorkspace workspace = new MetadataWorkspace( - () => edmItemCollection, - () => store, - () => new StorageMappingItemCollection(edmItemCollection, store, workspaceInfo.Msl), - () => new ObjectItemCollection()); -#else // EF4 - StorageMappingItemCollection mapping = new StorageMappingItemCollection(edmItemCollection, store, workspaceInfo.Msl); MetadataWorkspace workspace = new MetadataWorkspace(); - workspace.RegisterItemCollection(edmItemCollection); - workspace.RegisterItemCollection(store); - workspace.RegisterItemCollection(mapping); - workspace.RegisterItemCollection(new ObjectItemCollection()); -#endif return workspace; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs deleted file mode 100644 index e9ac41077..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextExtensions.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Data; -using System.Data.Entity; -using System.Data.Entity.Core.Objects; - -namespace OpenRiaServices.EntityFramework -{ - /// - /// ObjectContext extension methods useful to LinqToEntitiesDomainService authors - /// - public static class ObjectContextExtensions - { - /// - /// Extension method used to attach the specified entity as modified, - /// with the specified original state. - /// - /// The entity Type - /// The ObjectSet to attach to - /// The current entity state - /// The original entity state - public static void AttachAsModified(this ObjectSet objectSet, T current, T original) where T : class - { - if (objectSet == null) - { - throw new ArgumentNullException(nameof(objectSet)); - } - if (current == null) - { - throw new ArgumentNullException(nameof(current)); - } - if (original == null) - { - throw new ArgumentNullException(nameof(original)); - } - - // Attach the entity if it is not already attached, or if it is already - // attached, transition to Modified - EntityState currState = ObjectContextUtilities.GetEntityState(objectSet.Context, current); - if (currState == EntityState.Detached) - { - objectSet.Attach(current); - } - else - { - objectSet.Context.ObjectStateManager.ChangeObjectState(current, EntityState.Modified); - } - - ObjectStateEntry stateEntry = ObjectContextUtilities.AttachAsModifiedInternal(current, original, objectSet.Context); - - if (stateEntry.State != EntityState.Modified) - { - // Ensure that when we leave this method, the entity is in a - // Modified state. For example, if current and original are the - // same, we still need to force the state transition - objectSet.Context.ObjectStateManager.ChangeObjectState(current, EntityState.Modified); - } - } - - /// - /// Extension method used to attach the specified entity as modified. This overload - /// can be used in cases where the entity has a Timestamp member. - /// - /// The entity Type - /// The ObjectSet to attach to - /// The current entity state - public static void AttachAsModified(this ObjectSet objectSet, T entity) where T : class - { - if (objectSet == null) - { - throw new ArgumentNullException(nameof(objectSet)); - } - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - ObjectContext context = objectSet.Context; - EntityState currState = ObjectContextUtilities.GetEntityState(context, entity); - if (currState == EntityState.Detached) - { - // attach the entity - objectSet.Attach(entity); - } - - // transition the entity to the modified state - context.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified); - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs index f14fc45d8..ebda64c70 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs @@ -1,31 +1,13 @@ using System; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; #if RIACONTRIB using System.ServiceModel.DomainServices.Server; #endif -using System.Data.Entity; -#if DBCONTEXT -using System.Data.Entity.Core.Metadata.Edm; -using System.Data.Entity.Core.Objects.DataClasses; -using System.Data.Entity.Core.Objects; -#else -using System.Data; -using System.Data.Metadata.Edm; -using System.Data.Objects; -using System.Data.Objects.DataClasses; -#endif using System.Linq; -using OpenRiaServices.Server; +using System.Data.Metadata.Edm; +using Microsoft.EntityFrameworkCore.ChangeTracking; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { -#if DBCONTEXT - using ConcurrencyMode = System.Data.Entity.Core.Metadata.Edm.ConcurrencyMode; -#else -using ConcurrencyMode = System.Data.Metadata.Edm.ConcurrencyMode; -#endif - /// /// Internal utility functions for dealing with EF types and metadata @@ -90,34 +72,6 @@ public static StructuralType GetEdmType(MetadataWorkspace workspace, Type clrTyp return structuralType; } - - /// - /// Method used to return the current of the specified - /// entity. - /// - /// The - /// The entity to return the for - /// The current of the specified entity - public static EntityState GetEntityState(ObjectContext context, object entity) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - if (entity == null) - { - throw new ArgumentNullException(nameof(entity)); - } - - ObjectStateEntry stateEntry = null; - if (!context.ObjectStateManager.TryGetObjectStateEntry(entity, out stateEntry)) - { - return EntityState.Detached; - } - return stateEntry.State; - } - - /// /// Determines if the specified EdmMember is a concurrency timestamp. /// @@ -167,30 +121,31 @@ public static MetadataProperty GetStoreGeneratedPattern(EdmMember member) return md; } - public static ObjectStateEntry AttachAsModifiedInternal(object current, object original, ObjectContext objectContext) + public static EntityEntry AttachAsModifiedInternal(object current, object original, ChangeTracker objectContext) { - ObjectStateEntry stateEntry = objectContext.ObjectStateManager.GetObjectStateEntry(current); - stateEntry.ApplyOriginalValues(original); + var stateEntry = objectContext.Context.Entry(current); // ObjectStateManager.GetObjectStateEntry(current); + + // TODO: The code below may be needed based on how RoundTripOriginalAttribute behaves in EF Core // For any members that don't have RoundtripOriginal applied, EF can't determine modification // state by doing value comparisons. To avoid losing updates in these cases, we must explicitly // mark such members as modified. - Type entityType = current.GetType(); - PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType); - AttributeCollection attributes = TypeDescriptor.GetAttributes(entityType); - bool isRoundtripType = attributes[typeof(RoundtripOriginalAttribute)] != null; - foreach (var fieldMetadata in stateEntry.CurrentValues.DataRecordInfo.FieldMetadata) - { - string memberName = stateEntry.CurrentValues.GetName(fieldMetadata.Ordinal); - PropertyDescriptor property = properties[memberName]; - if (property != null && - (property.Attributes[typeof(RoundtripOriginalAttribute)] == null && !isRoundtripType) && - property.Attributes[typeof(ExcludeAttribute)] == null) - { - stateEntry.SetModifiedProperty(memberName); - } - } + //Type entityType = current.GetType(); + //PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType); + //AttributeCollection attributes = TypeDescriptor.GetAttributes(entityType); + //bool isRoundtripType = attributes[typeof(RoundtripOriginalAttribute)] != null; + //foreach (var fieldMetadata in stateEntry.CurrentValues.DataRecordInfo.FieldMetadata) + //{ + // string memberName = stateEntry.CurrentValues.GetName(fieldMetadata.Ordinal); + // PropertyDescriptor property = properties[memberName]; + // if (property != null && + // (property.Attributes[typeof(RoundtripOriginalAttribute)] == null && !isRoundtripType) && + // property.Attributes[typeof(ExcludeAttribute)] == null) + // { + // stateEntry.SetModifiedProperty(memberName); + // } + //} return stateEntry; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 4a5354145..cd34d079e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -7,6 +7,7 @@ + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs index e00c13413..fa227caa2 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs @@ -1,37 +1,20 @@ -using System; -using System.Collections.Generic; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; +using Microsoft.EntityFrameworkCore; using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore.Query.Internal; -namespace OpenRiaServices.EntityFramework +namespace OpenRiaServices.EntityFrameworkCore { static class QueryHelper { public static ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) { // EF will throw if provider is not a IDbAsyncQueryProvider - if (query.Provider is IDbAsyncQueryProvider) + if (query.Provider is IAsyncQueryProvider) return new ValueTask(query.CountAsync(cancellationToken)); else return new ValueTask(query.Count()); } - - public static async ValueTask> EnumerateAsyncEnumerable(IDbAsyncEnumerable asyncEnumerable, int estimatedResultCount, CancellationToken cancellationToken) - { - using (var enumerator = asyncEnumerable.GetAsyncEnumerator()) - { - List result = new List(capacity: estimatedResultCount); - while (await enumerator.MoveNextAsync(cancellationToken).ConfigureAwait(false)) - { - result.Add(enumerator.Current); - } - - return result; - } - } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs index 59c36df61..ae27b8b9d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace OpenRiaServices.EntityFramework { +namespace OpenRiaServices.EntityFrameworkCore { using System; @@ -39,7 +39,7 @@ internal Resource() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.Resource", typeof(Resource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.Resource", typeof(Resource).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs index 49043bd51..8e29139a1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs @@ -2,19 +2,19 @@ namespace CodeFirstModels { using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - + using System.ComponentModel.DataAnnotations; + public partial class CustomerDemographic { public CustomerDemographic() { this.Customers = new HashSet(); } - + [Key] public string CustomerTypeID { get; set; } public string CustomerDesc { get; set; } - + public virtual ICollection Customers { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs index e10bd2cb6..431356512 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs @@ -1,7 +1,8 @@ using System.ComponentModel.DataAnnotations.Schema; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; using System.Runtime.Serialization; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; +using System.Configuration; // These assembly attributes allow us to serialize different CLR types into the same contract [assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", @@ -11,40 +12,56 @@ namespace CodeFirstModels { public partial class EFCFNorthwindEntities : DbContext { + private string _connection; + public EFCFNorthwindEntities() - : base("name=Northwind") + : this("name=Northwind") { } public EFCFNorthwindEntities(string connection) - : base(connection) { + _connection = connection; + } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseSqlServer(_connection); } - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity() .HasMany(c => c.Orders) - .WithOptional(c => c.Shipper) + .WithOne(c => c.Shipper) .HasForeignKey(c => c.ShipVia); + modelBuilder.Entity().ToTable("Order Details"); + modelBuilder.Entity().ToTable("Region"); - modelBuilder.Entity().HasMany(t => t.Employees) - .WithMany(e => e.Territories) - .Map(m => - { - m.ToTable("EmployeeTerritories"); - m.MapLeftKey("TerritoryID"); - m.MapRightKey("EmployeeID"); - }); - - modelBuilder.Entity().HasKey(r => r.RegionID) + modelBuilder.Entity() + .HasKey(et => new { et.EmployeeID, et.TerritoryID }); + + modelBuilder.Entity() + .HasOne(bc => bc.Employee) + .WithMany(b => b.EmployeeTerritories) + .HasForeignKey(bc => bc.EmployeeID); + + modelBuilder.Entity() + .HasOne(bc => bc.Territory) + .WithMany(c => c.EmployeeTerritories) + .HasForeignKey(bc => bc.TerritoryID); + + modelBuilder.Entity() .Property(r => r.RegionID) - .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None); + .ValueGeneratedNever(); + + modelBuilder.Entity() + .HasKey(r => r.RegionID); } @@ -60,4 +77,4 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder) public DbSet Suppliers { get; set; } public DbSet Territories { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj index cec3bcf82..9e302dd4d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj @@ -13,10 +13,20 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs index eab446cad..38146376c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs @@ -11,7 +11,7 @@ public Employee() { this.Employees1 = new HashSet(); this.Orders = new HashSet(); - this.Territories = new HashSet(); + this.EmployeeTerritories = new HashSet(); } [Key] @@ -40,6 +40,6 @@ public Employee() public virtual Employee Employee1 { get; set; } public virtual ICollection Orders { get; set; } - public virtual ICollection Territories { get; set; } + public virtual ICollection EmployeeTerritories { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs new file mode 100644 index 000000000..21e1f1f49 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs @@ -0,0 +1,14 @@ +namespace CodeFirstModels +{ + public partial class EmployeeTerritory + { + public int EmployeeID { get; set; } + + public Employee Employee { get; set; } + + public int TerritoryID { get; set; } + + public Territory Territory { get; set; } + + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs index 5ab81d8e9..28a4aa38f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs @@ -8,7 +8,7 @@ public partial class Territory { public Territory() { - this.Employees = new HashSet(); + this.EmployeeTerritories = new HashSet(); } [StringLength(20)] @@ -18,6 +18,6 @@ public Territory() public int RegionID { get; set; } public virtual Region Region { get; set; } - public virtual ICollection Employees { get; set; } + public virtual ICollection EmployeeTerritories { get; set; } } } From cd1d9d986eed5013f51fa0b8390dda52a558c057 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 22 Oct 2021 14:37:33 +0200 Subject: [PATCH 05/99] WIP First EF Core Test that compiles (BusinessLogicClass_Context_EFCoreDbContextTest) --- .../Client.Test/Data/DomainContextTestBase.cs | 7 +- .../Test/Client.Test/Data/UpdateTests.cs | 51 + .../Test/Client.Test/TestUris.cs | 2 + .../Framework/LinqToEntitiesDomainService.cs | 134 + .../Test/CodeFirstModel/DbContextModel.cs | 7 +- .../AdventureWorks/AWBuildVersion.cs | 22 - .../DbContextModel/AdventureWorks/Address.cs | 42 - .../AdventureWorks/AddressType.cs | 31 - .../AdventureWorksDbCtx.Context.cs | 100 - .../AdventureWorksDbCtx.Context.tt | 194 - .../AdventureWorksDbCtx.Designer.cs | 4 - .../AdventureWorks/AdventureWorksDbCtx.cs | 9 - .../AdventureWorks/AdventureWorksDbCtx.edmx | 6405 ----------------- .../AdventureWorks/AdventureWorksDbCtx.tt | 280 - .../AdventureWorksPartialClasses.cs | 103 - .../AdventureWorks/BillOfMaterial.cs | 31 - .../DbContextModel/AdventureWorks/Contact.cs | 50 - .../AdventureWorks/ContactCreditCard.cs | 24 - .../AdventureWorks/ContactType.cs | 30 - .../AdventureWorks/CountryRegion.cs | 30 - .../AdventureWorks/CountryRegionCurrency.cs | 24 - .../AdventureWorks/CreditCard.cs | 33 - .../DbContextModel/AdventureWorks/Culture.cs | 28 - .../DbContextModel/AdventureWorks/Currency.cs | 32 - .../AdventureWorks/CurrencyRate.cs | 34 - .../DbContextModel/AdventureWorks/Customer.cs | 36 - .../AdventureWorks/CustomerAddress.cs | 27 - .../AdventureWorks/DatabaseLog.cs | 26 - .../AdventureWorks/Department.cs | 29 - .../DbContextModel/AdventureWorks/Document.cs | 35 - .../DbContextModel/AdventureWorks/Employee.cs | 54 - .../AdventureWorks/EmployeeAddress.cs | 25 - .../EmployeeDepartmentHistory.cs | 28 - .../AdventureWorks/EmployeePayHistory.cs | 25 - .../DbContextModel/AdventureWorks/ErrorLog.cs | 27 - .../AdventureWorks/Illustration.cs | 28 - .../AdventureWorks/Individual.cs | 25 - .../AdventureWorks/JobCandidate.cs | 24 - .../DbContextModel/AdventureWorks/Location.cs | 32 - .../DbContextModel/AdventureWorks/Product.cs | 80 - .../AdventureWorks/ProductCategory.cs | 29 - .../AdventureWorks/ProductCostHistory.cs | 25 - .../AdventureWorks/ProductDescription.cs | 29 - .../AdventureWorks/ProductDocument.cs | 24 - .../AdventureWorks/ProductInventory.cs | 28 - .../AdventureWorks/ProductListPriceHistory.cs | 25 - .../AdventureWorks/ProductModel.cs | 35 - .../ProductModelIllustration.cs | 24 - .../ProductModelProductDescriptionCulture.cs | 26 - .../AdventureWorks/ProductPhoto.cs | 31 - .../AdventureWorks/ProductProductPhoto.cs | 25 - .../AdventureWorks/ProductReview.cs | 28 - .../AdventureWorks/ProductSubcategory.cs | 31 - .../AdventureWorks/ProductVendor.cs | 33 - .../AdventureWorks/PurchaseOrder.cs | 41 - .../AdventureWorks/PurchaseOrderDetail.cs | 32 - .../AdventureWorks/SalesOrderDetail.cs | 32 - .../AdventureWorks/SalesOrderHeader.cs | 63 - .../SalesOrderHeaderSalesReason.cs | 24 - .../AdventureWorks/SalesPerson.cs | 42 - .../AdventureWorks/SalesPersonQuotaHistory.cs | 25 - .../AdventureWorks/SalesReason.cs | 29 - .../AdventureWorks/SalesTaxRate.cs | 27 - .../AdventureWorks/SalesTerritory.cs | 43 - .../AdventureWorks/SalesTerritoryHistory.cs | 27 - .../AdventureWorks/ScrapReason.cs | 28 - .../DbContextModel/AdventureWorks/Shift.cs | 30 - .../AdventureWorks/ShipMethod.cs | 33 - .../AdventureWorks/ShoppingCartItem.cs | 26 - .../AdventureWorks/SpecialOffer.cs | 36 - .../AdventureWorks/SpecialOfferProduct.cs | 31 - .../AdventureWorks/StateProvince.cs | 37 - .../DbContextModel/AdventureWorks/Store.cs | 33 - .../AdventureWorks/StoreContact.cs | 27 - .../AdventureWorks/TransactionHistory.cs | 29 - .../TransactionHistoryArchive.cs | 27 - .../AdventureWorks/UnitMeasure.cs | 34 - .../DbContextModel/AdventureWorks/Vendor.cs | 39 - .../AdventureWorks/VendorAddress.cs | 26 - .../AdventureWorks/VendorContact.cs | 26 - .../AdventureWorks/WorkOrder.cs | 37 - .../AdventureWorks/WorkOrderRouting.cs | 33 - .../AdventureWorks/sysdiagram.cs | 23 - .../EFCoreDbContextModels.csproj | 249 +- .../Test/DbContextModel/Northwind/Category.cs | 2 +- .../Test/DbContextModel/Northwind/Customer.cs | 2 +- .../Northwind/CustomerDemographic.cs | 2 +- .../Test/DbContextModel/Northwind/Employee.cs | 2 +- .../Northwind/NorthwindDbCtx.Designer.cs | 14 +- .../Northwind/NorthwindEntities.Context.cs | 25 +- .../Northwind/NorthwindPartialClasses.cs | 12 +- .../Test/DbContextModel/Northwind/Order.cs | 2 +- .../DbContextModel/Northwind/Order_Detail.cs | 2 +- .../Test/DbContextModel/Northwind/Product.cs | 2 +- .../Test/DbContextModel/Northwind/Region.cs | 2 +- .../Test/DbContextModel/Northwind/Shipper.cs | 2 +- .../Test/DbContextModel/Northwind/Supplier.cs | 2 +- .../DbContextModel/Northwind/Territory.cs | 2 +- .../Test/DomainServiceDescriptionTest.cs | 2 +- .../Test/CodeGenDomainServices.cs | 3 + .../Northwind/EFCoreDbCtx_Northwind.cs | 529 ++ ...Services.Common.DomainServices.Test.csproj | 2 + .../BusinessLogicClassContextTests.cs | 9 + 103 files changed, 788 insertions(+), 9620 deletions(-) create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/DomainContextTestBase.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/DomainContextTestBase.cs index 77b217dfc..c32c57e60 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/DomainContextTestBase.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/DomainContextTestBase.cs @@ -17,7 +17,12 @@ public enum ProviderType /// /// Unspecified, non-DAL provider /// - Unspecified + Unspecified, + + /// + /// EF Core Linq to SQL provider + /// + EFCore } /// diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs index 00b2db86d..461e0a545 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs @@ -16,6 +16,7 @@ namespace OpenRiaServices.Client.Test using Resource = SSmDsClient::OpenRiaServices.Client.Resource; /// + /// TODO: Make it work with EF Core. Maybe copy whole file and work with DBContext for EFCore /// End to end update scenario tests. These tests do a one time TestClass level test database /// initialization, creating the isolation database that will be used for all the tests. After /// all tests have run, and assembly level clean-up method disposes the test database. @@ -4473,6 +4474,31 @@ TestContext testContext } + [TestClass] + public class EFCoreEFCFUpdateTests : UpdateTests + { + public EFCoreEFCFUpdateTests() + : base(TestURIs.EFCoreEFCF_Northwind_CUD, ProviderType.EFCore) + { + } + + /// + /// Silverlight version of class initializer doesn't take TestContext + /// + [ClassInitialize] + public static void ClassSetup( +#if !SILVERLIGHT + TestContext testContext +#endif +) + { + // ensure that our isolation DB has been created once and only once + // at the test fixture level + TestDatabase.Initialize(); + } + + } + [TestClass] public class DbCtxUpdateTests : UpdateTests { @@ -4497,6 +4523,31 @@ TestContext testContext } } + [TestClass] + public class EFCoreDbCtxUpdateTests : UpdateTests + { + public EFCoreDbCtxUpdateTests() + : base(TestURIs.EFCoreDbCtx_Northwind_CUD, ProviderType.EFCore) + { + } + + /// + /// Silverlight version of class initializer doesn't take TestContext + /// + [ClassInitialize] + public static void ClassSetup( +#if !SILVERLIGHT + TestContext testContext +#endif +) + { + // ensure that our isolation DB has been created once and only once + // at the test fixture level + TestDatabase.Initialize(); + } + } + + /// /// Non DAL/DB scenario tests /// diff --git a/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs b/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs index 172933e7e..10ca9bef9 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs @@ -22,8 +22,10 @@ public static class TestURIs public static readonly Uri EF_Northwind_POCO_CUD = new Uri(RootURI, "TestDomainServices-EF-NorthwindPOCO_CUD.svc"); // EF CodeFirst + public static readonly Uri EFCoreEFCF_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCoreEFCF-Northwind_CUD.svc"); public static readonly Uri EFCF_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCF-Northwind_CUD.svc"); public static readonly Uri DbCtx_Northwind_CUD = new Uri(RootURI, "TestDomainServices-DbCtx-Northwind_CUD.svc"); + public static readonly Uri EFCoreDbCtx_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCoreDbCtx-Northwind_CUD.svc"); public static readonly Uri DbCtx_Northwind = new Uri(RootURI, "TestDomainServices-DbCtx-Northwind.svc"); public static readonly Uri DbCtx_Catalog = new Uri(RootURI, "TestDomainServices-DbCtx-Catalog.svc"); public static readonly Uri EFCodeFirst = new Uri(RootURI, "EFCodeFirst-EFCodeFirstTestDomainService.svc"); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs new file mode 100644 index 000000000..f04ad8752 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using OpenRiaServices.Server; + +namespace OpenRiaServices.EntityFrameworkCore +{ + /// + /// Base class for DomainServices operating on LINQ To Entities data models + /// + /// The Type of the LINQ To Entities ObjectContext + [LinqToEntitiesDomainServiceDescriptionProvider] + public abstract class LinqToEntitiesDomainService : DomainService where TContext : new() + { + /// + /// Protected constructor because this is an abstract class + /// + protected LinqToEntitiesDomainService() + { + } + + /// + /// Initializes this . must be called + /// prior to invoking any operations on the instance. + /// + /// The for this + /// instance. Overrides must call the base method. + public override void Initialize(DomainServiceContext context) + { + base.Initialize(context); + } + + + /// + /// Gets the number of rows in an . + /// + /// The element Type of the query. + /// The query for which the count should be returned. + /// which may be used by hosting layer to request cancellation + /// The total number of rows. + protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) + { + return QueryHelper.CountAsync(query, cancellationToken); + } + + /// + /// Enumerates the specified enumerable to guarantee eager execution. + /// If possible code similar to ToListAsync is used, but with optimizations to start with a larger initial capacity + /// + /// The element type of the enumerable. + /// The enumerable to enumerate. + /// The estimated number of items the enumerable will yield. + /// which may be used by hosting layer to request cancellation + /// A new enumerable with the results of the enumerated enumerable. + protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) + { + return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); + } + + /// + /// This method is called to finalize changes after all the operations in the specified changeset + /// have been invoked. All changes are committed to the ObjectContext, and any resulting optimistic + /// concurrency errors are processed. + /// + /// which may be used by hosting layer to request cancellation + /// True if the was persisted successfully, false otherwise. + protected override ValueTask PersistChangeSetAsync(CancellationToken cancellationToken) + { + return new ValueTask(this.InvokeSaveChangesAsync(true, cancellationToken)); + } + + private async Task InvokeSaveChangesAsync(bool retryOnConflict, CancellationToken cancellationToken) + { + try + { + await this.SubmitAsync(ChangeSet, cancellationToken); + } + catch (OptimisticConcurrencyException ex) + { + // Map the operations that could have caused a conflict to an entity. + //Dictionary operationConflictMap = new Dictionary(); + //foreach (ObjectStateEntry conflict in ex.StateEntries) + //{ + // ChangeSetEntry entry = this.ChangeSet.ChangeSetEntries.SingleOrDefault(p => object.ReferenceEquals(p.Entity, conflict.Entity)); + // if (entry == null) + // { + // // If we're unable to find the object in our changeset, propagate + // // the original exception + // throw; + // } + // operationConflictMap.Add(conflict, entry); + //} + + //this.SetChangeSetConflicts(operationConflictMap); + + //// Call out to any user resolve code and resubmit if all conflicts + //// were resolved + //if (retryOnConflict && this.ResolveConflicts(ex.StateEntries)) + //{ + // // clear the conflics from the entries + // foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) + // { + // entry.StoreEntity = null; + // entry.ConflictMembers = null; + // entry.IsDeleteConflict = false; + // } + + // // If all conflicts were resolved attempt a resubmit + // return await this.InvokeSaveChangesAsync(/* retryOnConflict */ false, cancellationToken).ConfigureAwait(false); + //} + + // if the conflict wasn't resolved, call the error handler + this.OnError(new DomainServiceErrorInfo(ex)); + + // if there was a conflict but no conflict information was + // extracted to the individual entries, we need to ensure the + // error makes it back to the client + if (!this.ChangeSet.HasError) + { + throw; + } + + return false; + } + + return true; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs index 431356512..e048db8bb 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs @@ -10,17 +10,17 @@ namespace CodeFirstModels { - public partial class EFCFNorthwindEntities : DbContext + public partial class EFCoreCFNorthwindEntities : DbContext { private string _connection; - public EFCFNorthwindEntities() + public EFCoreCFNorthwindEntities() : this("name=Northwind") { } - public EFCFNorthwindEntities(string connection) + public EFCoreCFNorthwindEntities(string connection) { _connection = connection; } @@ -46,6 +46,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity() .HasKey(et => new { et.EmployeeID, et.TerritoryID }); + // In EF Core 3.1 a M2M link entity is required. This should not be needed in EF Core 5 and upwards modelBuilder.Entity() .HasOne(bc => bc.Employee) .WithMany(b => b.EmployeeTerritories) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs deleted file mode 100644 index 0c909f134..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class AWBuildVersion - { - public byte SystemInformationID { get; set; } - public string Database_Version { get; set; } - public System.DateTime VersionDate { get; set; } - public System.DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs deleted file mode 100644 index 8c14788a0..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Address - { - public Address() - { - this.EmployeeAddresses = new HashSet(); - this.CustomerAddresses = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - this.SalesOrderHeaders1 = new HashSet(); - this.VendorAddresses = new HashSet(); - } - - public int AddressID { get; set; } - public string AddressLine1 { get; set; } - public string AddressLine2 { get; set; } - public string City { get; set; } - public int StateProvinceID { get; set; } - public string PostalCode { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection EmployeeAddresses { get; set; } - public virtual StateProvince StateProvince { get; set; } - public virtual ICollection CustomerAddresses { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual ICollection SalesOrderHeaders1 { get; set; } - public virtual ICollection VendorAddresses { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs deleted file mode 100644 index 0253e8ccc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class AddressType - { - public AddressType() - { - this.CustomerAddresses = new HashSet(); - this.VendorAddresses = new HashSet(); - } - - public int AddressTypeID { get; set; } - public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection CustomerAddresses { get; set; } - public virtual ICollection VendorAddresses { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs deleted file mode 100644 index cb997d479..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs +++ /dev/null @@ -1,100 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Data.Entity; - using System.Data.Entity.Infrastructure; - - public partial class DbCtxAdventureWorksEntities : DbContext - { - public DbCtxAdventureWorksEntities() - : base("name=DbCtxAdventureWorksEntities") - { - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - - public DbSet AWBuildVersions { get; set; } - public DbSet DatabaseLogs { get; set; } - public DbSet ErrorLogs { get; set; } - public DbSet sysdiagrams { get; set; } - public DbSet Departments { get; set; } - public DbSet Employees { get; set; } - public DbSet EmployeeAddresses { get; set; } - public DbSet EmployeeDepartmentHistories { get; set; } - public DbSet EmployeePayHistories { get; set; } - public DbSet JobCandidates { get; set; } - public DbSet Shifts { get; set; } - public DbSet
Addresses { get; set; } - public DbSet AddressTypes { get; set; } - public DbSet Contacts { get; set; } - public DbSet ContactTypes { get; set; } - public DbSet CountryRegions { get; set; } - public DbSet StateProvinces { get; set; } - public DbSet BillOfMaterials { get; set; } - public DbSet Cultures { get; set; } - public DbSet Documents { get; set; } - public DbSet Illustrations { get; set; } - public DbSet Locations { get; set; } - public DbSet Products { get; set; } - public DbSet ProductCategories { get; set; } - public DbSet ProductCostHistories { get; set; } - public DbSet ProductDescriptions { get; set; } - public DbSet ProductDocuments { get; set; } - public DbSet ProductInventories { get; set; } - public DbSet ProductListPriceHistories { get; set; } - public DbSet ProductModels { get; set; } - public DbSet ProductModelIllustrations { get; set; } - public DbSet ProductModelProductDescriptionCultures { get; set; } - public DbSet ProductPhotoes { get; set; } - public DbSet ProductProductPhotoes { get; set; } - public DbSet ProductReviews { get; set; } - public DbSet ProductSubcategories { get; set; } - public DbSet ScrapReasons { get; set; } - public DbSet TransactionHistories { get; set; } - public DbSet TransactionHistoryArchives { get; set; } - public DbSet UnitMeasures { get; set; } - public DbSet WorkOrders { get; set; } - public DbSet WorkOrderRoutings { get; set; } - public DbSet ProductVendors { get; set; } - public DbSet PurchaseOrderDetails { get; set; } - public DbSet PurchaseOrders { get; set; } - public DbSet ShipMethods { get; set; } - public DbSet Vendors { get; set; } - public DbSet VendorAddresses { get; set; } - public DbSet VendorContacts { get; set; } - public DbSet ContactCreditCards { get; set; } - public DbSet CountryRegionCurrencies { get; set; } - public DbSet CreditCards { get; set; } - public DbSet Currencies { get; set; } - public DbSet CurrencyRates { get; set; } - public DbSet Customers { get; set; } - public DbSet CustomerAddresses { get; set; } - public DbSet Individuals { get; set; } - public DbSet SalesOrderDetails { get; set; } - public DbSet SalesOrderHeaders { get; set; } - public DbSet SalesOrderHeaderSalesReasons { get; set; } - public DbSet SalesPersons { get; set; } - public DbSet SalesPersonQuotaHistories { get; set; } - public DbSet SalesReasons { get; set; } - public DbSet SalesTaxRates { get; set; } - public DbSet SalesTerritories { get; set; } - public DbSet SalesTerritoryHistories { get; set; } - public DbSet ShoppingCartItems { get; set; } - public DbSet SpecialOffers { get; set; } - public DbSet SpecialOfferProducts { get; set; } - public DbSet Stores { get; set; } - public DbSet StoreContacts { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt deleted file mode 100644 index 97de62047..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt +++ /dev/null @@ -1,194 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -var loader = new MetadataLoader(this); -var region = new CodeRegion(this); -var inputFile = @"AdventureWorksDbCtx.edmx"; -var ItemCollection = loader.CreateEdmItemCollection(inputFile); - -Code = new CodeGenerationTools(this); -EFTools = new MetadataTools(this); -ObjectNamespace = Code.VsNamespaceSuggestion(); -ModelNamespace = loader.GetModelNamespace(inputFile); - -EntityContainer container = ItemCollection.GetItems().FirstOrDefault(); -if (container == null) -{ - return string.Empty; -} -#> -//------------------------------------------------------------------------------ -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<# - -if (!String.IsNullOrEmpty(ObjectNamespace)) -{ -#> -namespace <#=Code.EscapeNamespace(ObjectNamespace)#> -{ -<# - PushIndent(CodeRegion.GetIndent(1)); -} - -#> -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -<# -if (container.FunctionImports.Any()) -{ -#> -using System.Data.Objects; -<# -} -#> - -<#=Accessibility.ForType(container)#> partial class <#=Code.Escape(container)#> : DbContext -{ - public <#=Code.Escape(container)#>() - : base("name=<#=container.Name#>") - { -<# - WriteLazyLoadingEnabled(container); -#> - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - -<# - foreach (var entitySet in container.BaseEntitySets.OfType()) - { -#> - <#=Accessibility.ForReadOnlyProperty(entitySet)#> DbSet<<#=Code.Escape(entitySet.ElementType)#>> <#=Code.Escape(entitySet)#> { get; set; } -<# - } - - foreach (var edmFunction in container.FunctionImports) - { - WriteFunctionImport(edmFunction, false); - } -#> -} -<# - -if (!String.IsNullOrEmpty(ObjectNamespace)) -{ - PopIndent(); -#> -} -<# -} -#> -<#+ -string ModelNamespace { get; set; } -string ObjectNamespace { get; set; } -CodeGenerationTools Code { get; set; } -MetadataTools EFTools { get; set; } - -string GetResourceString(string resourceName) -{ - if(_resourceManager == null) - { - _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); - } - - return _resourceManager.GetString(resourceName, null); -} -System.Resources.ResourceManager _resourceManager; - -void WriteLazyLoadingEnabled(EntityContainer container) -{ - string lazyLoadingAttributeValue = null; - var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; - if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) - { - bool isLazyLoading; - if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading) && !isLazyLoading) - { -#> - this.Configuration.LazyLoadingEnabled = false; -<#+ - } - } -} - -void WriteFunctionImport(EdmFunction edmFunction, bool includeMergeOption) -{ - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, Code, EFTools); - var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); - var returnType = edmFunction.ReturnParameter == null ? null : EFTools.GetElementType(edmFunction.ReturnParameter.TypeUsage); - var processedReturn = returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType) + ">"; - - if (includeMergeOption) - { - paramList = Code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } -#> - - <#=AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction))#> <#=processedReturn#> <#=Code.Escape(edmFunction)#>(<#=paramList#>) - { -<#+ - if(returnType != null && (returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || - returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) - { -#> - ((IObjectContextAdapter)this).ObjectContext.MetadataWorkspace.LoadFromAssembly(typeof(<#=MultiSchemaEscape(returnType)#>).Assembly); - -<#+ - } - - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))"; -#> - var <#=parameter.LocalVariableName#> = <#=isNotNull#> ? - <#=notNullInit#> : - <#=nullInit#>; - -<#+ - } - - var genericArg = returnType == null ? "" : "<" + MultiSchemaEscape(returnType) + ">"; - var callParams = Code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } -#> - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<#=genericArg#>("<#=edmFunction.Name#>"<#=callParams#>); - } -<#+ - if(!includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) - { - WriteFunctionImport(edmFunction, true); - } -} - -string AccessibilityAndVirtual(string accessibility) -{ - return accessibility + (accessibility != "private" ? " virtual" : ""); -} - -string MultiSchemaEscape(TypeUsage usage) -{ - var type = usage.EdmType as StructuralType; - return type != null && type.NamespaceName != ModelNamespace ? - Code.CreateFullName(Code.EscapeNamespace(type.NamespaceName), Code.Escape(type)) : - Code.Escape(usage); -} - -#> \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs deleted file mode 100644 index a1659b392..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Default code generation is disabled for model 'D:\dd\Alex_AppFx_1\src\AppFx\RiaServices\Main\OpenRiaServices.EntityFramework\Test\DbContextModel\AdventureWorks\AdventureWorksDbCtx.edmx'. -// To enable default code generation, change the value of the 'Code Generation Strategy' designer -// property to an alternate value. This property is available in the Properties Window when the model is -// open in the designer. \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs deleted file mode 100644 index 0c4c97d77..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs +++ /dev/null @@ -1,9 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx deleted file mode 100644 index e66327900..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx +++ /dev/null @@ -1,6405 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt deleted file mode 100644 index 097b51b40..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt +++ /dev/null @@ -1,280 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -CodeGenerationTools code = new CodeGenerationTools(this); -MetadataLoader loader = new MetadataLoader(this); -CodeRegion region = new CodeRegion(this, 1); -MetadataTools ef = new MetadataTools(this); - -string inputFile = @"AdventureWorksDbCtx.edmx"; -EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile); -string namespaceName = code.VsNamespaceSuggestion(); - -EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this); -WriteHeader(fileManager); - -foreach (var entity in ItemCollection.GetItems().OrderBy(e => e.Name)) -{ - fileManager.StartNewFile(entity.Name + ".cs"); - BeginNamespace(namespaceName, code); -#> -using System; -using System.Collections.Generic; - -<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#><#=code.StringBefore(" : ", code.Escape(entity.BaseType))#> -{ -<# - var propertiesWithDefaultValues = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity && p.DefaultValue != null); - var collectionNavigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - var complexProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == entity); - - if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(entity)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var navigationProperty in collectionNavigationProperties) - { -#> - this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=code.Escape(navigationProperty.ToEndMember.GetEntityType())#>>(); -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var primitiveProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity); - if (primitiveProperties.Any()) - { - foreach (var edmProperty in primitiveProperties) - { - WriteProperty(code, edmProperty); - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var complexProperty in complexProperties) - { - WriteProperty(code, complexProperty); - } - } - - var navigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity); - if (navigationProperties.Any()) - { -#> - -<# - foreach (var navigationProperty in navigationProperties) - { - WriteNavigationProperty(code, navigationProperty); - } - } -#> -} -<# - EndNamespace(namespaceName); -} - -foreach (var complex in ItemCollection.GetItems().OrderBy(e => e.Name)) -{ - fileManager.StartNewFile(complex.Name + ".cs"); - BeginNamespace(namespaceName, code); -#> -using System; - -<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> -{ -<# - var complexProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == complex); - var propertiesWithDefaultValues = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex && p.DefaultValue != null); - - if (propertiesWithDefaultValues.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(complex)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var primitiveProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex); - if (primitiveProperties.Any()) - { - foreach(var edmProperty in primitiveProperties) - { - WriteProperty(code, edmProperty); - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var edmProperty in complexProperties) - { - WriteProperty(code, edmProperty); - } - } -#> -} -<# - EndNamespace(namespaceName); -} - -if (!VerifyTypesAreCaseInsensitiveUnique(ItemCollection)) -{ - return ""; -} - -fileManager.Process(); - -#> -<#+ -string GetResourceString(string resourceName) -{ - if(_resourceManager == null) - { - _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); - } - - return _resourceManager.GetString(resourceName, null); -} -System.Resources.ResourceManager _resourceManager; - -void WriteHeader(EntityFrameworkTemplateFileManager fileManager) -{ - fileManager.StartHeader(); -#> -//------------------------------------------------------------------------------ -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<#+ - fileManager.EndBlock(); -} - -void BeginNamespace(string namespaceName, CodeGenerationTools code) -{ - CodeRegion region = new CodeRegion(this); - if (!String.IsNullOrEmpty(namespaceName)) - { -#> -namespace <#=code.EscapeNamespace(namespaceName)#> -{ -<#+ - PushIndent(CodeRegion.GetIndent(1)); - } -} - - -void EndNamespace(string namespaceName) -{ - if (!String.IsNullOrEmpty(namespaceName)) - { - PopIndent(); -#> -} -<#+ - } -} - -void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty) -{ - WriteProperty(Accessibility.ForProperty(edmProperty), - code.Escape(edmProperty.TypeUsage), - code.Escape(edmProperty), - code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - code.SpaceAfter(Accessibility.ForSetter(edmProperty))); -} - -void WriteNavigationProperty(CodeGenerationTools code, NavigationProperty navigationProperty) -{ - var endType = code.Escape(navigationProperty.ToEndMember.GetEntityType()); - WriteProperty(PropertyVirtualModifier(Accessibility.ForProperty(navigationProperty)), - navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - code.Escape(navigationProperty), - code.SpaceAfter(Accessibility.ForGetter(navigationProperty)), - code.SpaceAfter(Accessibility.ForSetter(navigationProperty))); -} - -void WriteProperty(string accessibility, string type, string name, string getterAccessibility, string setterAccessibility) -{ -#> - <#=accessibility#> <#=type#> <#=name#> { <#=getterAccessibility#>get; <#=setterAccessibility#>set; } -<#+ -} - -string PropertyVirtualModifier(string accessibility) -{ - return accessibility + (accessibility != "private" ? " virtual" : ""); -} - -bool VerifyTypesAreCaseInsensitiveUnique(EdmItemCollection itemCollection) -{ - var alreadySeen = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach(var type in itemCollection.GetItems()) - { - if (!(type is EntityType || type is ComplexType)) - { - continue; - } - - if (alreadySeen.ContainsKey(type.FullName)) - { - Error(String.Format(CultureInfo.CurrentCulture, "This template does not support types that differ only by case, the types {0} are not supported", type.FullName)); - return false; - } - else - { - alreadySeen.Add(type.FullName, true); - } - } - - return true; -} -#> diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs deleted file mode 100644 index be7bdc6fb..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Runtime.Serialization; -using OpenRiaServices.Server; - -// These assembly attributes allow us to serialize different CLR types into the same contract -[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks", - ClrNamespace = "DbContextModels.AdventureWorks")] - -namespace DbContextModels.AdventureWorks -{ - public partial class DbCtxAdventureWorksEntities - { - public DbCtxAdventureWorksEntities(string connectionString) - : base(connectionString) - { - } - } - - [MetadataType(typeof(PurchaseOrderMetadata))] - public partial class PurchaseOrder - { - } - - [MetadataType(typeof(PurchaseOrderDetailMetadata))] - public partial class PurchaseOrderDetail - { - } - - public static class PurchaseOrderMetadata - { - [Include] - public static object PurchaseOrderDetails; - } - - public static class PurchaseOrderDetailMetadata - { - [Include] - public static object Product; - } - - [MetadataType(typeof(ProductMetadata))] - public partial class Product - { - } - - public static class ProductMetadata - { - [Exclude] - public static object SafetyStockLevel; - - [RoundtripOriginal] - public static object Weight; - } - - [MetadataType(typeof(EmployeeMetadata))] - public partial class Employee - { - } - - public static class EmployeeMetadata - { - [Include] - public static object Manager; - } - - public class EmployeeInfo - { - public static EmployeeInfo CreateEmployeeInfo(int employeeID, string firstName, string lastName, int territoryID) - { - EmployeeInfo empInfo = new EmployeeInfo(); - empInfo.EmployeeID = employeeID; - empInfo.FirstName = firstName; - empInfo.LastName = lastName; - empInfo.TerritoryID = territoryID; - return empInfo; - } - - [Key] - public int EmployeeID - { - get; - set; - } - - public string FirstName - { - get; - set; - } - public string LastName - { - get; - set; - } - public int TerritoryID - { - get; - set; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs deleted file mode 100644 index c557c7a36..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class BillOfMaterial - { - public int BillOfMaterialsID { get; set; } - public Nullable ProductAssemblyID { get; set; } - public int ComponentID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public string UnitMeasureCode { get; set; } - public short BOMLevel { get; set; } - public decimal PerAssemblyQty { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual Product Product1 { get; set; } - public virtual UnitMeasure UnitMeasure { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs deleted file mode 100644 index 61adf5887..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Contact - { - public Contact() - { - this.Employees = new HashSet(); - this.ContactCreditCards = new HashSet(); - this.Individuals = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - this.StoreContacts = new HashSet(); - this.VendorContacts = new HashSet(); - } - - public int ContactID { get; set; } - public bool NameStyle { get; set; } - public string Title { get; set; } - public string FirstName { get; set; } - public string MiddleName { get; set; } - public string LastName { get; set; } - public string Suffix { get; set; } - public string EmailAddress { get; set; } - public int EmailPromotion { get; set; } - public string Phone { get; set; } - public string PasswordHash { get; set; } - public string PasswordSalt { get; set; } - public string AdditionalContactInfo { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection Employees { get; set; } - public virtual ICollection ContactCreditCards { get; set; } - public virtual ICollection Individuals { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual ICollection StoreContacts { get; set; } - public virtual ICollection VendorContacts { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs deleted file mode 100644 index d589fc7e6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ContactCreditCard - { - public int ContactID { get; set; } - public int CreditCardID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual CreditCard CreditCard { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs deleted file mode 100644 index e6b0dc880..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ContactType - { - public ContactType() - { - this.StoreContacts = new HashSet(); - this.VendorContacts = new HashSet(); - } - - public int ContactTypeID { get; set; } - public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection StoreContacts { get; set; } - public virtual ICollection VendorContacts { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs deleted file mode 100644 index 1e82bc408..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class CountryRegion - { - public CountryRegion() - { - this.CountryRegionCurrencies = new HashSet(); - this.StateProvinces = new HashSet(); - } - - public string CountryRegionCode { get; set; } - public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection CountryRegionCurrencies { get; set; } - public virtual ICollection StateProvinces { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs deleted file mode 100644 index 6fa408c39..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class CountryRegionCurrency - { - public string CountryRegionCode { get; set; } - public string CurrencyCode { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual CountryRegion CountryRegion { get; set; } - public virtual Currency Currency { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs deleted file mode 100644 index b90d6ec27..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class CreditCard - { - public CreditCard() - { - this.ContactCreditCards = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - } - - public int CreditCardID { get; set; } - public string CardType { get; set; } - public string CardNumber { get; set; } - public byte ExpMonth { get; set; } - public short ExpYear { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ContactCreditCards { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs deleted file mode 100644 index a702328e6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Culture - { - public Culture() - { - this.ProductModelProductDescriptionCultures = new HashSet(); - } - - public string CultureID { get; set; } - public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductModelProductDescriptionCultures { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs deleted file mode 100644 index f56cb6978..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Currency - { - public Currency() - { - this.CountryRegionCurrencies = new HashSet(); - this.CurrencyRates = new HashSet(); - this.CurrencyRates1 = new HashSet(); - } - - public string CurrencyCode { get; set; } - public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection CountryRegionCurrencies { get; set; } - public virtual ICollection CurrencyRates { get; set; } - public virtual ICollection CurrencyRates1 { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs deleted file mode 100644 index d571d24a9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class CurrencyRate - { - public CurrencyRate() - { - this.SalesOrderHeaders = new HashSet(); - } - - public int CurrencyRateID { get; set; } - public System.DateTime CurrencyRateDate { get; set; } - public string FromCurrencyCode { get; set; } - public string ToCurrencyCode { get; set; } - public decimal AverageRate { get; set; } - public decimal EndOfDayRate { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Currency Currency { get; set; } - public virtual Currency Currency1 { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs deleted file mode 100644 index 9ba787ccb..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Customer - { - public Customer() - { - this.CustomerAddresses = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - } - - public int CustomerID { get; set; } - public Nullable TerritoryID { get; set; } - public string AccountNumber { get; set; } - public string CustomerType { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesTerritory SalesTerritory { get; set; } - public virtual ICollection CustomerAddresses { get; set; } - public virtual Individual Individual { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual Store Store { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs deleted file mode 100644 index 5d4bff4e6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class CustomerAddress - { - public int CustomerID { get; set; } - public int AddressID { get; set; } - public int AddressTypeID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Address Address { get; set; } - public virtual AddressType AddressType { get; set; } - public virtual Customer Customer { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs deleted file mode 100644 index 0f3c3cbf6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class DatabaseLog - { - public int DatabaseLogID { get; set; } - public System.DateTime PostTime { get; set; } - public string DatabaseUser { get; set; } - public string Event { get; set; } - public string Schema { get; set; } - public string Object { get; set; } - public string TSQL { get; set; } - public string XmlEvent { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs deleted file mode 100644 index 49c33d7ca..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Department - { - public Department() - { - this.EmployeeDepartmentHistories = new HashSet(); - } - - public short DepartmentID { get; set; } - public string Name { get; set; } - public string GroupName { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection EmployeeDepartmentHistories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs deleted file mode 100644 index fc30ae8ed..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Document - { - public Document() - { - this.ProductDocuments = new HashSet(); - } - - public int DocumentID { get; set; } - public string Title { get; set; } - public string FileName { get; set; } - public string FileExtension { get; set; } - public string Revision { get; set; } - public int ChangeNumber { get; set; } - public byte Status { get; set; } - public string DocumentSummary { get; set; } - public byte[] Document1 { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductDocuments { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs deleted file mode 100644 index 28764fd6d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs +++ /dev/null @@ -1,54 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Employee - { - public Employee() - { - this.Reports = new HashSet(); - this.EmployeeAddresses = new HashSet(); - this.EmployeeDepartmentHistories = new HashSet(); - this.EmployeePayHistories = new HashSet(); - this.JobCandidates = new HashSet(); - this.PurchaseOrders = new HashSet(); - } - - public int EmployeeID { get; set; } - public string NationalIDNumber { get; set; } - public int ContactID { get; set; } - public string LoginID { get; set; } - public Nullable ManagerID { get; set; } - public string Title { get; set; } - public System.DateTime BirthDate { get; set; } - public string MaritalStatus { get; set; } - public string Gender { get; set; } - public System.DateTime HireDate { get; set; } - public bool SalariedFlag { get; set; } - public short VacationHours { get; set; } - public short SickLeaveHours { get; set; } - public bool CurrentFlag { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual ICollection Reports { get; set; } - public virtual Employee Manager { get; set; } - public virtual ICollection EmployeeAddresses { get; set; } - public virtual ICollection EmployeeDepartmentHistories { get; set; } - public virtual ICollection EmployeePayHistories { get; set; } - public virtual ICollection JobCandidates { get; set; } - public virtual ICollection PurchaseOrders { get; set; } - public virtual SalesPerson SalesPerson { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs deleted file mode 100644 index 193df3e54..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class EmployeeAddress - { - public int EmployeeID { get; set; } - public int AddressID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - public virtual Address Address { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs deleted file mode 100644 index a2abcb742..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class EmployeeDepartmentHistory - { - public int EmployeeID { get; set; } - public short DepartmentID { get; set; } - public byte ShiftID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Department Department { get; set; } - public virtual Employee Employee { get; set; } - public virtual Shift Shift { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs deleted file mode 100644 index 9c0451091..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class EmployeePayHistory - { - public int EmployeeID { get; set; } - public System.DateTime RateChangeDate { get; set; } - public decimal Rate { get; set; } - public byte PayFrequency { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs deleted file mode 100644 index 3201be4b9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ErrorLog - { - public int ErrorLogID { get; set; } - public System.DateTime ErrorTime { get; set; } - public string UserName { get; set; } - public int ErrorNumber { get; set; } - public Nullable ErrorSeverity { get; set; } - public Nullable ErrorState { get; set; } - public string ErrorProcedure { get; set; } - public Nullable ErrorLine { get; set; } - public string ErrorMessage { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs deleted file mode 100644 index c00b272dd..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Illustration - { - public Illustration() - { - this.ProductModelIllustrations = new HashSet(); - } - - public int IllustrationID { get; set; } - public string Diagram { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductModelIllustrations { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs deleted file mode 100644 index 83a39d9f2..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Individual - { - public int CustomerID { get; set; } - public int ContactID { get; set; } - public string Demographics { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual Customer Customer { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs deleted file mode 100644 index e4d7b4428..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class JobCandidate - { - public int JobCandidateID { get; set; } - public Nullable EmployeeID { get; set; } - public string Resume { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs deleted file mode 100644 index 40f1e6c40..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Location - { - public Location() - { - this.ProductInventories = new HashSet(); - this.WorkOrderRoutings = new HashSet(); - } - - public short LocationID { get; set; } - public string Name { get; set; } - public decimal CostRate { get; set; } - public decimal Availability { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductInventories { get; set; } - public virtual ICollection WorkOrderRoutings { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs deleted file mode 100644 index a0a0ea4fe..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs +++ /dev/null @@ -1,80 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Product - { - public Product() - { - this.BillOfMaterials = new HashSet(); - this.BillOfMaterials1 = new HashSet(); - this.ProductCostHistories = new HashSet(); - this.ProductDocuments = new HashSet(); - this.ProductInventories = new HashSet(); - this.ProductListPriceHistories = new HashSet(); - this.ProductProductPhotoes = new HashSet(); - this.ProductReviews = new HashSet(); - this.ProductVendors = new HashSet(); - this.PurchaseOrderDetails = new HashSet(); - this.ShoppingCartItems = new HashSet(); - this.SpecialOfferProducts = new HashSet(); - this.TransactionHistories = new HashSet(); - this.WorkOrders = new HashSet(); - } - - public int ProductID { get; set; } - public string Name { get; set; } - public string ProductNumber { get; set; } - public bool MakeFlag { get; set; } - public bool FinishedGoodsFlag { get; set; } - public string Color { get; set; } - public short SafetyStockLevel { get; set; } - public short ReorderPoint { get; set; } - public decimal StandardCost { get; set; } - public decimal ListPrice { get; set; } - public string Size { get; set; } - public string SizeUnitMeasureCode { get; set; } - public string WeightUnitMeasureCode { get; set; } - public Nullable Weight { get; set; } - public int DaysToManufacture { get; set; } - public string ProductLine { get; set; } - public string Class { get; set; } - public string Style { get; set; } - public Nullable ProductSubcategoryID { get; set; } - public Nullable ProductModelID { get; set; } - public System.DateTime SellStartDate { get; set; } - public Nullable SellEndDate { get; set; } - public Nullable DiscontinuedDate { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection BillOfMaterials { get; set; } - public virtual ICollection BillOfMaterials1 { get; set; } - public virtual ProductModel ProductModel { get; set; } - public virtual ProductSubcategory ProductSubcategory { get; set; } - public virtual UnitMeasure UnitMeasure { get; set; } - public virtual UnitMeasure UnitMeasure1 { get; set; } - public virtual ICollection ProductCostHistories { get; set; } - public virtual ICollection ProductDocuments { get; set; } - public virtual ICollection ProductInventories { get; set; } - public virtual ICollection ProductListPriceHistories { get; set; } - public virtual ICollection ProductProductPhotoes { get; set; } - public virtual ICollection ProductReviews { get; set; } - public virtual ICollection ProductVendors { get; set; } - public virtual ICollection PurchaseOrderDetails { get; set; } - public virtual ICollection ShoppingCartItems { get; set; } - public virtual ICollection SpecialOfferProducts { get; set; } - public virtual ICollection TransactionHistories { get; set; } - public virtual ICollection WorkOrders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs deleted file mode 100644 index 4b34b25e4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductCategory - { - public ProductCategory() - { - this.ProductSubcategories = new HashSet(); - } - - public int ProductCategoryID { get; set; } - public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductSubcategories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs deleted file mode 100644 index 6afdd0129..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductCostHistory - { - public int ProductID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public decimal StandardCost { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs deleted file mode 100644 index c6b586ea7..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductDescription - { - public ProductDescription() - { - this.ProductModelProductDescriptionCultures = new HashSet(); - } - - public int ProductDescriptionID { get; set; } - public string Description { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductModelProductDescriptionCultures { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs deleted file mode 100644 index 5e3f0b166..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductDocument - { - public int ProductID { get; set; } - public int DocumentID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Document Document { get; set; } - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs deleted file mode 100644 index 19cc6db94..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductInventory - { - public int ProductID { get; set; } - public short LocationID { get; set; } - public string Shelf { get; set; } - public byte Bin { get; set; } - public short Quantity { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Location Location { get; set; } - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs deleted file mode 100644 index 1f002b0e4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductListPriceHistory - { - public int ProductID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public decimal ListPrice { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs deleted file mode 100644 index bce8c05a1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductModel - { - public ProductModel() - { - this.Products = new HashSet(); - this.ProductModelIllustrations = new HashSet(); - this.ProductModelProductDescriptionCultures = new HashSet(); - } - - public int ProductModelID { get; set; } - public string Name { get; set; } - public string CatalogDescription { get; set; } - public string Instructions { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection Products { get; set; } - public virtual ICollection ProductModelIllustrations { get; set; } - public virtual ICollection ProductModelProductDescriptionCultures { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs deleted file mode 100644 index a4502e58e..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductModelIllustration - { - public int ProductModelID { get; set; } - public int IllustrationID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Illustration Illustration { get; set; } - public virtual ProductModel ProductModel { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs deleted file mode 100644 index 114811a47..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductModelProductDescriptionCulture - { - public int ProductModelID { get; set; } - public int ProductDescriptionID { get; set; } - public string CultureID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Culture Culture { get; set; } - public virtual ProductDescription ProductDescription { get; set; } - public virtual ProductModel ProductModel { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs deleted file mode 100644 index 583ec0765..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductPhoto - { - public ProductPhoto() - { - this.ProductProductPhotoes = new HashSet(); - } - - public int ProductPhotoID { get; set; } - public byte[] ThumbNailPhoto { get; set; } - public string ThumbnailPhotoFileName { get; set; } - public byte[] LargePhoto { get; set; } - public string LargePhotoFileName { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductProductPhotoes { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs deleted file mode 100644 index d8bcacb43..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductProductPhoto - { - public int ProductID { get; set; } - public int ProductPhotoID { get; set; } - public bool Primary { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual ProductPhoto ProductPhoto { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs deleted file mode 100644 index d47e840fd..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductReview - { - public int ProductReviewID { get; set; } - public int ProductID { get; set; } - public string ReviewerName { get; set; } - public System.DateTime ReviewDate { get; set; } - public string EmailAddress { get; set; } - public int Rating { get; set; } - public string Comments { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs deleted file mode 100644 index 6ed91040a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductSubcategory - { - public ProductSubcategory() - { - this.Products = new HashSet(); - } - - public int ProductSubcategoryID { get; set; } - public int ProductCategoryID { get; set; } - public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection Products { get; set; } - public virtual ProductCategory ProductCategory { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs deleted file mode 100644 index 09bc92acd..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ProductVendor - { - public int ProductID { get; set; } - public int VendorID { get; set; } - public int AverageLeadTime { get; set; } - public decimal StandardPrice { get; set; } - public Nullable LastReceiptCost { get; set; } - public Nullable LastReceiptDate { get; set; } - public int MinOrderQty { get; set; } - public int MaxOrderQty { get; set; } - public Nullable OnOrderQty { get; set; } - public string UnitMeasureCode { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual UnitMeasure UnitMeasure { get; set; } - public virtual Vendor Vendor { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs deleted file mode 100644 index 083d90774..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class PurchaseOrder - { - public PurchaseOrder() - { - this.PurchaseOrderDetails = new HashSet(); - } - - public int PurchaseOrderID { get; set; } - public byte RevisionNumber { get; set; } - public byte Status { get; set; } - public int EmployeeID { get; set; } - public int VendorID { get; set; } - public int ShipMethodID { get; set; } - public System.DateTime OrderDate { get; set; } - public Nullable ShipDate { get; set; } - public decimal SubTotal { get; set; } - public decimal TaxAmt { get; set; } - public decimal Freight { get; set; } - public decimal TotalDue { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - public virtual ICollection PurchaseOrderDetails { get; set; } - public virtual ShipMethod ShipMethod { get; set; } - public virtual Vendor Vendor { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs deleted file mode 100644 index e18d2e8af..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class PurchaseOrderDetail - { - public int PurchaseOrderID { get; set; } - public int PurchaseOrderDetailID { get; set; } - public System.DateTime DueDate { get; set; } - public short OrderQty { get; set; } - public int ProductID { get; set; } - public decimal UnitPrice { get; set; } - public decimal LineTotal { get; set; } - public decimal ReceivedQty { get; set; } - public decimal RejectedQty { get; set; } - public decimal StockedQty { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual PurchaseOrder PurchaseOrder { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs deleted file mode 100644 index a7cb4cf5b..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesOrderDetail - { - public int SalesOrderID { get; set; } - public int SalesOrderDetailID { get; set; } - public string CarrierTrackingNumber { get; set; } - public short OrderQty { get; set; } - public int ProductID { get; set; } - public int SpecialOfferID { get; set; } - public decimal UnitPrice { get; set; } - public decimal UnitPriceDiscount { get; set; } - public decimal LineTotal { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesOrderHeader SalesOrderHeader { get; set; } - public virtual SpecialOfferProduct SpecialOfferProduct { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs deleted file mode 100644 index 44d88c879..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesOrderHeader - { - public SalesOrderHeader() - { - this.SalesOrderDetails = new HashSet(); - this.SalesOrderHeaderSalesReasons = new HashSet(); - } - - public int SalesOrderID { get; set; } - public byte RevisionNumber { get; set; } - public System.DateTime OrderDate { get; set; } - public System.DateTime DueDate { get; set; } - public Nullable ShipDate { get; set; } - public byte Status { get; set; } - public bool OnlineOrderFlag { get; set; } - public string SalesOrderNumber { get; set; } - public string PurchaseOrderNumber { get; set; } - public string AccountNumber { get; set; } - public int CustomerID { get; set; } - public int ContactID { get; set; } - public Nullable SalesPersonID { get; set; } - public Nullable TerritoryID { get; set; } - public int BillToAddressID { get; set; } - public int ShipToAddressID { get; set; } - public int ShipMethodID { get; set; } - public Nullable CreditCardID { get; set; } - public string CreditCardApprovalCode { get; set; } - public Nullable CurrencyRateID { get; set; } - public decimal SubTotal { get; set; } - public decimal TaxAmt { get; set; } - public decimal Freight { get; set; } - public decimal TotalDue { get; set; } - public string Comment { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Address Address { get; set; } - public virtual Address Address1 { get; set; } - public virtual Contact Contact { get; set; } - public virtual ShipMethod ShipMethod { get; set; } - public virtual CreditCard CreditCard { get; set; } - public virtual CurrencyRate CurrencyRate { get; set; } - public virtual Customer Customer { get; set; } - public virtual ICollection SalesOrderDetails { get; set; } - public virtual SalesPerson SalesPerson { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } - public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs deleted file mode 100644 index ab22701e7..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs +++ /dev/null @@ -1,24 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesOrderHeaderSalesReason - { - public int SalesOrderID { get; set; } - public int SalesReasonID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesOrderHeader SalesOrderHeader { get; set; } - public virtual SalesReason SalesReason { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs deleted file mode 100644 index 92df3f961..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesPerson - { - public SalesPerson() - { - this.SalesOrderHeaders = new HashSet(); - this.SalesPersonQuotaHistories = new HashSet(); - this.SalesTerritoryHistories = new HashSet(); - this.Stores = new HashSet(); - } - - public int SalesPersonID { get; set; } - public Nullable TerritoryID { get; set; } - public Nullable SalesQuota { get; set; } - public decimal Bonus { get; set; } - public decimal CommissionPct { get; set; } - public decimal SalesYTD { get; set; } - public decimal SalesLastYear { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } - public virtual ICollection SalesPersonQuotaHistories { get; set; } - public virtual ICollection SalesTerritoryHistories { get; set; } - public virtual ICollection Stores { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs deleted file mode 100644 index a183c0456..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs +++ /dev/null @@ -1,25 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesPersonQuotaHistory - { - public int SalesPersonID { get; set; } - public System.DateTime QuotaDate { get; set; } - public decimal SalesQuota { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesPerson SalesPerson { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs deleted file mode 100644 index 0fbb5e5a1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesReason - { - public SalesReason() - { - this.SalesOrderHeaderSalesReasons = new HashSet(); - } - - public int SalesReasonID { get; set; } - public string Name { get; set; } - public string ReasonType { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs deleted file mode 100644 index d09f0e529..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesTaxRate - { - public int SalesTaxRateID { get; set; } - public int StateProvinceID { get; set; } - public byte TaxType { get; set; } - public decimal TaxRate { get; set; } - public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual StateProvince StateProvince { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs deleted file mode 100644 index 95459b5a9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs +++ /dev/null @@ -1,43 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesTerritory - { - public SalesTerritory() - { - this.StateProvinces = new HashSet(); - this.Customers = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - this.SalesPersons = new HashSet(); - this.SalesTerritoryHistories = new HashSet(); - } - - public int TerritoryID { get; set; } - public string Name { get; set; } - public string CountryRegionCode { get; set; } - public string Group { get; set; } - public decimal SalesYTD { get; set; } - public decimal SalesLastYear { get; set; } - public decimal CostYTD { get; set; } - public decimal CostLastYear { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection StateProvinces { get; set; } - public virtual ICollection Customers { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual ICollection SalesPersons { get; set; } - public virtual ICollection SalesTerritoryHistories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs deleted file mode 100644 index 2597d6a70..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SalesTerritoryHistory - { - public int SalesPersonID { get; set; } - public int TerritoryID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesPerson SalesPerson { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs deleted file mode 100644 index a80122d7f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs +++ /dev/null @@ -1,28 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ScrapReason - { - public ScrapReason() - { - this.WorkOrders = new HashSet(); - } - - public short ScrapReasonID { get; set; } - public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection WorkOrders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs deleted file mode 100644 index 51c52c4df..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs +++ /dev/null @@ -1,30 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Shift - { - public Shift() - { - this.EmployeeDepartmentHistories = new HashSet(); - } - - public byte ShiftID { get; set; } - public string Name { get; set; } - public System.DateTime StartTime { get; set; } - public System.DateTime EndTime { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection EmployeeDepartmentHistories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs deleted file mode 100644 index 49db4a191..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ShipMethod - { - public ShipMethod() - { - this.PurchaseOrderHeaders = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - } - - public int ShipMethodID { get; set; } - public string Name { get; set; } - public decimal ShipBase { get; set; } - public decimal ShipRate { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection PurchaseOrderHeaders { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs deleted file mode 100644 index 1ea6b5b4f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class ShoppingCartItem - { - public int ShoppingCartItemID { get; set; } - public string ShoppingCartID { get; set; } - public int Quantity { get; set; } - public int ProductID { get; set; } - public System.DateTime DateCreated { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs deleted file mode 100644 index 0c3b51a53..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SpecialOffer - { - public SpecialOffer() - { - this.SpecialOfferProducts = new HashSet(); - } - - public int SpecialOfferID { get; set; } - public string Description { get; set; } - public decimal DiscountPct { get; set; } - public string Type { get; set; } - public string Category { get; set; } - public System.DateTime StartDate { get; set; } - public System.DateTime EndDate { get; set; } - public int MinQty { get; set; } - public Nullable MaxQty { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection SpecialOfferProducts { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs deleted file mode 100644 index d7176273c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class SpecialOfferProduct - { - public SpecialOfferProduct() - { - this.SalesOrderDetails = new HashSet(); - } - - public int SpecialOfferID { get; set; } - public int ProductID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual ICollection SalesOrderDetails { get; set; } - public virtual SpecialOffer SpecialOffer { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs deleted file mode 100644 index 945bda4a8..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class StateProvince - { - public StateProvince() - { - this.Addresses = new HashSet
(); - this.SalesTaxRates = new HashSet(); - } - - public int StateProvinceID { get; set; } - public string StateProvinceCode { get; set; } - public string CountryRegionCode { get; set; } - public bool IsOnlyStateProvinceFlag { get; set; } - public string Name { get; set; } - public int TerritoryID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection
Addresses { get; set; } - public virtual CountryRegion CountryRegion { get; set; } - public virtual ICollection SalesTaxRates { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs deleted file mode 100644 index a004f9480..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Store - { - public Store() - { - this.StoreContacts = new HashSet(); - } - - public int CustomerID { get; set; } - public string Name { get; set; } - public Nullable SalesPersonID { get; set; } - public string Demographics { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Customer Customer { get; set; } - public virtual SalesPerson SalesPerson { get; set; } - public virtual ICollection StoreContacts { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs deleted file mode 100644 index dec9448b9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class StoreContact - { - public int CustomerID { get; set; } - public int ContactID { get; set; } - public int ContactTypeID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual ContactType ContactType { get; set; } - public virtual Store Store { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs deleted file mode 100644 index 164295e4a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class TransactionHistory - { - public int TransactionID { get; set; } - public int ProductID { get; set; } - public int ReferenceOrderID { get; set; } - public int ReferenceOrderLineID { get; set; } - public System.DateTime TransactionDate { get; set; } - public string TransactionType { get; set; } - public int Quantity { get; set; } - public decimal ActualCost { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs deleted file mode 100644 index 3fd312a2c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class TransactionHistoryArchive - { - public int TransactionID { get; set; } - public int ProductID { get; set; } - public int ReferenceOrderID { get; set; } - public int ReferenceOrderLineID { get; set; } - public System.DateTime TransactionDate { get; set; } - public string TransactionType { get; set; } - public int Quantity { get; set; } - public decimal ActualCost { get; set; } - public System.DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs deleted file mode 100644 index 7b88b1145..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class UnitMeasure - { - public UnitMeasure() - { - this.BillOfMaterials = new HashSet(); - this.Products = new HashSet(); - this.Products1 = new HashSet(); - this.ProductVendors = new HashSet(); - } - - public string UnitMeasureCode { get; set; } - public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection BillOfMaterials { get; set; } - public virtual ICollection Products { get; set; } - public virtual ICollection Products1 { get; set; } - public virtual ICollection ProductVendors { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs deleted file mode 100644 index 99bb7bd1f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class Vendor - { - public Vendor() - { - this.ProductVendors = new HashSet(); - this.PurchaseOrderHeaders = new HashSet(); - this.VendorAddresses = new HashSet(); - this.VendorContacts = new HashSet(); - } - - public int VendorID { get; set; } - public string AccountNumber { get; set; } - public string Name { get; set; } - public byte CreditRating { get; set; } - public bool PreferredVendorStatus { get; set; } - public bool ActiveFlag { get; set; } - public string PurchasingWebServiceURL { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductVendors { get; set; } - public virtual ICollection PurchaseOrderHeaders { get; set; } - public virtual ICollection VendorAddresses { get; set; } - public virtual ICollection VendorContacts { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs deleted file mode 100644 index dde11eaf3..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class VendorAddress - { - public int VendorID { get; set; } - public int AddressID { get; set; } - public int AddressTypeID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Address Address { get; set; } - public virtual AddressType AddressType { get; set; } - public virtual Vendor Vendor { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs deleted file mode 100644 index 8cb0fa1f4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class VendorContact - { - public int VendorID { get; set; } - public int ContactID { get; set; } - public int ContactTypeID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual ContactType ContactType { get; set; } - public virtual Vendor Vendor { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs deleted file mode 100644 index ee1446abb..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs +++ /dev/null @@ -1,37 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class WorkOrder - { - public WorkOrder() - { - this.WorkOrderRoutings = new HashSet(); - } - - public int WorkOrderID { get; set; } - public int ProductID { get; set; } - public int OrderQty { get; set; } - public int StockedQty { get; set; } - public short ScrappedQty { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public System.DateTime DueDate { get; set; } - public Nullable ScrapReasonID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual ScrapReason ScrapReason { get; set; } - public virtual ICollection WorkOrderRoutings { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs deleted file mode 100644 index 32b6792da..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class WorkOrderRouting - { - public int WorkOrderID { get; set; } - public int ProductID { get; set; } - public short OperationSequence { get; set; } - public short LocationID { get; set; } - public System.DateTime ScheduledStartDate { get; set; } - public System.DateTime ScheduledEndDate { get; set; } - public Nullable ActualStartDate { get; set; } - public Nullable ActualEndDate { get; set; } - public Nullable ActualResourceHrs { get; set; } - public decimal PlannedCost { get; set; } - public Nullable ActualCost { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Location Location { get; set; } - public virtual WorkOrder WorkOrder { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs deleted file mode 100644 index a79b94091..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorks -{ - using System; - using System.Collections.Generic; - - public partial class sysdiagram - { - public string name { get; set; } - public int principal_id { get; set; } - public int diagram_id { get; set; } - public Nullable version { get; set; } - public byte[] definition { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj index b011aabe8..0847f05f8 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj @@ -2,7 +2,7 @@ 618 DbContextModels - DbContextModels + EFCoreDbContextModels net472 1.0.0.0 @@ -10,9 +10,6 @@ - - - @@ -21,234 +18,6 @@ - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - True - True - AdventureWorksDbCtx.Context.tt - - - True - True - AdventureWorksDbCtx.tt - - - True - True - AdventureWorksDbCtx.edmx - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - NorthwindEntities.tt @@ -306,19 +75,6 @@ - - EntityModelCodeGenerator - AdventureWorksDbCtx.Designer.cs - DbContextModels.AdventureWorks - - - TextTemplatingFileGenerator - AdventureWorksDbCtx.Context.cs - - - TextTemplatingFileGenerator - AdventureWorksDbCtx.cs - TextTemplatingFileGenerator NorthwindEntities.Context.cs @@ -328,6 +84,9 @@ NorthwindEntities.cs + + + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs index dd67ce34f..4a6059dc4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs index 086dc623f..92d78d7ad 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs index d5b21a10f..c53b07930 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs index 2d815246b..836e10df4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs index 43bce608d..9ca18a4de 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs @@ -1,4 +1,10 @@ -// Default code generation is disabled for model 'D:\dd\Alex_AppFx_1\src\AppFx\RiaServices\Main\OpenRiaServices.EntityFramework\Test\DbContextModel\Northwind\NorthwindDbCtx.edmx'. -// To enable default code generation, change the value of the 'Code Generation Strategy' designer -// property to an alternate value. This property is available in the Properties Window when the model is -// open in the designer. \ No newline at end of file +// T4 code generation is enabled for model 'C:\Users\crmhli\source\repos\OpenRiaServices\src\OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\Northwind\NorthwindDbCtx.edmx'. +// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer +// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model +// is open in the designer. + +// If no context and entity classes have been generated, it may be because you created an empty model but +// have not yet chosen which version of Entity Framework to use. To generate a context class and entity +// classes for your model, open the model in the designer, right-click on the designer surface, and +// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation +// Item...'. \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs index 40c77642a..7d0e45fe3 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs @@ -7,24 +7,29 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; - using System.Data.Entity; - using System.Data.Entity.Infrastructure; - - public partial class DbCtxNorthwindEntities : DbContext + using Microsoft.EntityFrameworkCore; + + + public partial class EFCoreDbCtxNorthwindEntities : DbContext { - public DbCtxNorthwindEntities() - : base("name=DbCtxNorthwindEntities") + public EFCoreDbCtxNorthwindEntities() + : base() { } - protected override void OnModelCreating(DbModelBuilder modelBuilder) + protected override void OnModelCreating(ModelBuilder modelBuilder) { - throw new UnintentionalCodeFirstException(); + throw new NotImplementedException(); } - + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + + } + public DbSet Categories { get; set; } public DbSet CustomerDemographics { get; set; } public DbSet Customers { get; set; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs index d1ff0e33e..fc81b4896 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs @@ -5,15 +5,17 @@ // These assembly attributes allow us to serialize different CLR types into the same contract [assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", - ClrNamespace = "DbContextModels.Northwind")] + ClrNamespace = "DbContextModels.NorthwindEFCore")] -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { - public partial class DbCtxNorthwindEntities + public partial class EFCoreDbCtxNorthwindEntities { - public DbCtxNorthwindEntities(string connection) - : base(connection) + string _connection; + + public EFCoreDbCtxNorthwindEntities(string connection) { + _connection = connection; } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs index 97ff7df75..f82c1cf97 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs index 7935da1e5..804e968b5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs index d8f6ef3bb..48658c2fc 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs index b66528e8d..538583bb1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs index fc9b1173b..f5bf540f7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs index f16a1b9b4..b479444d5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs index d061a28aa..986107dbe 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs @@ -7,7 +7,7 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace DbContextModels.NorthwindEFCore { using System; using System.Collections.Generic; diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 4229f02b5..53b6cebad 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -31,7 +31,7 @@ namespace OpenRiaServices.Server.Test using System.Threading.Tasks; using MetaType = SystemWebDomainServices::OpenRiaServices.Server.MetaType; - + // TODO Begin here to make it work with the new /// /// DomainServiceDescription tests /// diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index 484999a06..de5afa49d 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -527,6 +527,9 @@ public void TestNorthwindEFClientProxies() [Description("Create client proxies for Linq to Entities domain service and compare to known good copy")] public void TestCatalogEFClientProxies() { + // TODO: Test codegeneration (kodgenereringstester) (kopera denna mapp med filer ?) + // Om samma databasmodell => kopiera genererade file (.g.cs) och skriv tester + // Validera både för vb och c# // Default TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\EF", "CG_CATEF", "Catalog_EF.g", typeof(TestDomainServices.EF.Catalog), Array.Empty(), false)); } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs new file mode 100644 index 000000000..9ef610ba4 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs @@ -0,0 +1,529 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.ServiceModel; +using OpenRiaServices.Server; +using TestDomainServices.Testing; +using System.Configuration; +using OpenRiaServices.EntityFrameworkCore; +using DbContextModels.NorthwindEFCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.ChangeTracking; + +namespace TestDomainServices.EFCoreDbCtx +{ + [EnableClientAccess] + public class Northwind : DbDomainService + { + #region Product methods + public Product GetProductById(int id) + { + return this.DbContext.Products.SingleOrDefault(p => p.ProductID == id); + } + + public IQueryable GetProducts() + { + return this.DbContext.Products.Include("Supplier").Include("Category"); + } + + public void InsertProduct(Product product) + { + EntityEntry entityEntry = this.DbContext.Entry(product); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Added; + } + else + { + this.DbContext.Products.Add(product); + } + } + + public void UpdateProduct(Product current) + { + this.DbContext.Products.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + public void DeleteProduct(Product product) + { + EntityEntry entityEntry = this.DbContext.Entry(product); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Deleted; + } + else + { + this.DbContext.Products.Attach(product); + this.DbContext.Products.Remove(product); + } + } + + public void DiscontinueProduct(Product product) + { + // Don't allow discontinued products to be discontinued again. + if (product.Discontinued) + { + throw new ValidationException("Discontinued products can't be discontinued again."); + } + EntityEntry entityEntry = this.DbContext.Entry(product); + if (entityEntry.State == EntityState.Detached) + { + this.DbContext.Products.Attach(product); + } + + product.Discontinued = true; + + if (entityEntry.State == EntityState.Unchanged) + { + // transition the entity to the modified state + entityEntry.State = EntityState.Modified; + } + else if (entityEntry.State == EntityState.Modified) + { + entityEntry.State = EntityState.Modified; + } + } + + protected override bool ResolveConflicts(IEnumerable conflicts) + { + // TODO - resolve conflicts + //foreach (EntityEntry entityEntry in conflicts) + //{ + // ObjectStateEntry stateEntry = objectStateManager.GetObjectStateEntry(entityEntry.Entity); + // if (entityEntry.State == EntityState.Detached || + // stateEntry.IsRelationship) + // { + // continue; + // } + + // Type entityType = stateEntry.Entity.GetType(); + // if (entityType == typeof(Product)) + // { + // if (!this.ResolveProductConflict(entityEntry)) + // { + // return false; + // } + // } + //} + + return true; + } + + private bool ResolveProductConflict(EntityEntry entryInConflict) + { + Product product = (Product)entryInConflict.Entity; + switch (product.ResolveMethod) + { + case "ThrowValidationEx": + throw new ValidationException("testing"); + case "ThrowDomainServiceEx": + throw new DomainException("testing"); + case "MergeIntoCurrent": + return this.ResolveProductWithMerge(entryInConflict); + case "KeepCurrent": + // Client Wins + // objectContext.Refresh(RefreshMode.ClientWins, product); // TODO + break; + case "RefreshCurrent": + // Store wins + // objectContext.Refresh(RefreshMode.StoreWins, product); // TODO + break; + case "ReturnTrueNoResolve": + return true; + case "ReturnFalse": + return false; + case "ReturnFalseWithResolve": + // Store Wins + // objectContext.Refresh(RefreshMode.StoreWins, product); // TODO + return false; + case "": + // objectContext.Refresh(RefreshMode.ClientWins, product); // TODO + break; + default: + { + throw new NotImplementedException(string.Format("ResolveMethod {0} is not defined", product.ResolveMethod)); + } + } + + return true; + } + + private bool ResolveProductWithMerge(EntityEntry entry) + { + // Keep a collection of all modified properties and their values. + PropertyValues currentValues = entry.CurrentValues; + PropertyValues originalValues = entry.OriginalValues; + + List> modifiedMembers = new List>(); + foreach (var property in currentValues.Properties) + { + object currValue = currentValues[property.Name]; + object origValue = originalValues[property.Name]; + if (!object.Equals(currValue, origValue)) + { + modifiedMembers.Add(new Tuple(property.Name, currValue)); + } + } + + // refresh from store to get the updated values - StoreWins + entry.Reload(); + + if (entry.State == EntityState.Detached) + { + // if the refresh results in the entity becoming + // detached, it means the entity no longer exists + // in the store + return false; + } + + // now play back changes + currentValues = entry.CurrentValues; + foreach (var modifiedMember in modifiedMembers) + { + currentValues[modifiedMember.Item1] = modifiedMember.Item2; + } + return true; + } + #endregion + + #region Order methods + public IQueryable GetOrders() + { + return this.DbContext.Orders.Include("Order_Details").Include("Order_Details.Product"); + } + + public void InsertOrder(Order order) + { + EntityEntry entityEntry = this.DbContext.Entry(order); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Added; + } + else + { + this.DbContext.Orders.Add(order); + } + } + + public void UpdateOrder(Order current) + { + this.DbContext.Orders.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + public void DeleteOrder(Order order) + { + EntityEntry entityEntry = this.DbContext.Entry(order); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Deleted; + } + else + { + this.DbContext.Orders.Attach(order); + this.DbContext.Orders.Remove(order); + } + } + #endregion + + #region OrderDetail methods + public IQueryable GetOrderDetails() + { + return this.DbContext.Order_Details.Include("Product"); + } + + public void InsertOrderDetail(Order_Detail detail) + { + EntityEntry entityEntry = this.DbContext.Entry(detail); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Added; + } + else + { + this.DbContext.Order_Details.Add(detail); + } + } + + public void UpdateOrderDetail(Order_Detail current) + { + this.DbContext.Order_Details.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + public void DeleteOrderDetail(Order_Detail detail) + { + EntityEntry entityEntry = this.DbContext.Entry(detail); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Deleted; + } + else + { + this.DbContext.Order_Details.Attach(detail); + this.DbContext.Order_Details.Remove(detail); + } + } + #endregion + + #region Customer methods + public IQueryable GetCustomers() + { + return this.DbContext.Customers; + } + + public void InsertCustomer(Customer customer) + { + EntityEntry entityEntry = this.DbContext.Entry(customer); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Added; + } + else + { + this.DbContext.Customers.Add(customer); + } + } + + public void UpdateCustomer(Customer current) + { + this.DbContext.Customers.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + public void DeleteCustomer(Customer customer) + { + EntityEntry entityEntry = this.DbContext.Entry(customer); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Deleted; + } + else + { + this.DbContext.Customers.Attach(customer); + this.DbContext.Customers.Remove(customer); + } + } + #endregion + + #region Category methods + public IQueryable GetCategories() + { + return this.DbContext.Categories; + } + + public void InsertCategory(Category category) + { + EntityEntry entityEntry = this.DbContext.Entry(category); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Added; + } + else + { + this.DbContext.Categories.Add(category); + } + } + + public void UpdateCategory(Category current) + { + this.DbContext.Categories.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + public void DeleteCategory(Category category) + { + EntityEntry entityEntry = this.DbContext.Entry(category); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Deleted; + } + else + { + this.DbContext.Categories.Attach(category); + this.DbContext.Categories.Remove(category); + } + } + #endregion + + #region Region/Territory composition + public Region GetRegionById(int id) + { + return this.GetRegions().Where(p => p.RegionID == id).FirstOrDefault(); + } + + public IQueryable GetRegions() + { + return this.DbContext.Regions.Include("Territories"); + } + + public void InsertRegion(Region region) + { + this.DbContext.Regions.Add(region); + + foreach (Territory territory in this.ChangeSet.GetAssociatedChanges(region, p => p.Territories, ChangeOperation.Insert)) + { + this.DbContext.Territories.Add(territory); + } + } + + /// + /// Update the region by processing all child modifications. + /// Note: The order of operations below is very important. Only by + /// processing the related changes in this order will the update succeed. + /// + /// The region to update. + public void UpdateRegion(Region region) + { + Region originalRegion = this.ChangeSet.GetOriginal(region); + + // Attach all unmodified entities + foreach (Territory territory in this.ChangeSet.GetAssociatedChanges(region, p => p.Territories, ChangeOperation.None)) + { + this.DbContext.Territories.Attach(territory); + } + if (originalRegion == null) + { + this.DbContext.Regions.Attach(region); + } + + // Attach and apply changes to modified entities + if (originalRegion != null) + { + this.DbContext.Regions.AttachAsModified(region, originalRegion, this.DbContext); + } + foreach (Territory territory in this.ChangeSet.GetAssociatedChanges(region, p => p.Territories, ChangeOperation.Update)) + { + this.DbContext.Territories.AttachAsModified(territory, this.ChangeSet.GetOriginal(territory), this.DbContext); + } + + // Add new entities + foreach (Territory territory in this.ChangeSet.GetAssociatedChanges(region, p => p.Territories, ChangeOperation.Insert)) + { + EntityEntry entityEntry = this.DbContext.Entry(territory); + if (entityEntry.State != EntityState.Detached) + { + // need to change the object state if the entity was already eagerly added + entityEntry.State = EntityState.Added; + } + else + { + this.DbContext.Territories.Add(territory); + } + } + + // Finally, process any deleted entites and relationships + foreach (Territory territory in this.ChangeSet.GetAssociatedChanges(region, p => p.Territories, ChangeOperation.Delete)) + { + Territory origTerrigory = this.ChangeSet.GetOriginal(territory); + if (origTerrigory != null) + { + this.DbContext.Territories.AttachAsModified(territory, origTerrigory, this.DbContext); + } + else + { + this.DbContext.Territories.Attach(territory); + } + + // need to remove any employee territory rows + EntityEntry tEntityEntry = this.DbContext.Entry(territory); + CollectionEntry employeesCollection = tEntityEntry.Collection("Employees"); + employeesCollection.Load(); + territory.Employees.Clear(); + + this.DbContext.Territories.Remove(territory); + } + } + + public void DeleteRegion(Region region) + { + foreach (Territory territory in this.ChangeSet.GetAssociatedChanges(region, p => p.Territories, ChangeOperation.Delete)) + { + Territory origTerrigory = this.ChangeSet.GetOriginal(territory); + if (origTerrigory != null) + { + this.DbContext.Territories.AttachAsModified(territory, origTerrigory, this.DbContext); + } + else + { + this.DbContext.Territories.Attach(territory); + } + + // need to remove any employee territory rows + EntityEntry tEntityEntry = this.DbContext.Entry(territory); + CollectionEntry employeesCollection = tEntityEntry.Collection("Employees"); + employeesCollection.Load(); + territory.Employees.Clear(); + + this.DbContext.Territories.Remove(territory); + } + + EntityEntry entityEntry = this.DbContext.Entry(region); + if (entityEntry.State != EntityState.Detached) + { + entityEntry.State = EntityState.Deleted; + } + else + { + this.DbContext.Regions.Attach(region); + this.DbContext.Regions.Remove(region); + } + } + #endregion + + public IQueryable GetProductInfos() + { + var results = from p in this.DbContext.Products.Include("Supplier").Include("Category") + select new ProductInfo + { + ProductID = p.ProductID, + CategoryName = p.Category.CategoryName, + ProductName = p.ProductName, + SupplierName = p.Supplier.CompanyName + }; + return results; + } + + public void UpdateProductInfo(ProductInfo current) + { + // load the corresponding product to modify and copy + // the new values + Product product = this.DbContext.Products.First(p => p.ProductID == current.ProductID); + product.ProductName = current.ProductName; + } + + protected override EFCoreDbCtxNorthwindEntities CreateDbContext() + { + // TODO: May not be possible to use connection strings + //var builder = new EntityConnectionStringBuilder("metadata=res://*/Northwind.NorthwindDbCtx.csdl|res://*/Northwind.NorthwindDbCtx.ssdl|res://*/Northwind.NorthwindDbCtx.msl;provider=System.Data.SqlClient;"); + var configuration = ConfigurationManager.ConnectionStrings["Northwind"].ConnectionString; + return new EFCoreDbCtxNorthwindEntities(configuration); + } + } + + /// + /// Derived provider that overrides Context creation to use the current + /// active connection. + /// + [EnableClientAccess] + [ServiceContract(Name = "Northwind")] + public class Northwind_CUD : Northwind + { + protected override EFCoreDbCtxNorthwindEntities CreateDbContext() + { + EFCoreDbCtxNorthwindEntities context = null; + + string connection = DBImager.GetNewDatabaseConnectionString("Northwind"); + if (!string.IsNullOrEmpty(connection)) + { + // if there is an active connection in scope use it + // Here we have to append the mapping file info to the connection string + connection = string.Format("metadata=res://*/Northwind.NorthwindDbCtx.csdl|res://*/Northwind.NorthwindDbCtx.ssdl|res://*/Northwind.NorthwindDbCtx.msl;provider=System.Data.SqlClient;provider connection string=\"{0}\"", connection); + context = new EFCoreDbCtxNorthwindEntities(connection); + } + else + { + context = base.CreateDbContext(); + } + + return context; + } + } +} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index e9ba8eff1..8414152f0 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -23,6 +23,8 @@ + + diff --git a/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs b/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs index 96806c86a..66327be75 100644 --- a/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs +++ b/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs @@ -116,6 +116,15 @@ public void BusinessLogicClass_Context_EFDbContextTest() Assert.IsTrue(dbContext.NeedToGenerateMetadataClasses); } + [TestMethod] + [Description("Tests if LinqToEntitiesDbContext works properly for DbContext entities")] + public void BusinessLogicClass_Context_EFCoreDbContextTest() + { + LinqToEntitiesDbContext dbContext = new LinqToEntitiesDbContext(typeof(DbContextModels.NorthwindEFCore.EFCoreDbCtxNorthwindEntities)); + Assert.AreEqual(11, dbContext.Entities.Count()); + Assert.IsTrue(dbContext.NeedToGenerateMetadataClasses); + } + [TestMethod] [Description("Tests if LinqToEntitiesDbContext works properly for EF CodeFirst entities")] public void BusinessLogicClass_Context_EFCFDbContextTest() From b589a23e3f4340a9c4aa81137a8657b37caa0d98 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 25 Oct 2021 08:38:31 +0200 Subject: [PATCH 06/99] Rename --- ...ensions.cs => DbContextEFCoreExtensions.cs} | 4 ++-- ...mainService.cs => DbDomainServiceEFCore.cs} | 8 ++++---- ...rviceEFCoreDescriptionProviderAttribute.cs} | 18 +++++++++--------- ...cs => LinqToEntitiesDomainServiceEFCore.cs} | 8 ++++---- ...sDomainServiceEFCoreDescriptionProvider.cs} | 12 ++++++------ ...rviceEFCoreDescriptionProviderAttribute.cs} | 14 +++++++------- ...qToEntitiesEFCoreTypeDescriptionContext.cs} | 8 ++++---- ...s => LinqToEntitiesEFCoreTypeDescriptor.cs} | 14 +++++++------- ....cs => MetadataWorkspaceUtilitiesEFCore.cs} | 4 ++-- ...ties.cs => ObjectContextUtilitiesEFCore.cs} | 4 ++-- .../{QueryHelper.cs => QueryHelperEFCore.cs} | 2 +- 11 files changed, 48 insertions(+), 48 deletions(-) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{DbContextExtensions.cs => DbContextEFCoreExtensions.cs} (95%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{DbDomainService.cs => DbDomainServiceEFCore.cs} (97%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{DbDomainServiceDescriptionProviderAttribute.cs => DbDomainServiceEFCoreDescriptionProviderAttribute.cs} (80%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesDomainService.cs => LinqToEntitiesDomainServiceEFCore.cs} (95%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesDomainServiceDescriptionProvider.cs => LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs} (80%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs => LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs} (81%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesTypeDescriptionContext.cs => LinqToEntitiesEFCoreTypeDescriptionContext.cs} (95%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesTypeDescriptor.cs => LinqToEntitiesEFCoreTypeDescriptor.cs} (95%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{MetadataWorkspaceUtilities.cs => MetadataWorkspaceUtilitiesEFCore.cs} (97%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{ObjectContextUtilities.cs => ObjectContextUtilitiesEFCore.cs} (97%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{QueryHelper.cs => QueryHelperEFCore.cs} (94%) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs similarity index 95% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs index dae366578..07ee9009e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextExtensions.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs @@ -7,7 +7,7 @@ namespace OpenRiaServices.EntityFrameworkCore /// /// DbContext extension methods for DbDomainService authors. /// - public static class DbContextExtensions + public static class DbContextEFCoreExtensions { /// /// Extension method used to attach the specified entity as modified, @@ -49,7 +49,7 @@ public static void AttachAsModified(this DbSet dbSet, T current, T origina // TODO: Look into this var changeTracker = dbContext.ChangeTracker; - var stateEntry = ObjectContextUtilities.AttachAsModifiedInternal(current, original, changeTracker); + var stateEntry = ObjectContextUtilitiesEFCore.AttachAsModifiedInternal(current, original, changeTracker); if (stateEntry.State != EntityState.Modified) { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs similarity index 97% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs index d2089512e..9e8d1ee95 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainService.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs @@ -15,8 +15,8 @@ namespace OpenRiaServices.EntityFrameworkCore /// Base class for DomainServices operating on LINQ To Entities DbContext based data models /// /// The DbContext type - [DbDomainServiceDescriptionProvider] - public abstract class DbDomainService : DomainService + [DbDomainServiceEFCoreDescriptionProvider] + public abstract class DbDomainServiceEFCore : DomainService where TContext : DbContext, new() { private TContext _dbContext; @@ -24,7 +24,7 @@ public abstract class DbDomainService : DomainService /// /// Protected constructor for the abstract class. /// - protected DbDomainService() + protected DbDomainServiceEFCore() { } @@ -72,7 +72,7 @@ protected TContext DbContext /// The total number of rows. protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) { - return QueryHelper.CountAsync(query, cancellationToken); + return QueryHelperEFCore.CountAsync(query, cancellationToken); } /// diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs similarity index 80% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs index dcfcf7206..3580a57f6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs @@ -7,11 +7,11 @@ namespace OpenRiaServices.EntityFrameworkCore { /// - /// Attribute applied to a that exposes LINQ to Entities mapped + /// Attribute applied to a that exposes LINQ to Entities mapped /// Types. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] - public sealed class DbDomainServiceDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute + public sealed class DbDomainServiceEFCoreDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute { private Type _dbContextType; @@ -20,8 +20,8 @@ public sealed class DbDomainServiceDescriptionProviderAttribute : DomainServiceD /// DbContext will be inferred from the the /// attribute is applied to. /// - public DbDomainServiceDescriptionProviderAttribute() - : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + public DbDomainServiceEFCoreDescriptionProviderAttribute() + : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) { } @@ -30,8 +30,8 @@ public DbDomainServiceDescriptionProviderAttribute() /// DbContext Type. ///
/// The LINQ To Entities ObjectContext Type. - public DbDomainServiceDescriptionProviderAttribute(Type dbContextType) - : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + public DbDomainServiceEFCoreDescriptionProviderAttribute(Type dbContextType) + : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) { this._dbContextType = dbContextType; } @@ -72,7 +72,7 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi this._dbContextType)); } - return new LinqToEntitiesDomainServiceDescriptionProvider(domainServiceType, this._dbContextType, parent); + return new LinqToEntitiesDomainServiceEFCoreDescriptionProvider(domainServiceType, this._dbContextType, parent); } /// @@ -83,13 +83,13 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi private static Type GetContextType(Type domainServiceType) { Type efDomainServiceType = domainServiceType.BaseType; - while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DbDomainService<>)) + while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DbDomainServiceEFCore<>)) { if (efDomainServiceType == typeof(object)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.InvalidMetadataProviderSpecification, - typeof(DbDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DbDomainService<>).Name)); + typeof(DbDomainServiceEFCoreDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DbDomainServiceEFCore<>).Name)); } efDomainServiceType = efDomainServiceType.BaseType; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs similarity index 95% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs index f04ad8752..d15acfd05 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainService.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs @@ -14,13 +14,13 @@ namespace OpenRiaServices.EntityFrameworkCore /// Base class for DomainServices operating on LINQ To Entities data models /// /// The Type of the LINQ To Entities ObjectContext - [LinqToEntitiesDomainServiceDescriptionProvider] - public abstract class LinqToEntitiesDomainService : DomainService where TContext : new() + [LinqToEntitiesDomainServiceEFCoreDescriptionProvider] + public abstract class LinqToEntitiesDomainServiceEFCore : DomainService where TContext : new() { /// /// Protected constructor because this is an abstract class /// - protected LinqToEntitiesDomainService() + protected LinqToEntitiesDomainServiceEFCore() { } @@ -45,7 +45,7 @@ public override void Initialize(DomainServiceContext context) /// The total number of rows. protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) { - return QueryHelper.CountAsync(query, cancellationToken); + return QueryHelperEFCore.CountAsync(query, cancellationToken); } /// diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs similarity index 80% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs index 528fbe4d7..0ad4f8a7d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs @@ -11,13 +11,13 @@ namespace OpenRiaServices.EntityFrameworkCore { // TODO: Remove and move code to DB context - internal class LinqToEntitiesDomainServiceDescriptionProvider : DomainServiceDescriptionProvider + internal class LinqToEntitiesDomainServiceEFCoreDescriptionProvider : DomainServiceDescriptionProvider { - private static Dictionary tdpContextMap = new Dictionary(); - private readonly LinqToEntitiesTypeDescriptionContext _typeDescriptionContext; + private static Dictionary tdpContextMap = new Dictionary(); + private readonly LinqToEntitiesEFCoreTypeDescriptionContext _typeDescriptionContext; private readonly Dictionary _descriptors = new Dictionary(); - public LinqToEntitiesDomainServiceDescriptionProvider(Type domainServiceType, Type contextType, DomainServiceDescriptionProvider parent) + public LinqToEntitiesDomainServiceEFCoreDescriptionProvider(Type domainServiceType, Type contextType, DomainServiceDescriptionProvider parent) : base(domainServiceType, parent) { lock (tdpContextMap) @@ -25,7 +25,7 @@ public LinqToEntitiesDomainServiceDescriptionProvider(Type domainServiceType, Ty if (!tdpContextMap.TryGetValue(contextType, out this._typeDescriptionContext)) { // create and cache a context for this provider type - this._typeDescriptionContext = new LinqToEntitiesTypeDescriptionContext(contextType); + this._typeDescriptionContext = new LinqToEntitiesEFCoreTypeDescriptionContext(contextType); tdpContextMap.Add(contextType, this._typeDescriptionContext); } } @@ -52,7 +52,7 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || edmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) { // only add an LTE TypeDescriptor if the type is an EF Entity or ComplexType - td = new LinqToEntitiesTypeDescriptor(this._typeDescriptionContext, edmType, parent); + td = new LinqToEntitiesEFCoreTypeDescriptor(this._typeDescriptionContext, edmType, parent); } else { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs similarity index 81% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs index f8d8da086..095d2a1b9 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs @@ -13,7 +13,7 @@ namespace OpenRiaServices.EntityFrameworkCore /// Types. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] - public sealed class LinqToEntitiesDomainServiceDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute + public sealed class LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute { private Type _objectContextType; @@ -22,8 +22,8 @@ public sealed class LinqToEntitiesDomainServiceDescriptionProviderAttribute : Do /// ObjectContext will be inferred from the the /// attribute is applied to. ///
- public LinqToEntitiesDomainServiceDescriptionProviderAttribute() - : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + public LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute() + : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) { } @@ -32,8 +32,8 @@ public LinqToEntitiesDomainServiceDescriptionProviderAttribute() /// ObjectContext Type. ///
/// The LINQ To Entities ObjectContext Type. - public LinqToEntitiesDomainServiceDescriptionProviderAttribute(Type objectContextType) - : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) + public LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute(Type objectContextType) + : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) { this._objectContextType = objectContextType; } @@ -67,7 +67,7 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi this._objectContextType = GetContextType(domainServiceType); } - return new LinqToEntitiesDomainServiceDescriptionProvider(domainServiceType, this._objectContextType, parent); + return new LinqToEntitiesDomainServiceEFCoreDescriptionProvider(domainServiceType, this._objectContextType, parent); } /// @@ -84,7 +84,7 @@ private static Type GetContextType(Type domainServiceType) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resource.InvalidMetadataProviderSpecification, - typeof(LinqToEntitiesDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DomainService).Name)); + typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DomainService).Name)); } efDomainServiceType = efDomainServiceType.BaseType; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs similarity index 95% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index 4aec671b3..1cb02350e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -12,7 +12,7 @@ namespace OpenRiaServices.EntityFrameworkCore /// /// Metadata context for LINQ To Entities domain services /// - internal class LinqToEntitiesTypeDescriptionContext : TypeDescriptionContextBase + internal class LinqToEntitiesEFCoreTypeDescriptionContext : TypeDescriptionContextBase { private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; @@ -22,7 +22,7 @@ internal class LinqToEntitiesTypeDescriptionContext : TypeDescriptionContextBase /// Constructor that accepts a LINQ To Entities context type /// /// The ObjectContext Type - public LinqToEntitiesTypeDescriptionContext(Type contextType) + public LinqToEntitiesEFCoreTypeDescriptionContext(Type contextType) { if (contextType == null) { @@ -41,7 +41,7 @@ public MetadataWorkspace MetadataWorkspace if (this._metadataWorkspace == null) { // we only support embedded mappings - this._metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspace(this._contextType); + this._metadataWorkspace = MetadataWorkspaceUtilitiesEFCore.CreateMetadataWorkspace(this._contextType); } return this._metadataWorkspace; } @@ -54,7 +54,7 @@ public MetadataWorkspace MetadataWorkspace /// The StructuralType that corresponds to the given CLR type public StructuralType GetEdmType(Type clrType) { - return ObjectContextUtilities.GetEdmType(this.MetadataWorkspace, clrType); + return ObjectContextUtilitiesEFCore.GetEdmType(this.MetadataWorkspace, clrType); } /// diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs similarity index 95% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs index 1d5eb33f8..8be485d90 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs @@ -17,9 +17,9 @@ namespace OpenRiaServices.EntityFrameworkCore /// /// CustomTypeDescriptor for LINQ To Entities /// - internal class LinqToEntitiesTypeDescriptor : TypeDescriptorBase + internal class LinqToEntitiesEFCoreTypeDescriptor : TypeDescriptorBase { - private readonly LinqToEntitiesTypeDescriptionContext _typeDescriptionContext; + private readonly LinqToEntitiesEFCoreTypeDescriptionContext _typeDescriptionContext; private readonly StructuralType _edmType; private readonly EdmMember _timestampMember; private readonly HashSet _foreignKeyMembers; @@ -28,16 +28,16 @@ internal class LinqToEntitiesTypeDescriptor : TypeDescriptorBase /// /// Constructor taking a metadata context, an structural type, and a parent custom type descriptor /// - /// The context. + /// The context. /// The type (can be an entity or complex type). /// The parent custom type descriptor. - public LinqToEntitiesTypeDescriptor(LinqToEntitiesTypeDescriptionContext typeDescriptionContext, StructuralType edmType, ICustomTypeDescriptor parent) + public LinqToEntitiesEFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescriptionContext, StructuralType edmType, ICustomTypeDescriptor parent) : base(parent) { this._typeDescriptionContext = typeDescriptionContext; this._edmType = edmType; - EdmMember[] timestampMembers = this._edmType.Members.Where(p => ObjectContextUtilities.IsConcurrencyTimestamp(p)).ToArray(); + EdmMember[] timestampMembers = this._edmType.Members.Where(p => ObjectContextUtilitiesEFCore.IsConcurrencyTimestamp(p)).ToArray(); if (timestampMembers.Length == 1) { this._timestampMember = timestampMembers[0]; @@ -63,7 +63,7 @@ public LinqToEntitiesTypeDescriptor(LinqToEntitiesTypeDescriptionContext typeDes /// /// Gets the metadata context /// - public LinqToEntitiesTypeDescriptionContext TypeDescriptionContext + public LinqToEntitiesEFCoreTypeDescriptionContext TypeDescriptionContext { get { @@ -136,7 +136,7 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor bool databaseGenerated = false; if (pd.Attributes[typeof(DatabaseGeneratedAttribute)] == null) { - MetadataProperty md = ObjectContextUtilities.GetStoreGeneratedPattern(member); + MetadataProperty md = ObjectContextUtilitiesEFCore.GetStoreGeneratedPattern(member); if (md != null) { if ((string)md.Value == "Computed") diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs similarity index 97% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs index 00eb04423..592aabcd9 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs @@ -11,7 +11,7 @@ namespace System.Data.Mapping /// /// EF metadata utilities class. /// - internal static class MetadataWorkspaceUtilities + internal static class MetadataWorkspaceUtilitiesEFCore { /// /// Creates a metadata workspace for the specified context. @@ -26,7 +26,7 @@ public static MetadataWorkspace CreateMetadataWorkspace(Type contextType) metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(ObjectContext)); #else - metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(DbContext)); + metadataWorkspace = MetadataWorkspaceUtilitiesEFCore.CreateMetadataWorkspaceFromResources(contextType, typeof(DbContext)); if (metadataWorkspace == null && typeof(DbContext).IsAssignableFrom(contextType)) { if (contextType.GetConstructor(Type.EmptyTypes) == null) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs similarity index 97% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs index ebda64c70..a73ba8a72 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs @@ -12,7 +12,7 @@ namespace OpenRiaServices.EntityFrameworkCore /// /// Internal utility functions for dealing with EF types and metadata /// - internal static class ObjectContextUtilities + internal static class ObjectContextUtilitiesEFCore { /// /// Retrieves the corresponding to the given CLR type (where the @@ -100,7 +100,7 @@ public static bool IsConcurrencyTimestamp(EdmMember member) return false; } - MetadataProperty md = ObjectContextUtilities.GetStoreGeneratedPattern(member); + MetadataProperty md = ObjectContextUtilitiesEFCore.GetStoreGeneratedPattern(member); if (md == null || facet.Value == null || (string)md.Value != "Computed") { return false; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs similarity index 94% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs index fa227caa2..64a16198e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs @@ -6,7 +6,7 @@ namespace OpenRiaServices.EntityFrameworkCore { - static class QueryHelper + static class QueryHelperEFCore { public static ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) { From 8e2a4b2e196c0b9a0163340f0e4a42608bcfa703 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 25 Oct 2021 10:26:58 +0200 Subject: [PATCH 07/99] All compiles --- ...nRiaServices.Hosting.Wcf.OData.Test.csproj | 1 + ...rviceEFCoreDescriptionProviderAttribute.cs | 2 +- ...rviceEFCoreDescriptionProviderAttribute.cs | 2 +- ...qToEntitiesEFCoreTypeDescriptionContext.cs | 2 +- .../LinqToEntitiesEFCoreTypeDescriptor.cs | 3 +- ...Services.Server.EntityFrameworkCore.csproj | 4 +- ...Designer.cs => ResourceEFCore.Designer.cs} | 6 +- .../{Resource.resx => ResourceEFCore.resx} | 0 .../Test/DomainServiceDescriptionTest.cs | 59 ++++++++- .../Test/OpenRiaServices.Server.Test.csproj | 2 + .../Test/CodeGenDomainServices.cs | 24 ++++ .../Northwind/EFCoreDbCtx_Northwind.cs | 2 +- .../LinqToEntitiesEFCoreDbContext.cs | 114 ++++++++++++++++++ 13 files changed, 208 insertions(+), 13 deletions(-) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{Resource.Designer.cs => ResourceEFCore.Designer.cs} (97%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{Resource.resx => ResourceEFCore.resx} (100%) create mode 100644 src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs diff --git a/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj b/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj index 2c835edec..8603062d2 100644 --- a/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj +++ b/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj @@ -35,6 +35,7 @@ + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs index 3580a57f6..ec3b57d7f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs @@ -88,7 +88,7 @@ private static Type GetContextType(Type domainServiceType) if (efDomainServiceType == typeof(object)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, - Resource.InvalidMetadataProviderSpecification, + ResourceEFCore.InvalidMetadataProviderSpecification, typeof(DbDomainServiceEFCoreDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DbDomainServiceEFCore<>).Name)); } efDomainServiceType = efDomainServiceType.BaseType; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs index 095d2a1b9..2ad4fdab7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs @@ -83,7 +83,7 @@ private static Type GetContextType(Type domainServiceType) if (efDomainServiceType == typeof(object)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, - Resource.InvalidMetadataProviderSpecification, + ResourceEFCore.InvalidMetadataProviderSpecification, typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DomainService).Name)); } efDomainServiceType = efDomainServiceType.BaseType; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index 1cb02350e..614c02f68 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -77,7 +77,7 @@ internal AssociationInfo GetAssociationInfo(NavigationProperty navigationPropert // We only support EF models where FK info is part of the model. throw new NotSupportedException( string.Format(CultureInfo.CurrentCulture, - Resource.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); + ResourceEFCore.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); } associationInfo = new AssociationInfo(); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs index 8be485d90..5cbff73ff 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs @@ -246,8 +246,7 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) { // exclude EntityState members - if (pd.PropertyType == typeof(EntityState) && - (pd.ComponentType == typeof(EntityObject) || typeof(IEntityChangeTracker).IsAssignableFrom(pd.ComponentType))) + if (pd.PropertyType == typeof(EntityState)) // TODO: Maybe also check pd.Component type { return true; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index cd34d079e..36d038fc2 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -22,8 +22,8 @@ True True - - Resource.resx + + ResourceEFCore.resx True True diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs similarity index 97% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs index ae27b8b9d..fb1f21893 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs @@ -22,14 +22,14 @@ namespace OpenRiaServices.EntityFrameworkCore { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resource { + internal class ResourceEFCore { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resource() { + internal ResourceEFCore() { } /// @@ -39,7 +39,7 @@ internal Resource() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.Resource", typeof(Resource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.Resource", typeof(ResourceEFCore).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.resx similarity index 100% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.resx diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 53b6cebad..9485954e0 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -29,6 +29,9 @@ namespace OpenRiaServices.Server.Test { using System.Threading.Tasks; + using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; + using Microsoft.EntityFrameworkCore.Metadata; + using OpenRiaServices.EntityFrameworkCore; using MetaType = SystemWebDomainServices::OpenRiaServices.Server.MetaType; // TODO Begin here to make it work with the new @@ -352,6 +355,19 @@ public void EFTypeDescriptor_ExcludedEntityMembers() Assert.IsTrue(LinqToEntitiesTypeDescriptor.ShouldExcludeEntityMember(pd)); } + [TestMethod] + public void EFCoreTypeDescriptor_ExcludedEntityMembers() + { + PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(EFCorePocoEntity_IEntityChangeTracker))["EntityState"]; + Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); + + pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModel.Customer))["EntityState"]; + Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); + + pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModel.Customer))["SalesTerritoryReference"]; + Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); + } + /// /// Verify that our EF custom type descriptors work for POCO models /// @@ -1425,7 +1441,7 @@ public void TestNonFKEntityFrameworkModels() LinqToEntitiesTypeDescriptionContext ctxt = new LinqToEntitiesTypeDescriptionContext(contextType); EntityType edmType = (EntityType)ctxt.GetEdmType(typeof(NorthwindModel.Product)); NavigationProperty navProp = edmType.NavigationProperties.Single(p => p.Name == "Category"); - AssociationInfo assocInfo = ctxt.GetAssociationInfo(navProp); + OpenRiaServices.EntityFramework.AssociationInfo assocInfo = ctxt.GetAssociationInfo(navProp); Assert.IsNotNull(assocInfo); contextType = typeof(NorthwindNoFks.Northwind_NoFks_Entities); @@ -3093,12 +3109,51 @@ public void EntityMemberChanging(string entityMemberName) throw new NotImplementedException(); } - public EntityState EntityState + public System.Data.Entity.EntityState EntityState { get { throw new NotImplementedException(); } } } + public class EFCorePocoEntity_IEntityChangeTracker : IChangeDetector + { + void IChangeDetector.DetectChanges(IStateManager stateManager) + { + throw new NotImplementedException(); + } + + void IChangeDetector.DetectChanges(InternalEntityEntry entry) + { + throw new NotImplementedException(); + } + + void IChangeDetector.PropertyChanged(InternalEntityEntry entry, IPropertyBase propertyBase, bool setModified) + { + throw new NotImplementedException(); + } + + void IChangeDetector.PropertyChanging(InternalEntityEntry entry, IPropertyBase propertyBase) + { + throw new NotImplementedException(); + } + + void IChangeDetector.Resume() + { + throw new NotImplementedException(); + } + + void IChangeDetector.Suspend() + { + throw new NotImplementedException(); + } + + public Microsoft.EntityFrameworkCore.EntityState EntityState + { + get { throw new NotImplementedException(); } + } + } + + #region DomainServiceDescriptionProvider samples /// /// Example provider showing how a new description can be constructed which adds diff --git a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj index c5aac49fd..5b0079993 100644 --- a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj +++ b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj @@ -14,6 +14,7 @@ + @@ -26,6 +27,7 @@ + diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index de5afa49d..c30457cd8 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -166,6 +166,30 @@ public void TestClientCodegen_EFDbCtxDomainServices_FullTypes() typeof(TestDomainServices.DbCtx.Northwind), sharedFiles, true)); } + [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFDbContext")] + [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFDbContext")] + [TestMethod] + public void TestClientCodegen_EFCoreEFDbCtxDomainServices() + { + string[] sharedFiles = Array.Empty(); + + // Default codegen + TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\Scenarios", "CG_Scenarios_EFDbContext", "EFDbContextScenarios.g", + typeof(TestDomainServices.EFCoreDbCtx.Northwind), sharedFiles, false)); + } + + [DeploymentItem(@"Baselines\FullTypeNames\Scenarios", "CG_Scenarios_EFDbContext_FullTypes")] + [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFDbContext_FullTypes")] + [TestMethod] + public void TestClientCodegen_EFCoreEFDbCtxDomainServices_FullTypes() + { + string[] sharedFiles = Array.Empty(); + + // Full type names + TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"FullTypeNames\Scenarios", "CG_Scenarios_EFDbContext_FullTypes", "EFDbContextScenarios.g", + typeof(TestDomainServices.EFCoreDbCtx.Northwind), sharedFiles, true)); + } + [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFCFDbContext")] [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFCFDbContext")] [TestMethod] diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs index 9ef610ba4..47990e841 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs @@ -14,7 +14,7 @@ namespace TestDomainServices.EFCoreDbCtx { [EnableClientAccess] - public class Northwind : DbDomainService + public class Northwind : DbDomainServiceEFCore { #region Product methods public Product GetProductById(int id) diff --git a/src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs b/src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs new file mode 100644 index 000000000..0a9b6a22b --- /dev/null +++ b/src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs @@ -0,0 +1,114 @@ +using System; +using System.CodeDom; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using OpenRiaServices.Tools; + +namespace OpenRiaServices.VisualStudio.DomainServices.Tools +{ + /// + /// Handles the LinqToEntities type of domain services based on EF Core DbContext + /// + public class LinqToEntitiesEFCoreDbContext : BusinessLogicContext + { + private bool? _isCodeFirstModel = null; + private readonly HashSet _visitedComplexTypes = new HashSet(); + + /// + /// Creates a new instance + /// + /// The CLR type of the + public LinqToEntitiesEFCoreDbContext(Type contextType) + : base(contextType, contextType.Name) + { + + } + + /// + /// Gets the name of the DAL technology of this context + /// + public override string DataAccessLayerName + { + get + { + return "EF Core"; + } + } + + + /// + /// Invoked to create the entities known to this context + /// + /// The list of entities + protected override IEnumerable CreateEntities() + { + List entities = new List(); + + return entities; + } + + + /// + /// Determines whether a property of the given type should be generated + /// in the associated metadata class. + /// + /// + /// This logic is meant to strip out DAL-level properties that will not appear + /// on the client. + /// + /// The type to test + /// true if it is legal to generate this property type in the business logic class. + protected override bool CanGeneratePropertyOfType(Type type) + { + if (base.CanGeneratePropertyOfType(type)) + { + return true; + } + return false; + } + + + /// + /// Generates the business logic class type. We override this to control the base class and imports + /// + /// The context to use to generate code. + /// The namespace into which to generate code. + /// The name to use for the class. + /// The new type + protected override CodeTypeDeclaration CreateBusinessLogicClass(CodeGenContext codeGenContext, CodeNamespace codeNamespace, string className) + { + // Add an import for our domain service + foreach (string import in BusinessLogicClassConstants.LinqToEntitiesDbImports) + { + codeNamespace.Imports.Add(new CodeNamespaceImport(import)); + } + + // Add an import for the namespace of the DomainContext + if (this.ContextType.Namespace != codeNamespace.Name) + { + codeNamespace.Imports.Add(new CodeNamespaceImport(BusinessLogicClassConstants.DbContextNamespace)); + codeNamespace.Imports.Add(new CodeNamespaceImport(this.ContextType.Namespace)); + } + + // Add to the set of known references + // codeGenContext.AddReference(typeof(EntityState).Assembly.FullName); + + // We used to add OpenRiaServices.EntityFramework, but due to + // vstfdevdiv/DevDiv2 Bug 442272 - Domain Service Wizard failing when an EF DbContext is selected, + // we need to avoid doing that. + + if (DbContextUtilities.DbContextTypeReference != null) + { + codeGenContext.AddReference(DbContextUtilities.DbContextTypeReference.Assembly.FullName); + } + + CodeTypeDeclaration businessLogicClass = CodeGenUtilities.CreateTypeDeclaration(className, codeNamespace.Name); + CodeTypeReference baseClass = new CodeTypeReference(BusinessLogicClassConstants.DbDomainServiceTypeName, new CodeTypeReference(this.ContextType.Name)); + businessLogicClass.BaseTypes.Add(baseClass); + return businessLogicClass; + } + + + } +} From 0fed1fad7fe524dfa6fad2274f5d37b9d77a2df2 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 25 Oct 2021 14:46:08 +0200 Subject: [PATCH 08/99] Rename --- ...eFirstModels.csproj => EFCoreCodeFirstModels_dont_care.csproj} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/{EFCoreCodeFirstModels.csproj => EFCoreCodeFirstModels_dont_care.csproj} (100%) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels_dont_care.csproj similarity index 100% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels.csproj rename to src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels_dont_care.csproj From 15ab71cdddd2f34143c01e1d3ca6a1aa4ada59de Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 25 Oct 2021 15:14:45 +0200 Subject: [PATCH 09/99] Added adwenture works --- .../AdventureWorks/AWBuildVersion.cs | 22 + .../DbContextModel/AdventureWorks/Address.cs | 42 + .../AdventureWorks/AddressType.cs | 31 + .../AdventureWorksDbCtx.Context.cs | 98 + .../AdventureWorksDbCtx.Context.tt | 194 + .../AdventureWorksDbCtx.Designer.cs | 10 + .../AdventureWorks/AdventureWorksDbCtx.cs | 9 + .../AdventureWorks/AdventureWorksDbCtx.edmx | 6405 +++++++++++++++++ .../AdventureWorks/AdventureWorksDbCtx.tt | 280 + .../AdventureWorksPartialClasses.cs | 112 + .../AdventureWorks/BillOfMaterial.cs | 31 + .../DbContextModel/AdventureWorks/Contact.cs | 50 + .../AdventureWorks/ContactCreditCard.cs | 24 + .../AdventureWorks/ContactType.cs | 30 + .../AdventureWorks/CountryRegion.cs | 30 + .../AdventureWorks/CountryRegionCurrency.cs | 24 + .../AdventureWorks/CreditCard.cs | 33 + .../DbContextModel/AdventureWorks/Culture.cs | 28 + .../DbContextModel/AdventureWorks/Currency.cs | 32 + .../AdventureWorks/CurrencyRate.cs | 34 + .../DbContextModel/AdventureWorks/Customer.cs | 36 + .../AdventureWorks/CustomerAddress.cs | 27 + .../AdventureWorks/DatabaseLog.cs | 26 + .../AdventureWorks/Department.cs | 29 + .../DbContextModel/AdventureWorks/Document.cs | 35 + .../DbContextModel/AdventureWorks/Employee.cs | 54 + .../AdventureWorks/EmployeeAddress.cs | 25 + .../EmployeeDepartmentHistory.cs | 28 + .../AdventureWorks/EmployeePayHistory.cs | 25 + .../DbContextModel/AdventureWorks/ErrorLog.cs | 27 + .../AdventureWorks/Illustration.cs | 28 + .../AdventureWorks/Individual.cs | 25 + .../AdventureWorks/JobCandidate.cs | 24 + .../DbContextModel/AdventureWorks/Location.cs | 32 + .../DbContextModel/AdventureWorks/Product.cs | 80 + .../AdventureWorks/ProductCategory.cs | 29 + .../AdventureWorks/ProductCostHistory.cs | 25 + .../AdventureWorks/ProductDescription.cs | 29 + .../AdventureWorks/ProductDocument.cs | 24 + .../AdventureWorks/ProductInventory.cs | 28 + .../AdventureWorks/ProductListPriceHistory.cs | 25 + .../AdventureWorks/ProductModel.cs | 35 + .../ProductModelIllustration.cs | 24 + .../ProductModelProductDescriptionCulture.cs | 26 + .../AdventureWorks/ProductPhoto.cs | 31 + .../AdventureWorks/ProductProductPhoto.cs | 25 + .../AdventureWorks/ProductReview.cs | 28 + .../AdventureWorks/ProductSubcategory.cs | 31 + .../AdventureWorks/ProductVendor.cs | 33 + .../AdventureWorks/PurchaseOrder.cs | 41 + .../AdventureWorks/PurchaseOrderDetail.cs | 32 + .../AdventureWorks/SalesOrderDetail.cs | 32 + .../AdventureWorks/SalesOrderHeader.cs | 63 + .../SalesOrderHeaderSalesReason.cs | 24 + .../AdventureWorks/SalesPerson.cs | 42 + .../AdventureWorks/SalesPersonQuotaHistory.cs | 25 + .../AdventureWorks/SalesReason.cs | 29 + .../AdventureWorks/SalesTaxRate.cs | 27 + .../AdventureWorks/SalesTerritory.cs | 43 + .../AdventureWorks/SalesTerritoryHistory.cs | 27 + .../AdventureWorks/ScrapReason.cs | 28 + .../DbContextModel/AdventureWorks/Shift.cs | 30 + .../AdventureWorks/ShipMethod.cs | 33 + .../AdventureWorks/ShoppingCartItem.cs | 26 + .../AdventureWorks/SpecialOffer.cs | 36 + .../AdventureWorks/SpecialOfferProduct.cs | 31 + .../AdventureWorks/StateProvince.cs | 37 + .../DbContextModel/AdventureWorks/Store.cs | 33 + .../AdventureWorks/StoreContact.cs | 27 + .../AdventureWorks/TransactionHistory.cs | 29 + .../TransactionHistoryArchive.cs | 27 + .../AdventureWorks/UnitMeasure.cs | 34 + .../DbContextModel/AdventureWorks/Vendor.cs | 39 + .../AdventureWorks/VendorAddress.cs | 26 + .../AdventureWorks/VendorContact.cs | 26 + .../AdventureWorks/WorkOrder.cs | 37 + .../AdventureWorks/WorkOrderRouting.cs | 33 + .../AdventureWorks/sysdiagram.cs | 23 + .../EFCoreDbContextModels.csproj | 241 + 79 files changed, 9594 insertions(+) create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs new file mode 100644 index 000000000..1a5e1b83f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class AWBuildVersion + { + public byte SystemInformationID { get; set; } + public string Database_Version { get; set; } + public System.DateTime VersionDate { get; set; } + public System.DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs new file mode 100644 index 000000000..e6c700c94 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Address + { + public Address() + { + this.EmployeeAddresses = new HashSet(); + this.CustomerAddresses = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + this.SalesOrderHeaders1 = new HashSet(); + this.VendorAddresses = new HashSet(); + } + + public int AddressID { get; set; } + public string AddressLine1 { get; set; } + public string AddressLine2 { get; set; } + public string City { get; set; } + public int StateProvinceID { get; set; } + public string PostalCode { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection EmployeeAddresses { get; set; } + public virtual StateProvince StateProvince { get; set; } + public virtual ICollection CustomerAddresses { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual ICollection SalesOrderHeaders1 { get; set; } + public virtual ICollection VendorAddresses { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs new file mode 100644 index 000000000..1c7790a5a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class AddressType + { + public AddressType() + { + this.CustomerAddresses = new HashSet(); + this.VendorAddresses = new HashSet(); + } + + public int AddressTypeID { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection CustomerAddresses { get; set; } + public virtual ICollection VendorAddresses { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs new file mode 100644 index 000000000..cc26da788 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs @@ -0,0 +1,98 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using Microsoft.EntityFrameworkCore; + + public partial class DbCtxAdventureWorksEntities : DbContext + { + public DbCtxAdventureWorksEntities() + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + throw new NotImplementedException(); + } + + public DbSet AWBuildVersions { get; set; } + public DbSet DatabaseLogs { get; set; } + public DbSet ErrorLogs { get; set; } + public DbSet sysdiagrams { get; set; } + public DbSet Departments { get; set; } + public DbSet Employees { get; set; } + public DbSet EmployeeAddresses { get; set; } + public DbSet EmployeeDepartmentHistories { get; set; } + public DbSet EmployeePayHistories { get; set; } + public DbSet JobCandidates { get; set; } + public DbSet Shifts { get; set; } + public DbSet
Addresses { get; set; } + public DbSet AddressTypes { get; set; } + public DbSet Contacts { get; set; } + public DbSet ContactTypes { get; set; } + public DbSet CountryRegions { get; set; } + public DbSet StateProvinces { get; set; } + public DbSet BillOfMaterials { get; set; } + public DbSet Cultures { get; set; } + public DbSet Documents { get; set; } + public DbSet Illustrations { get; set; } + public DbSet Locations { get; set; } + public DbSet Products { get; set; } + public DbSet ProductCategories { get; set; } + public DbSet ProductCostHistories { get; set; } + public DbSet ProductDescriptions { get; set; } + public DbSet ProductDocuments { get; set; } + public DbSet ProductInventories { get; set; } + public DbSet ProductListPriceHistories { get; set; } + public DbSet ProductModels { get; set; } + public DbSet ProductModelIllustrations { get; set; } + public DbSet ProductModelProductDescriptionCultures { get; set; } + public DbSet ProductPhotoes { get; set; } + public DbSet ProductProductPhotoes { get; set; } + public DbSet ProductReviews { get; set; } + public DbSet ProductSubcategories { get; set; } + public DbSet ScrapReasons { get; set; } + public DbSet TransactionHistories { get; set; } + public DbSet TransactionHistoryArchives { get; set; } + public DbSet UnitMeasures { get; set; } + public DbSet WorkOrders { get; set; } + public DbSet WorkOrderRoutings { get; set; } + public DbSet ProductVendors { get; set; } + public DbSet PurchaseOrderDetails { get; set; } + public DbSet PurchaseOrders { get; set; } + public DbSet ShipMethods { get; set; } + public DbSet Vendors { get; set; } + public DbSet VendorAddresses { get; set; } + public DbSet VendorContacts { get; set; } + public DbSet ContactCreditCards { get; set; } + public DbSet CountryRegionCurrencies { get; set; } + public DbSet CreditCards { get; set; } + public DbSet Currencies { get; set; } + public DbSet CurrencyRates { get; set; } + public DbSet Customers { get; set; } + public DbSet CustomerAddresses { get; set; } + public DbSet Individuals { get; set; } + public DbSet SalesOrderDetails { get; set; } + public DbSet SalesOrderHeaders { get; set; } + public DbSet SalesOrderHeaderSalesReasons { get; set; } + public DbSet SalesPersons { get; set; } + public DbSet SalesPersonQuotaHistories { get; set; } + public DbSet SalesReasons { get; set; } + public DbSet SalesTaxRates { get; set; } + public DbSet SalesTerritories { get; set; } + public DbSet SalesTerritoryHistories { get; set; } + public DbSet ShoppingCartItems { get; set; } + public DbSet SpecialOffers { get; set; } + public DbSet SpecialOfferProducts { get; set; } + public DbSet Stores { get; set; } + public DbSet StoreContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt new file mode 100644 index 000000000..97de62047 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt @@ -0,0 +1,194 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +var loader = new MetadataLoader(this); +var region = new CodeRegion(this); +var inputFile = @"AdventureWorksDbCtx.edmx"; +var ItemCollection = loader.CreateEdmItemCollection(inputFile); + +Code = new CodeGenerationTools(this); +EFTools = new MetadataTools(this); +ObjectNamespace = Code.VsNamespaceSuggestion(); +ModelNamespace = loader.GetModelNamespace(inputFile); + +EntityContainer container = ItemCollection.GetItems().FirstOrDefault(); +if (container == null) +{ + return string.Empty; +} +#> +//------------------------------------------------------------------------------ +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<# + +if (!String.IsNullOrEmpty(ObjectNamespace)) +{ +#> +namespace <#=Code.EscapeNamespace(ObjectNamespace)#> +{ +<# + PushIndent(CodeRegion.GetIndent(1)); +} + +#> +using System; +using System.Data.Entity; +using System.Data.Entity.Infrastructure; +<# +if (container.FunctionImports.Any()) +{ +#> +using System.Data.Objects; +<# +} +#> + +<#=Accessibility.ForType(container)#> partial class <#=Code.Escape(container)#> : DbContext +{ + public <#=Code.Escape(container)#>() + : base("name=<#=container.Name#>") + { +<# + WriteLazyLoadingEnabled(container); +#> + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + throw new UnintentionalCodeFirstException(); + } + +<# + foreach (var entitySet in container.BaseEntitySets.OfType()) + { +#> + <#=Accessibility.ForReadOnlyProperty(entitySet)#> DbSet<<#=Code.Escape(entitySet.ElementType)#>> <#=Code.Escape(entitySet)#> { get; set; } +<# + } + + foreach (var edmFunction in container.FunctionImports) + { + WriteFunctionImport(edmFunction, false); + } +#> +} +<# + +if (!String.IsNullOrEmpty(ObjectNamespace)) +{ + PopIndent(); +#> +} +<# +} +#> +<#+ +string ModelNamespace { get; set; } +string ObjectNamespace { get; set; } +CodeGenerationTools Code { get; set; } +MetadataTools EFTools { get; set; } + +string GetResourceString(string resourceName) +{ + if(_resourceManager == null) + { + _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); + } + + return _resourceManager.GetString(resourceName, null); +} +System.Resources.ResourceManager _resourceManager; + +void WriteLazyLoadingEnabled(EntityContainer container) +{ + string lazyLoadingAttributeValue = null; + var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; + if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) + { + bool isLazyLoading; + if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading) && !isLazyLoading) + { +#> + this.Configuration.LazyLoadingEnabled = false; +<#+ + } + } +} + +void WriteFunctionImport(EdmFunction edmFunction, bool includeMergeOption) +{ + var parameters = FunctionImportParameter.Create(edmFunction.Parameters, Code, EFTools); + var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); + var returnType = edmFunction.ReturnParameter == null ? null : EFTools.GetElementType(edmFunction.ReturnParameter.TypeUsage); + var processedReturn = returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType) + ">"; + + if (includeMergeOption) + { + paramList = Code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; + } +#> + + <#=AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction))#> <#=processedReturn#> <#=Code.Escape(edmFunction)#>(<#=paramList#>) + { +<#+ + if(returnType != null && (returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || + returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) + { +#> + ((IObjectContextAdapter)this).ObjectContext.MetadataWorkspace.LoadFromAssembly(typeof(<#=MultiSchemaEscape(returnType)#>).Assembly); + +<#+ + } + + foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) + { + var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; + var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; + var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))"; +#> + var <#=parameter.LocalVariableName#> = <#=isNotNull#> ? + <#=notNullInit#> : + <#=nullInit#>; + +<#+ + } + + var genericArg = returnType == null ? "" : "<" + MultiSchemaEscape(returnType) + ">"; + var callParams = Code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); + + if (includeMergeOption) + { + callParams = ", mergeOption" + callParams; + } +#> + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<#=genericArg#>("<#=edmFunction.Name#>"<#=callParams#>); + } +<#+ + if(!includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { + WriteFunctionImport(edmFunction, true); + } +} + +string AccessibilityAndVirtual(string accessibility) +{ + return accessibility + (accessibility != "private" ? " virtual" : ""); +} + +string MultiSchemaEscape(TypeUsage usage) +{ + var type = usage.EdmType as StructuralType; + return type != null && type.NamespaceName != ModelNamespace ? + Code.CreateFullName(Code.EscapeNamespace(type.NamespaceName), Code.Escape(type)) : + Code.Escape(usage); +} + +#> \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs new file mode 100644 index 000000000..c525f7482 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs @@ -0,0 +1,10 @@ +// T4 code generation is enabled for model 'C:\Users\crmhli\source\repos\OpenRiaServices\src\OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\AdventureWorks\AdventureWorksDbCtx.edmx'. +// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer +// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model +// is open in the designer. + +// If no context and entity classes have been generated, it may be because you created an empty model but +// have not yet chosen which version of Entity Framework to use. To generate a context class and entity +// classes for your model, open the model in the designer, right-click on the designer surface, and +// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation +// Item...'. \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs new file mode 100644 index 000000000..0c4c97d77 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs @@ -0,0 +1,9 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx new file mode 100644 index 000000000..e66327900 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx @@ -0,0 +1,6405 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt new file mode 100644 index 000000000..097b51b40 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt @@ -0,0 +1,280 @@ +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +CodeGenerationTools code = new CodeGenerationTools(this); +MetadataLoader loader = new MetadataLoader(this); +CodeRegion region = new CodeRegion(this, 1); +MetadataTools ef = new MetadataTools(this); + +string inputFile = @"AdventureWorksDbCtx.edmx"; +EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile); +string namespaceName = code.VsNamespaceSuggestion(); + +EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this); +WriteHeader(fileManager); + +foreach (var entity in ItemCollection.GetItems().OrderBy(e => e.Name)) +{ + fileManager.StartNewFile(entity.Name + ".cs"); + BeginNamespace(namespaceName, code); +#> +using System; +using System.Collections.Generic; + +<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#><#=code.StringBefore(" : ", code.Escape(entity.BaseType))#> +{ +<# + var propertiesWithDefaultValues = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity && p.DefaultValue != null); + var collectionNavigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); + var complexProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == entity); + + if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(entity)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var navigationProperty in collectionNavigationProperties) + { +#> + this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=code.Escape(navigationProperty.ToEndMember.GetEntityType())#>>(); +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var primitiveProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity); + if (primitiveProperties.Any()) + { + foreach (var edmProperty in primitiveProperties) + { + WriteProperty(code, edmProperty); + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var complexProperty in complexProperties) + { + WriteProperty(code, complexProperty); + } + } + + var navigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity); + if (navigationProperties.Any()) + { +#> + +<# + foreach (var navigationProperty in navigationProperties) + { + WriteNavigationProperty(code, navigationProperty); + } + } +#> +} +<# + EndNamespace(namespaceName); +} + +foreach (var complex in ItemCollection.GetItems().OrderBy(e => e.Name)) +{ + fileManager.StartNewFile(complex.Name + ".cs"); + BeginNamespace(namespaceName, code); +#> +using System; + +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> +{ +<# + var complexProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == complex); + var propertiesWithDefaultValues = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex && p.DefaultValue != null); + + if (propertiesWithDefaultValues.Any() || complexProperties.Any()) + { +#> + public <#=code.Escape(complex)#>() + { +<# + foreach (var edmProperty in propertiesWithDefaultValues) + { +#> + this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; +<# + } + + foreach (var complexProperty in complexProperties) + { +#> + this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); +<# + } +#> + } + +<# + } + + var primitiveProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex); + if (primitiveProperties.Any()) + { + foreach(var edmProperty in primitiveProperties) + { + WriteProperty(code, edmProperty); + } + } + + if (complexProperties.Any()) + { +#> + +<# + foreach(var edmProperty in complexProperties) + { + WriteProperty(code, edmProperty); + } + } +#> +} +<# + EndNamespace(namespaceName); +} + +if (!VerifyTypesAreCaseInsensitiveUnique(ItemCollection)) +{ + return ""; +} + +fileManager.Process(); + +#> +<#+ +string GetResourceString(string resourceName) +{ + if(_resourceManager == null) + { + _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); + } + + return _resourceManager.GetString(resourceName, null); +} +System.Resources.ResourceManager _resourceManager; + +void WriteHeader(EntityFrameworkTemplateFileManager fileManager) +{ + fileManager.StartHeader(); +#> +//------------------------------------------------------------------------------ +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +<#+ + fileManager.EndBlock(); +} + +void BeginNamespace(string namespaceName, CodeGenerationTools code) +{ + CodeRegion region = new CodeRegion(this); + if (!String.IsNullOrEmpty(namespaceName)) + { +#> +namespace <#=code.EscapeNamespace(namespaceName)#> +{ +<#+ + PushIndent(CodeRegion.GetIndent(1)); + } +} + + +void EndNamespace(string namespaceName) +{ + if (!String.IsNullOrEmpty(namespaceName)) + { + PopIndent(); +#> +} +<#+ + } +} + +void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty) +{ + WriteProperty(Accessibility.ForProperty(edmProperty), + code.Escape(edmProperty.TypeUsage), + code.Escape(edmProperty), + code.SpaceAfter(Accessibility.ForGetter(edmProperty)), + code.SpaceAfter(Accessibility.ForSetter(edmProperty))); +} + +void WriteNavigationProperty(CodeGenerationTools code, NavigationProperty navigationProperty) +{ + var endType = code.Escape(navigationProperty.ToEndMember.GetEntityType()); + WriteProperty(PropertyVirtualModifier(Accessibility.ForProperty(navigationProperty)), + navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, + code.Escape(navigationProperty), + code.SpaceAfter(Accessibility.ForGetter(navigationProperty)), + code.SpaceAfter(Accessibility.ForSetter(navigationProperty))); +} + +void WriteProperty(string accessibility, string type, string name, string getterAccessibility, string setterAccessibility) +{ +#> + <#=accessibility#> <#=type#> <#=name#> { <#=getterAccessibility#>get; <#=setterAccessibility#>set; } +<#+ +} + +string PropertyVirtualModifier(string accessibility) +{ + return accessibility + (accessibility != "private" ? " virtual" : ""); +} + +bool VerifyTypesAreCaseInsensitiveUnique(EdmItemCollection itemCollection) +{ + var alreadySeen = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach(var type in itemCollection.GetItems()) + { + if (!(type is EntityType || type is ComplexType)) + { + continue; + } + + if (alreadySeen.ContainsKey(type.FullName)) + { + Error(String.Format(CultureInfo.CurrentCulture, "This template does not support types that differ only by case, the types {0} are not supported", type.FullName)); + return false; + } + else + { + alreadySeen.Add(type.FullName, true); + } + } + + return true; +} +#> diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs new file mode 100644 index 000000000..8d27c0402 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs @@ -0,0 +1,112 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.SqlServer; +using OpenRiaServices.Server; + +// These assembly attributes allow us to serialize different CLR types into the same contract +[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks", + ClrNamespace = "DbContextModels.AdventureWorksEFCore")] + +namespace DbContextModels.AdventureWorksEFCore +{ + public partial class DbCtxAdventureWorksEntities + { + string _connection; + public DbCtxAdventureWorksEntities(string connectionString) + { + _connection = connectionString; + } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + base.OnConfiguring(optionsBuilder); + optionsBuilder.UseSqlServer(_connection); + } + } + + [MetadataType(typeof(PurchaseOrderMetadata))] + public partial class PurchaseOrder + { + } + + [MetadataType(typeof(PurchaseOrderDetailMetadata))] + public partial class PurchaseOrderDetail + { + } + + public static class PurchaseOrderMetadata + { + [Include] + public static object PurchaseOrderDetails; + } + + public static class PurchaseOrderDetailMetadata + { + [Include] + public static object Product; + } + + [MetadataType(typeof(ProductMetadata))] + public partial class Product + { + } + + public static class ProductMetadata + { + [Exclude] + public static object SafetyStockLevel; + + [RoundtripOriginal] + public static object Weight; + } + + [MetadataType(typeof(EmployeeMetadata))] + public partial class Employee + { + } + + public static class EmployeeMetadata + { + [Include] + public static object Manager; + } + + public class EmployeeInfo + { + public static EmployeeInfo CreateEmployeeInfo(int employeeID, string firstName, string lastName, int territoryID) + { + EmployeeInfo empInfo = new EmployeeInfo(); + empInfo.EmployeeID = employeeID; + empInfo.FirstName = firstName; + empInfo.LastName = lastName; + empInfo.TerritoryID = territoryID; + return empInfo; + } + + [Key] + public int EmployeeID + { + get; + set; + } + + public string FirstName + { + get; + set; + } + public string LastName + { + get; + set; + } + public int TerritoryID + { + get; + set; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs new file mode 100644 index 000000000..2b5ab3ca7 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class BillOfMaterial + { + public int BillOfMaterialsID { get; set; } + public Nullable ProductAssemblyID { get; set; } + public int ComponentID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public string UnitMeasureCode { get; set; } + public short BOMLevel { get; set; } + public decimal PerAssemblyQty { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual Product Product1 { get; set; } + public virtual UnitMeasure UnitMeasure { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs new file mode 100644 index 000000000..5e359eeb1 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Contact + { + public Contact() + { + this.Employees = new HashSet(); + this.ContactCreditCards = new HashSet(); + this.Individuals = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + this.StoreContacts = new HashSet(); + this.VendorContacts = new HashSet(); + } + + public int ContactID { get; set; } + public bool NameStyle { get; set; } + public string Title { get; set; } + public string FirstName { get; set; } + public string MiddleName { get; set; } + public string LastName { get; set; } + public string Suffix { get; set; } + public string EmailAddress { get; set; } + public int EmailPromotion { get; set; } + public string Phone { get; set; } + public string PasswordHash { get; set; } + public string PasswordSalt { get; set; } + public string AdditionalContactInfo { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection Employees { get; set; } + public virtual ICollection ContactCreditCards { get; set; } + public virtual ICollection Individuals { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual ICollection StoreContacts { get; set; } + public virtual ICollection VendorContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs new file mode 100644 index 000000000..23dedea59 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ContactCreditCard + { + public int ContactID { get; set; } + public int CreditCardID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual CreditCard CreditCard { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs new file mode 100644 index 000000000..e80c53992 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ContactType + { + public ContactType() + { + this.StoreContacts = new HashSet(); + this.VendorContacts = new HashSet(); + } + + public int ContactTypeID { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection StoreContacts { get; set; } + public virtual ICollection VendorContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs new file mode 100644 index 000000000..4165add13 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class CountryRegion + { + public CountryRegion() + { + this.CountryRegionCurrencies = new HashSet(); + this.StateProvinces = new HashSet(); + } + + public string CountryRegionCode { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection CountryRegionCurrencies { get; set; } + public virtual ICollection StateProvinces { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs new file mode 100644 index 000000000..3041d3195 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class CountryRegionCurrency + { + public string CountryRegionCode { get; set; } + public string CurrencyCode { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual CountryRegion CountryRegion { get; set; } + public virtual Currency Currency { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs new file mode 100644 index 000000000..315e50f73 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class CreditCard + { + public CreditCard() + { + this.ContactCreditCards = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + } + + public int CreditCardID { get; set; } + public string CardType { get; set; } + public string CardNumber { get; set; } + public byte ExpMonth { get; set; } + public short ExpYear { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ContactCreditCards { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs new file mode 100644 index 000000000..1e7873ac4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Culture + { + public Culture() + { + this.ProductModelProductDescriptionCultures = new HashSet(); + } + + public string CultureID { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs new file mode 100644 index 000000000..134de81e0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Currency + { + public Currency() + { + this.CountryRegionCurrencies = new HashSet(); + this.CurrencyRates = new HashSet(); + this.CurrencyRates1 = new HashSet(); + } + + public string CurrencyCode { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection CountryRegionCurrencies { get; set; } + public virtual ICollection CurrencyRates { get; set; } + public virtual ICollection CurrencyRates1 { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs new file mode 100644 index 000000000..52e8a2d98 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class CurrencyRate + { + public CurrencyRate() + { + this.SalesOrderHeaders = new HashSet(); + } + + public int CurrencyRateID { get; set; } + public System.DateTime CurrencyRateDate { get; set; } + public string FromCurrencyCode { get; set; } + public string ToCurrencyCode { get; set; } + public decimal AverageRate { get; set; } + public decimal EndOfDayRate { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Currency Currency { get; set; } + public virtual Currency Currency1 { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs new file mode 100644 index 000000000..da2802401 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Customer + { + public Customer() + { + this.CustomerAddresses = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + } + + public int CustomerID { get; set; } + public Nullable TerritoryID { get; set; } + public string AccountNumber { get; set; } + public string CustomerType { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesTerritory SalesTerritory { get; set; } + public virtual ICollection CustomerAddresses { get; set; } + public virtual Individual Individual { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual Store Store { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs new file mode 100644 index 000000000..01e4696ca --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class CustomerAddress + { + public int CustomerID { get; set; } + public int AddressID { get; set; } + public int AddressTypeID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Address Address { get; set; } + public virtual AddressType AddressType { get; set; } + public virtual Customer Customer { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs new file mode 100644 index 000000000..0cda0d149 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class DatabaseLog + { + public int DatabaseLogID { get; set; } + public System.DateTime PostTime { get; set; } + public string DatabaseUser { get; set; } + public string Event { get; set; } + public string Schema { get; set; } + public string Object { get; set; } + public string TSQL { get; set; } + public string XmlEvent { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs new file mode 100644 index 000000000..4048730b5 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Department + { + public Department() + { + this.EmployeeDepartmentHistories = new HashSet(); + } + + public short DepartmentID { get; set; } + public string Name { get; set; } + public string GroupName { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection EmployeeDepartmentHistories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs new file mode 100644 index 000000000..ac277b21b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Document + { + public Document() + { + this.ProductDocuments = new HashSet(); + } + + public int DocumentID { get; set; } + public string Title { get; set; } + public string FileName { get; set; } + public string FileExtension { get; set; } + public string Revision { get; set; } + public int ChangeNumber { get; set; } + public byte Status { get; set; } + public string DocumentSummary { get; set; } + public byte[] Document1 { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductDocuments { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs new file mode 100644 index 000000000..d2ccd28f3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs @@ -0,0 +1,54 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Employee + { + public Employee() + { + this.Reports = new HashSet(); + this.EmployeeAddresses = new HashSet(); + this.EmployeeDepartmentHistories = new HashSet(); + this.EmployeePayHistories = new HashSet(); + this.JobCandidates = new HashSet(); + this.PurchaseOrders = new HashSet(); + } + + public int EmployeeID { get; set; } + public string NationalIDNumber { get; set; } + public int ContactID { get; set; } + public string LoginID { get; set; } + public Nullable ManagerID { get; set; } + public string Title { get; set; } + public System.DateTime BirthDate { get; set; } + public string MaritalStatus { get; set; } + public string Gender { get; set; } + public System.DateTime HireDate { get; set; } + public bool SalariedFlag { get; set; } + public short VacationHours { get; set; } + public short SickLeaveHours { get; set; } + public bool CurrentFlag { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual ICollection Reports { get; set; } + public virtual Employee Manager { get; set; } + public virtual ICollection EmployeeAddresses { get; set; } + public virtual ICollection EmployeeDepartmentHistories { get; set; } + public virtual ICollection EmployeePayHistories { get; set; } + public virtual ICollection JobCandidates { get; set; } + public virtual ICollection PurchaseOrders { get; set; } + public virtual SalesPerson SalesPerson { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs new file mode 100644 index 000000000..219ddf21a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class EmployeeAddress + { + public int EmployeeID { get; set; } + public int AddressID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + public virtual Address Address { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs new file mode 100644 index 000000000..7b6ecb654 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class EmployeeDepartmentHistory + { + public int EmployeeID { get; set; } + public short DepartmentID { get; set; } + public byte ShiftID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Department Department { get; set; } + public virtual Employee Employee { get; set; } + public virtual Shift Shift { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs new file mode 100644 index 000000000..e35e2438a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class EmployeePayHistory + { + public int EmployeeID { get; set; } + public System.DateTime RateChangeDate { get; set; } + public decimal Rate { get; set; } + public byte PayFrequency { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs new file mode 100644 index 000000000..c558e789d --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ErrorLog + { + public int ErrorLogID { get; set; } + public System.DateTime ErrorTime { get; set; } + public string UserName { get; set; } + public int ErrorNumber { get; set; } + public Nullable ErrorSeverity { get; set; } + public Nullable ErrorState { get; set; } + public string ErrorProcedure { get; set; } + public Nullable ErrorLine { get; set; } + public string ErrorMessage { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs new file mode 100644 index 000000000..7135bdaae --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Illustration + { + public Illustration() + { + this.ProductModelIllustrations = new HashSet(); + } + + public int IllustrationID { get; set; } + public string Diagram { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductModelIllustrations { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs new file mode 100644 index 000000000..75b95c8c3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Individual + { + public int CustomerID { get; set; } + public int ContactID { get; set; } + public string Demographics { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual Customer Customer { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs new file mode 100644 index 000000000..e54da12b3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class JobCandidate + { + public int JobCandidateID { get; set; } + public Nullable EmployeeID { get; set; } + public string Resume { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs new file mode 100644 index 000000000..238e6725c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Location + { + public Location() + { + this.ProductInventories = new HashSet(); + this.WorkOrderRoutings = new HashSet(); + } + + public short LocationID { get; set; } + public string Name { get; set; } + public decimal CostRate { get; set; } + public decimal Availability { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductInventories { get; set; } + public virtual ICollection WorkOrderRoutings { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs new file mode 100644 index 000000000..6c525acd7 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Product + { + public Product() + { + this.BillOfMaterials = new HashSet(); + this.BillOfMaterials1 = new HashSet(); + this.ProductCostHistories = new HashSet(); + this.ProductDocuments = new HashSet(); + this.ProductInventories = new HashSet(); + this.ProductListPriceHistories = new HashSet(); + this.ProductProductPhotoes = new HashSet(); + this.ProductReviews = new HashSet(); + this.ProductVendors = new HashSet(); + this.PurchaseOrderDetails = new HashSet(); + this.ShoppingCartItems = new HashSet(); + this.SpecialOfferProducts = new HashSet(); + this.TransactionHistories = new HashSet(); + this.WorkOrders = new HashSet(); + } + + public int ProductID { get; set; } + public string Name { get; set; } + public string ProductNumber { get; set; } + public bool MakeFlag { get; set; } + public bool FinishedGoodsFlag { get; set; } + public string Color { get; set; } + public short SafetyStockLevel { get; set; } + public short ReorderPoint { get; set; } + public decimal StandardCost { get; set; } + public decimal ListPrice { get; set; } + public string Size { get; set; } + public string SizeUnitMeasureCode { get; set; } + public string WeightUnitMeasureCode { get; set; } + public Nullable Weight { get; set; } + public int DaysToManufacture { get; set; } + public string ProductLine { get; set; } + public string Class { get; set; } + public string Style { get; set; } + public Nullable ProductSubcategoryID { get; set; } + public Nullable ProductModelID { get; set; } + public System.DateTime SellStartDate { get; set; } + public Nullable SellEndDate { get; set; } + public Nullable DiscontinuedDate { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection BillOfMaterials { get; set; } + public virtual ICollection BillOfMaterials1 { get; set; } + public virtual ProductModel ProductModel { get; set; } + public virtual ProductSubcategory ProductSubcategory { get; set; } + public virtual UnitMeasure UnitMeasure { get; set; } + public virtual UnitMeasure UnitMeasure1 { get; set; } + public virtual ICollection ProductCostHistories { get; set; } + public virtual ICollection ProductDocuments { get; set; } + public virtual ICollection ProductInventories { get; set; } + public virtual ICollection ProductListPriceHistories { get; set; } + public virtual ICollection ProductProductPhotoes { get; set; } + public virtual ICollection ProductReviews { get; set; } + public virtual ICollection ProductVendors { get; set; } + public virtual ICollection PurchaseOrderDetails { get; set; } + public virtual ICollection ShoppingCartItems { get; set; } + public virtual ICollection SpecialOfferProducts { get; set; } + public virtual ICollection TransactionHistories { get; set; } + public virtual ICollection WorkOrders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs new file mode 100644 index 000000000..5dd599ef2 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductCategory + { + public ProductCategory() + { + this.ProductSubcategories = new HashSet(); + } + + public int ProductCategoryID { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductSubcategories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs new file mode 100644 index 000000000..fff1c9b1c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductCostHistory + { + public int ProductID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public decimal StandardCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs new file mode 100644 index 000000000..5b6593d73 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductDescription + { + public ProductDescription() + { + this.ProductModelProductDescriptionCultures = new HashSet(); + } + + public int ProductDescriptionID { get; set; } + public string Description { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs new file mode 100644 index 000000000..633000193 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductDocument + { + public int ProductID { get; set; } + public int DocumentID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Document Document { get; set; } + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs new file mode 100644 index 000000000..57c0bdede --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductInventory + { + public int ProductID { get; set; } + public short LocationID { get; set; } + public string Shelf { get; set; } + public byte Bin { get; set; } + public short Quantity { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Location Location { get; set; } + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs new file mode 100644 index 000000000..5d011b63a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductListPriceHistory + { + public int ProductID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public decimal ListPrice { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs new file mode 100644 index 000000000..42bae6938 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs @@ -0,0 +1,35 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductModel + { + public ProductModel() + { + this.Products = new HashSet(); + this.ProductModelIllustrations = new HashSet(); + this.ProductModelProductDescriptionCultures = new HashSet(); + } + + public int ProductModelID { get; set; } + public string Name { get; set; } + public string CatalogDescription { get; set; } + public string Instructions { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection Products { get; set; } + public virtual ICollection ProductModelIllustrations { get; set; } + public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs new file mode 100644 index 000000000..dd029f17c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductModelIllustration + { + public int ProductModelID { get; set; } + public int IllustrationID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Illustration Illustration { get; set; } + public virtual ProductModel ProductModel { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs new file mode 100644 index 000000000..2297d3b84 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductModelProductDescriptionCulture + { + public int ProductModelID { get; set; } + public int ProductDescriptionID { get; set; } + public string CultureID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Culture Culture { get; set; } + public virtual ProductDescription ProductDescription { get; set; } + public virtual ProductModel ProductModel { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs new file mode 100644 index 000000000..ac1820864 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductPhoto + { + public ProductPhoto() + { + this.ProductProductPhotoes = new HashSet(); + } + + public int ProductPhotoID { get; set; } + public byte[] ThumbNailPhoto { get; set; } + public string ThumbnailPhotoFileName { get; set; } + public byte[] LargePhoto { get; set; } + public string LargePhotoFileName { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductProductPhotoes { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs new file mode 100644 index 000000000..3fa49df95 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductProductPhoto + { + public int ProductID { get; set; } + public int ProductPhotoID { get; set; } + public bool Primary { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual ProductPhoto ProductPhoto { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs new file mode 100644 index 000000000..86c5ea4e8 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductReview + { + public int ProductReviewID { get; set; } + public int ProductID { get; set; } + public string ReviewerName { get; set; } + public System.DateTime ReviewDate { get; set; } + public string EmailAddress { get; set; } + public int Rating { get; set; } + public string Comments { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs new file mode 100644 index 000000000..23ca32647 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductSubcategory + { + public ProductSubcategory() + { + this.Products = new HashSet(); + } + + public int ProductSubcategoryID { get; set; } + public int ProductCategoryID { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection Products { get; set; } + public virtual ProductCategory ProductCategory { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs new file mode 100644 index 000000000..424027eea --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ProductVendor + { + public int ProductID { get; set; } + public int VendorID { get; set; } + public int AverageLeadTime { get; set; } + public decimal StandardPrice { get; set; } + public Nullable LastReceiptCost { get; set; } + public Nullable LastReceiptDate { get; set; } + public int MinOrderQty { get; set; } + public int MaxOrderQty { get; set; } + public Nullable OnOrderQty { get; set; } + public string UnitMeasureCode { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual UnitMeasure UnitMeasure { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs new file mode 100644 index 000000000..60bf72467 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs @@ -0,0 +1,41 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class PurchaseOrder + { + public PurchaseOrder() + { + this.PurchaseOrderDetails = new HashSet(); + } + + public int PurchaseOrderID { get; set; } + public byte RevisionNumber { get; set; } + public byte Status { get; set; } + public int EmployeeID { get; set; } + public int VendorID { get; set; } + public int ShipMethodID { get; set; } + public System.DateTime OrderDate { get; set; } + public Nullable ShipDate { get; set; } + public decimal SubTotal { get; set; } + public decimal TaxAmt { get; set; } + public decimal Freight { get; set; } + public decimal TotalDue { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + public virtual ICollection PurchaseOrderDetails { get; set; } + public virtual ShipMethod ShipMethod { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs new file mode 100644 index 000000000..9e5573d6c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class PurchaseOrderDetail + { + public int PurchaseOrderID { get; set; } + public int PurchaseOrderDetailID { get; set; } + public System.DateTime DueDate { get; set; } + public short OrderQty { get; set; } + public int ProductID { get; set; } + public decimal UnitPrice { get; set; } + public decimal LineTotal { get; set; } + public decimal ReceivedQty { get; set; } + public decimal RejectedQty { get; set; } + public decimal StockedQty { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual PurchaseOrder PurchaseOrder { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs new file mode 100644 index 000000000..2036c38e3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesOrderDetail + { + public int SalesOrderID { get; set; } + public int SalesOrderDetailID { get; set; } + public string CarrierTrackingNumber { get; set; } + public short OrderQty { get; set; } + public int ProductID { get; set; } + public int SpecialOfferID { get; set; } + public decimal UnitPrice { get; set; } + public decimal UnitPriceDiscount { get; set; } + public decimal LineTotal { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesOrderHeader SalesOrderHeader { get; set; } + public virtual SpecialOfferProduct SpecialOfferProduct { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs new file mode 100644 index 000000000..21ca06fb2 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesOrderHeader + { + public SalesOrderHeader() + { + this.SalesOrderDetails = new HashSet(); + this.SalesOrderHeaderSalesReasons = new HashSet(); + } + + public int SalesOrderID { get; set; } + public byte RevisionNumber { get; set; } + public System.DateTime OrderDate { get; set; } + public System.DateTime DueDate { get; set; } + public Nullable ShipDate { get; set; } + public byte Status { get; set; } + public bool OnlineOrderFlag { get; set; } + public string SalesOrderNumber { get; set; } + public string PurchaseOrderNumber { get; set; } + public string AccountNumber { get; set; } + public int CustomerID { get; set; } + public int ContactID { get; set; } + public Nullable SalesPersonID { get; set; } + public Nullable TerritoryID { get; set; } + public int BillToAddressID { get; set; } + public int ShipToAddressID { get; set; } + public int ShipMethodID { get; set; } + public Nullable CreditCardID { get; set; } + public string CreditCardApprovalCode { get; set; } + public Nullable CurrencyRateID { get; set; } + public decimal SubTotal { get; set; } + public decimal TaxAmt { get; set; } + public decimal Freight { get; set; } + public decimal TotalDue { get; set; } + public string Comment { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Address Address { get; set; } + public virtual Address Address1 { get; set; } + public virtual Contact Contact { get; set; } + public virtual ShipMethod ShipMethod { get; set; } + public virtual CreditCard CreditCard { get; set; } + public virtual CurrencyRate CurrencyRate { get; set; } + public virtual Customer Customer { get; set; } + public virtual ICollection SalesOrderDetails { get; set; } + public virtual SalesPerson SalesPerson { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs new file mode 100644 index 000000000..1c2960fd5 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesOrderHeaderSalesReason + { + public int SalesOrderID { get; set; } + public int SalesReasonID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesOrderHeader SalesOrderHeader { get; set; } + public virtual SalesReason SalesReason { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs new file mode 100644 index 000000000..80a07073c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesPerson + { + public SalesPerson() + { + this.SalesOrderHeaders = new HashSet(); + this.SalesPersonQuotaHistories = new HashSet(); + this.SalesTerritoryHistories = new HashSet(); + this.Stores = new HashSet(); + } + + public int SalesPersonID { get; set; } + public Nullable TerritoryID { get; set; } + public Nullable SalesQuota { get; set; } + public decimal Bonus { get; set; } + public decimal CommissionPct { get; set; } + public decimal SalesYTD { get; set; } + public decimal SalesLastYear { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Employee Employee { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + public virtual ICollection SalesPersonQuotaHistories { get; set; } + public virtual ICollection SalesTerritoryHistories { get; set; } + public virtual ICollection Stores { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs new file mode 100644 index 000000000..9bd35d428 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesPersonQuotaHistory + { + public int SalesPersonID { get; set; } + public System.DateTime QuotaDate { get; set; } + public decimal SalesQuota { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesPerson SalesPerson { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs new file mode 100644 index 000000000..d3ca67609 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesReason + { + public SalesReason() + { + this.SalesOrderHeaderSalesReasons = new HashSet(); + } + + public int SalesReasonID { get; set; } + public string Name { get; set; } + public string ReasonType { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs new file mode 100644 index 000000000..afc578771 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesTaxRate + { + public int SalesTaxRateID { get; set; } + public int StateProvinceID { get; set; } + public byte TaxType { get; set; } + public decimal TaxRate { get; set; } + public string Name { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual StateProvince StateProvince { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs new file mode 100644 index 000000000..21684fec4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs @@ -0,0 +1,43 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesTerritory + { + public SalesTerritory() + { + this.StateProvinces = new HashSet(); + this.Customers = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + this.SalesPersons = new HashSet(); + this.SalesTerritoryHistories = new HashSet(); + } + + public int TerritoryID { get; set; } + public string Name { get; set; } + public string CountryRegionCode { get; set; } + public string Group { get; set; } + public decimal SalesYTD { get; set; } + public decimal SalesLastYear { get; set; } + public decimal CostYTD { get; set; } + public decimal CostLastYear { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection StateProvinces { get; set; } + public virtual ICollection Customers { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + public virtual ICollection SalesPersons { get; set; } + public virtual ICollection SalesTerritoryHistories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs new file mode 100644 index 000000000..96cf93d01 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SalesTerritoryHistory + { + public int SalesPersonID { get; set; } + public int TerritoryID { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual SalesPerson SalesPerson { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs new file mode 100644 index 000000000..345c17b71 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs @@ -0,0 +1,28 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ScrapReason + { + public ScrapReason() + { + this.WorkOrders = new HashSet(); + } + + public short ScrapReasonID { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection WorkOrders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs new file mode 100644 index 000000000..6076d85de --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Shift + { + public Shift() + { + this.EmployeeDepartmentHistories = new HashSet(); + } + + public byte ShiftID { get; set; } + public string Name { get; set; } + public System.DateTime StartTime { get; set; } + public System.DateTime EndTime { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection EmployeeDepartmentHistories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs new file mode 100644 index 000000000..3305cf588 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ShipMethod + { + public ShipMethod() + { + this.PurchaseOrderHeaders = new HashSet(); + this.SalesOrderHeaders = new HashSet(); + } + + public int ShipMethodID { get; set; } + public string Name { get; set; } + public decimal ShipBase { get; set; } + public decimal ShipRate { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection PurchaseOrderHeaders { get; set; } + public virtual ICollection SalesOrderHeaders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs new file mode 100644 index 000000000..e472c9608 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class ShoppingCartItem + { + public int ShoppingCartItemID { get; set; } + public string ShoppingCartID { get; set; } + public int Quantity { get; set; } + public int ProductID { get; set; } + public System.DateTime DateCreated { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs new file mode 100644 index 000000000..d3a1ac9c1 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SpecialOffer + { + public SpecialOffer() + { + this.SpecialOfferProducts = new HashSet(); + } + + public int SpecialOfferID { get; set; } + public string Description { get; set; } + public decimal DiscountPct { get; set; } + public string Type { get; set; } + public string Category { get; set; } + public System.DateTime StartDate { get; set; } + public System.DateTime EndDate { get; set; } + public int MinQty { get; set; } + public Nullable MaxQty { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection SpecialOfferProducts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs new file mode 100644 index 000000000..975ad1629 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class SpecialOfferProduct + { + public SpecialOfferProduct() + { + this.SalesOrderDetails = new HashSet(); + } + + public int SpecialOfferID { get; set; } + public int ProductID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual ICollection SalesOrderDetails { get; set; } + public virtual SpecialOffer SpecialOffer { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs new file mode 100644 index 000000000..4362309c6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class StateProvince + { + public StateProvince() + { + this.Addresses = new HashSet
(); + this.SalesTaxRates = new HashSet(); + } + + public int StateProvinceID { get; set; } + public string StateProvinceCode { get; set; } + public string CountryRegionCode { get; set; } + public bool IsOnlyStateProvinceFlag { get; set; } + public string Name { get; set; } + public int TerritoryID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection
Addresses { get; set; } + public virtual CountryRegion CountryRegion { get; set; } + public virtual ICollection SalesTaxRates { get; set; } + public virtual SalesTerritory SalesTerritory { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs new file mode 100644 index 000000000..4b5ae26de --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Store + { + public Store() + { + this.StoreContacts = new HashSet(); + } + + public int CustomerID { get; set; } + public string Name { get; set; } + public Nullable SalesPersonID { get; set; } + public string Demographics { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Customer Customer { get; set; } + public virtual SalesPerson SalesPerson { get; set; } + public virtual ICollection StoreContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs new file mode 100644 index 000000000..48ac4a0f4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class StoreContact + { + public int CustomerID { get; set; } + public int ContactID { get; set; } + public int ContactTypeID { get; set; } + public System.Guid rowguid { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual ContactType ContactType { get; set; } + public virtual Store Store { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs new file mode 100644 index 000000000..08ed8d258 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class TransactionHistory + { + public int TransactionID { get; set; } + public int ProductID { get; set; } + public int ReferenceOrderID { get; set; } + public int ReferenceOrderLineID { get; set; } + public System.DateTime TransactionDate { get; set; } + public string TransactionType { get; set; } + public int Quantity { get; set; } + public decimal ActualCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs new file mode 100644 index 000000000..66cff9519 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class TransactionHistoryArchive + { + public int TransactionID { get; set; } + public int ProductID { get; set; } + public int ReferenceOrderID { get; set; } + public int ReferenceOrderLineID { get; set; } + public System.DateTime TransactionDate { get; set; } + public string TransactionType { get; set; } + public int Quantity { get; set; } + public decimal ActualCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs new file mode 100644 index 000000000..1a58eb23b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class UnitMeasure + { + public UnitMeasure() + { + this.BillOfMaterials = new HashSet(); + this.Products = new HashSet(); + this.Products1 = new HashSet(); + this.ProductVendors = new HashSet(); + } + + public string UnitMeasureCode { get; set; } + public string Name { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection BillOfMaterials { get; set; } + public virtual ICollection Products { get; set; } + public virtual ICollection Products1 { get; set; } + public virtual ICollection ProductVendors { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs new file mode 100644 index 000000000..97e3c2914 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class Vendor + { + public Vendor() + { + this.ProductVendors = new HashSet(); + this.PurchaseOrderHeaders = new HashSet(); + this.VendorAddresses = new HashSet(); + this.VendorContacts = new HashSet(); + } + + public int VendorID { get; set; } + public string AccountNumber { get; set; } + public string Name { get; set; } + public byte CreditRating { get; set; } + public bool PreferredVendorStatus { get; set; } + public bool ActiveFlag { get; set; } + public string PurchasingWebServiceURL { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual ICollection ProductVendors { get; set; } + public virtual ICollection PurchaseOrderHeaders { get; set; } + public virtual ICollection VendorAddresses { get; set; } + public virtual ICollection VendorContacts { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs new file mode 100644 index 000000000..0389ec45a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class VendorAddress + { + public int VendorID { get; set; } + public int AddressID { get; set; } + public int AddressTypeID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Address Address { get; set; } + public virtual AddressType AddressType { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs new file mode 100644 index 000000000..95fd9b078 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class VendorContact + { + public int VendorID { get; set; } + public int ContactID { get; set; } + public int ContactTypeID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Contact Contact { get; set; } + public virtual ContactType ContactType { get; set; } + public virtual Vendor Vendor { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs new file mode 100644 index 000000000..3a6378d9e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs @@ -0,0 +1,37 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class WorkOrder + { + public WorkOrder() + { + this.WorkOrderRoutings = new HashSet(); + } + + public int WorkOrderID { get; set; } + public int ProductID { get; set; } + public int OrderQty { get; set; } + public int StockedQty { get; set; } + public short ScrappedQty { get; set; } + public System.DateTime StartDate { get; set; } + public Nullable EndDate { get; set; } + public System.DateTime DueDate { get; set; } + public Nullable ScrapReasonID { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Product Product { get; set; } + public virtual ScrapReason ScrapReason { get; set; } + public virtual ICollection WorkOrderRoutings { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs new file mode 100644 index 000000000..88cf5ed07 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class WorkOrderRouting + { + public int WorkOrderID { get; set; } + public int ProductID { get; set; } + public short OperationSequence { get; set; } + public short LocationID { get; set; } + public System.DateTime ScheduledStartDate { get; set; } + public System.DateTime ScheduledEndDate { get; set; } + public Nullable ActualStartDate { get; set; } + public Nullable ActualEndDate { get; set; } + public Nullable ActualResourceHrs { get; set; } + public decimal PlannedCost { get; set; } + public Nullable ActualCost { get; set; } + public System.DateTime ModifiedDate { get; set; } + + public virtual Location Location { get; set; } + public virtual WorkOrder WorkOrder { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs new file mode 100644 index 000000000..9dc580abd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorksEFCore +{ + using System; + using System.Collections.Generic; + + public partial class sysdiagram + { + public string name { get; set; } + public int principal_id { get; set; } + public int diagram_id { get; set; } + public Nullable version { get; set; } + public byte[] definition { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj index 0847f05f8..d0b60badf 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj @@ -18,6 +18,234 @@ + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + True + True + AdventureWorksDbCtx.Context.tt + + + True + True + AdventureWorksDbCtx.tt + + + True + True + AdventureWorksDbCtx.edmx + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + + + AdventureWorksDbCtx.tt + NorthwindEntities.tt @@ -75,6 +303,19 @@ + + EntityModelCodeGenerator + AdventureWorksDbCtx.Designer.cs + DbContextModels.AdventureWorks + + + TextTemplatingFileGenerator + AdventureWorksDbCtx.Context.cs + + + TextTemplatingFileGenerator + AdventureWorksDbCtx.cs + TextTemplatingFileGenerator NorthwindEntities.Context.cs From 13abc5c652f3e4f7e6752b99042181425361fe0f Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 1 Nov 2021 08:52:41 +0100 Subject: [PATCH 10/99] Builds --- ...Services.Server.EntityFrameworkCore.csproj | 10 + .../EFCoreDbContextModels.csproj | 1 + .../Test/DomainServiceDescriptionTest.cs | 40 +- .../Test/OpenRiaServices.Server.Test.csproj | 11 + src/RiaServices.sln | 9 +- src/Test/Desktop/EFCodePOCOModels/App.Config | 23 + .../EFCodePOCOModels/EFCodePOCOModels.csproj | 4 + .../EFCodePOCOModels/EFCorePOCOModels.csproj | 19 + .../Desktop/EFCodePOCOModels/Northwind.edmx | 158 + .../Desktop/EFCodePOCOModels/NorthwindPOCO.cs | 64 + .../Properties/AssemblyInfo.cs | 39 + .../DataModels/AdventureWorksEFCore.cs | 18836 ++++++++++++++++ .../DataModels/AdventureWorksEFCore.tt | 1298 ++ .../Northwind/EFCore_Northwind_POCO.cs | 115 + ...Services.Common.DomainServices.Test.csproj | 29 +- 15 files changed, 20646 insertions(+), 10 deletions(-) create mode 100644 src/Test/Desktop/EFCodePOCOModels/App.Config create mode 100644 src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj create mode 100644 src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj create mode 100644 src/Test/Desktop/EFCodePOCOModels/Northwind.edmx create mode 100644 src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs create mode 100644 src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 36d038fc2..2a52945f6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -2,6 +2,7 @@ net472 $(DefineConstants);SERVERFX;DBCONTEXT;net472; + True @@ -12,6 +13,15 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + True True diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj index d0b60badf..0e82d7346 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj @@ -327,6 +327,7 @@ + diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 9485954e0..316972532 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -361,11 +361,13 @@ public void EFCoreTypeDescriptor_ExcludedEntityMembers() PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(EFCorePocoEntity_IEntityChangeTracker))["EntityState"]; Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); - pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModel.Customer))["EntityState"]; - Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); + // TODO: Do we really need to check this for adveture works? If we nee to fix the model in some way + // https://docs.microsoft.com/en-us/ef/efcore-and-ef6/porting/port-edmx + //pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModelEFCore.Customer))["EntityState"]; + //Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); - pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModel.Customer))["SalesTerritoryReference"]; - Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); + //pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModelEFCore.Customer))["SalesTerritoryReference"]; + //Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); } /// @@ -394,6 +396,36 @@ public void DomainServiceDescription_EFPOCO() Assert.IsNotNull(assocAttrib); } + /// + /// Verify that our EF custom type descriptors work for POCO models + /// + [TestMethod] + public void DomainServiceDescription_EFCorePOCO() + { + // First create a context manually and verify that POCO metadata is configured correctly + NorthwindEFCorePOCOModel.NorthwindEntities ctxt = new NorthwindEFCorePOCOModel.NorthwindEntities(); + IEntityType entityType = ctxt.Model.FindEntityType(nameof(NorthwindEFCorePOCOModel.Product)); + Assert.IsNotNull(entityType); + + // + // TODO: Do we need to test this? ObjectContext is not used.. + // direct test verifying that our helper methods work for POCO metadata + // metadata do not work in EF Core use IEntityType fake = _context.Model.FindEntityType(basicModelType); + // See https://stackoverflow.com/questions/54122313/where-is-metadataworkspace-in-entity-framework-core + //entityType = (EntityType)ObjectContextUtilities.GetEdmType(ctxt., typeof(NorthwindPOCOModel.Product)); + //Assert.IsNotNull(entityType); + + // E2E DomainServiceDescription test, verifying that our custom TDs are registered + DomainServiceDescription desc = DomainServiceDescription.GetDescription(typeof(TestDomainServices.EFCore.EFCoreNorthwindPOCO)); + + PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(NorthwindEFCorePOCOModel.Product))["ProductID"]; + Assert.IsNotNull(pd.Attributes[typeof(KeyAttribute)]); + + pd = TypeDescriptor.GetProperties(typeof(NorthwindEFCorePOCOModel.Product))["Category"]; + AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(AssociationAttribute)]; + Assert.IsNotNull(assocAttrib); + } + /// /// Verify that after deriving from an EF type TypeDescriptor continues to work as expected. /// diff --git a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj index 5b0079993..1d4cc0d4c 100644 --- a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj +++ b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj @@ -4,8 +4,18 @@ $(DefineConstants);SERVERFX net472 + + True + + + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -31,6 +41,7 @@ + diff --git a/src/RiaServices.sln b/src/RiaServices.sln index dbdd62789..0f6c713e1 100644 --- a/src/RiaServices.sln +++ b/src/RiaServices.sln @@ -142,10 +142,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Client.Doma EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Server.EntityFrameworkCore", "OpenRiaServices.Server.EntityFrameworkCore\Framework\OpenRiaServices.Server.EntityFrameworkCore.csproj", "{B8D39090-3B76-41BB-A139-956E42619E91}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreCodeFirstModels", "OpenRiaServices.Server.EntityFrameworkCore\Test\CodeFirstModel\EFCoreCodeFirstModels.csproj", "{D18943F4-49C8-49E5-A658-1FD4E59C7E0D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreCodeFirstModels_dont_care", "OpenRiaServices.Server.EntityFrameworkCore\Test\CodeFirstModel\EFCoreCodeFirstModels_dont_care.csproj", "{D18943F4-49C8-49E5-A658-1FD4E59C7E0D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreDbContextModels", "OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\EFCoreDbContextModels.csproj", "{6F468ADB-5799-4C24-93C5-765120AAAA4E}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCorePOCOModels", "Test\Desktop\EFCodePOCOModels\EFCorePOCOModels.csproj", "{28B11752-D00D-4BD9-B496-A54371F5C6D9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -356,6 +358,10 @@ Global {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Release|Any CPU.Build.0 = Release|Any CPU + {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -424,6 +430,7 @@ Global {B8D39090-3B76-41BB-A139-956E42619E91} = {2095B11C-903C-47FF-B812-82DFA7A068AC} {D18943F4-49C8-49E5-A658-1FD4E59C7E0D} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} {6F468ADB-5799-4C24-93C5-765120AAAA4E} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} + {28B11752-D00D-4BD9-B496-A54371F5C6D9} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C135CEC9-180C-4B67-92AC-3342375AE14C} diff --git a/src/Test/Desktop/EFCodePOCOModels/App.Config b/src/Test/Desktop/EFCodePOCOModels/App.Config new file mode 100644 index 000000000..ee18356c5 --- /dev/null +++ b/src/Test/Desktop/EFCodePOCOModels/App.Config @@ -0,0 +1,23 @@ + + + + +
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj b/src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj new file mode 100644 index 000000000..88a550947 --- /dev/null +++ b/src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj b/src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj new file mode 100644 index 000000000..6e9a7e177 --- /dev/null +++ b/src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj @@ -0,0 +1,19 @@ + + + false + net472 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/Northwind.edmx b/src/Test/Desktop/EFCodePOCOModels/Northwind.edmx new file mode 100644 index 000000000..b199645d9 --- /dev/null +++ b/src/Test/Desktop/EFCodePOCOModels/Northwind.edmx @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs b/src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs new file mode 100644 index 000000000..dd34f723e --- /dev/null +++ b/src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.SqlServer; +using System.Runtime.Serialization; +using System; + +// These assembly attributes allow us to serialize different CLR types into the same contract +[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", + ClrNamespace = "NorthwindEFCorePOCOModel")] +namespace NorthwindEFCorePOCOModel +{ + /// + /// Hand crafted POCO ObjectContext. These entity types are matched to the edmx metadata + /// by convention - the names and members must match up. + /// + public class NorthwindEntities : DbContext + { + public const string ConnectionStringName = "NorthwindEFCorePOCOEntities"; + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseSqlServer(ConnectionStringName); + base.OnConfiguring(optionsBuilder); + } + + public List Products { get; set; } = new List(); + } + + public class Category + { + private List _products = new List(); + + public int CategoryID { get; set; } + public string CategoryName { get; set; } + public string Description { get; set; } + public byte[] Picture { get; set; } + public List Products + { + get + { + return this._products; + } + set + { + this._products = value; + } + } + } + + public class Product + { + public int ProductID { get; set; } + public string ProductName { get; set; } + public Nullable SupplierID { get; set; } + public string QuantityPerUnit { get; set; } + public Nullable UnitPrice { get; set; } + public Nullable UnitsInStock { get; set; } + public Nullable UnitsOnOrder { get; set; } + public Nullable ReorderLevel { get; set; } + public bool Discontinued { get; set; } + public Nullable CategoryID { get; set; } + public Category Category { get; set; } + } +} diff --git a/src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs b/src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..122fc1101 --- /dev/null +++ b/src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("EFPOCOModels")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Outercurve Foundation")] +[assembly: AssemblyProduct("EFPOCOModels")] +[assembly: AssemblyCopyright("© Outercurve Foundation. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("054e4462-88a4-4eba-8266-45e6fd9686a2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +// TODO: review -- v4.0 security model assumes transparent, making unit tests fail to build if this is set +// [assembly: AllowPartiallyTrustedCallers] \ No newline at end of file diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs new file mode 100644 index 000000000..584755c92 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs @@ -0,0 +1,18836 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +using System; +using System.ComponentModel; +using Microsoft.EntityFrameworkCore; +using System.Linq; +using System.Runtime.Serialization; +using System.Xml.Serialization; + +namespace AdventureWorksModelEFCore +{ + #region Contexts + + /// + /// No Metadata Documentation available. + /// + public partial class AdventureWorksEntities + { + #region Constructors + + /// + /// Initializes a new AdventureWorksEntities object using the connection string found in the 'AdventureWorksEntities' section of the application configuration file. + /// + public AdventureWorksEntities() + { + OnContextCreated(); + } + + /// + /// Initialize a new AdventureWorksEntities object. + /// + public AdventureWorksEntities(string connectionString) + { + OnContextCreated(); + } + + #endregion + + #region Partial Methods + + partial void OnContextCreated(); + + #endregion + } + + #endregion + + #region Entities + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Address + { + #region Factory Method + + /// + /// Create a new Address object. + /// + /// Initial value of the AddressID property. + /// Initial value of the AddressLine1 property. + /// Initial value of the City property. + /// Initial value of the StateProvinceID property. + /// Initial value of the PostalCode property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static Address CreateAddress(global::System.Int32 addressID, global::System.String addressLine1, global::System.String city, global::System.Int32 stateProvinceID, global::System.String postalCode, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + Address address = new Address(); + address.AddressID = addressID; + address.AddressLine1 = addressLine1; + address.City = city; + address.StateProvinceID = stateProvinceID; + address.PostalCode = postalCode; + address.rowguid = rowguid; + address.ModifiedDate = modifiedDate; + return address; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AddressID + { + get + { + return _AddressID; + } + set + { + if (_AddressID != value) + { + OnAddressIDChanging(value); + _AddressID = value; + OnAddressIDChanged(); + } + } + } + private global::System.Int32 _AddressID; + partial void OnAddressIDChanging(global::System.Int32 value); + partial void OnAddressIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String AddressLine1 + { + get + { + return _AddressLine1; + } + set + { + OnAddressLine1Changing(value); + OnAddressLine1Changed(); + } + } + private global::System.String _AddressLine1; + partial void OnAddressLine1Changing(global::System.String value); + partial void OnAddressLine1Changed(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String AddressLine2 + { + get + { + return _AddressLine2; + } + set + { + OnAddressLine2Changing(value); + _AddressLine2 = value; + OnAddressLine2Changed(); + } + } + private global::System.String _AddressLine2; + partial void OnAddressLine2Changing(global::System.String value); + partial void OnAddressLine2Changed(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String City + { + get + { + return _City; + } + set + { + OnCityChanging(value); + _City = value; + OnCityChanged(); + } + } + private global::System.String _City; + partial void OnCityChanging(global::System.String value); + partial void OnCityChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 StateProvinceID + { + get + { + return _StateProvinceID; + } + set + { + OnStateProvinceIDChanging(value); + _StateProvinceID = value; + OnStateProvinceIDChanged(); + } + } + private global::System.Int32 _StateProvinceID; + partial void OnStateProvinceIDChanging(global::System.Int32 value); + partial void OnStateProvinceIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String PostalCode + { + get + { + return _PostalCode; + } + set + { + OnPostalCodeChanging(value); + _PostalCode = value; + OnPostalCodeChanged(); + } + } + private global::System.String _PostalCode; + partial void OnPostalCodeChanging(global::System.String value); + partial void OnPostalCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection EmployeeAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "EmployeeAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "EmployeeAddress", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public StateProvince StateProvince + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference StateProvinceReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection CustomerAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "CustomerAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "CustomerAddress", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public IEntityCollection VendorAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "VendorAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "VendorAddress", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class AddressType + { + #region Factory Method + + /// + /// Create a new AddressType object. + /// + /// Initial value of the AddressTypeID property. + /// Initial value of the Name property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static AddressType CreateAddressType(global::System.Int32 addressTypeID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + AddressType addressType = new AddressType(); + addressType.AddressTypeID = addressTypeID; + addressType.Name = name; + addressType.rowguid = rowguid; + addressType.ModifiedDate = modifiedDate; + return addressType; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AddressTypeID + { + get + { + return _AddressTypeID; + } + set + { + if (_AddressTypeID != value) + { + OnAddressTypeIDChanging(value); + _AddressTypeID = value; + OnAddressTypeIDChanged(); + } + } + } + private global::System.Int32 _AddressTypeID; + partial void OnAddressTypeIDChanging(global::System.Int32 value); + partial void OnAddressTypeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection CustomerAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "CustomerAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "CustomerAddress", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection VendorAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "VendorAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "VendorAddress", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class AWBuildVersion + { + #region Factory Method + + /// + /// Create a new AWBuildVersion object. + /// + /// Initial value of the SystemInformationID property. + /// Initial value of the Database_Version property. + /// Initial value of the VersionDate property. + /// Initial value of the ModifiedDate property. + public static AWBuildVersion CreateAWBuildVersion(global::System.Byte systemInformationID, global::System.String database_Version, global::System.DateTime versionDate, global::System.DateTime modifiedDate) + { + AWBuildVersion aWBuildVersion = new AWBuildVersion(); + aWBuildVersion.SystemInformationID = systemInformationID; + aWBuildVersion.Database_Version = database_Version; + aWBuildVersion.VersionDate = versionDate; + aWBuildVersion.ModifiedDate = modifiedDate; + return aWBuildVersion; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte SystemInformationID + { + get + { + return _SystemInformationID; + } + set + { + if (_SystemInformationID != value) + { + OnSystemInformationIDChanging(value); + _SystemInformationID = value; + OnSystemInformationIDChanged(); + } + } + } + private global::System.Byte _SystemInformationID; + partial void OnSystemInformationIDChanging(global::System.Byte value); + partial void OnSystemInformationIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Database_Version + { + get + { + return _Database_Version; + } + set + { + OnDatabase_VersionChanging(value); + _Database_Version = value; + OnDatabase_VersionChanged(); + } + } + private global::System.String _Database_Version; + partial void OnDatabase_VersionChanging(global::System.String value); + partial void OnDatabase_VersionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime VersionDate + { + get + { + return _VersionDate; + } + set + { + OnVersionDateChanging(value); + _VersionDate = value; + OnVersionDateChanged(); + } + } + private global::System.DateTime _VersionDate; + partial void OnVersionDateChanging(global::System.DateTime value); + partial void OnVersionDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class BillOfMaterial + { + #region Factory Method + + /// + /// Create a new BillOfMaterial object. + /// + /// Initial value of the BillOfMaterialsID property. + /// Initial value of the ComponentID property. + /// Initial value of the StartDate property. + /// Initial value of the UnitMeasureCode property. + /// Initial value of the BOMLevel property. + /// Initial value of the PerAssemblyQty property. + /// Initial value of the ModifiedDate property. + public static BillOfMaterial CreateBillOfMaterial(global::System.Int32 billOfMaterialsID, global::System.Int32 componentID, global::System.DateTime startDate, global::System.String unitMeasureCode, global::System.Int16 bOMLevel, global::System.Decimal perAssemblyQty, global::System.DateTime modifiedDate) + { + BillOfMaterial billOfMaterial = new BillOfMaterial(); + billOfMaterial.BillOfMaterialsID = billOfMaterialsID; + billOfMaterial.ComponentID = componentID; + billOfMaterial.StartDate = startDate; + billOfMaterial.UnitMeasureCode = unitMeasureCode; + billOfMaterial.BOMLevel = bOMLevel; + billOfMaterial.PerAssemblyQty = perAssemblyQty; + billOfMaterial.ModifiedDate = modifiedDate; + return billOfMaterial; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 BillOfMaterialsID + { + get + { + return _BillOfMaterialsID; + } + set + { + if (_BillOfMaterialsID != value) + { + OnBillOfMaterialsIDChanging(value); + _BillOfMaterialsID = value; + OnBillOfMaterialsIDChanged(); + } + } + } + private global::System.Int32 _BillOfMaterialsID; + partial void OnBillOfMaterialsIDChanging(global::System.Int32 value); + partial void OnBillOfMaterialsIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ProductAssemblyID + { + get + { + return _ProductAssemblyID; + } + set + { + OnProductAssemblyIDChanging(value); + _ProductAssemblyID = value; + OnProductAssemblyIDChanged(); + } + } + private Nullable _ProductAssemblyID; + partial void OnProductAssemblyIDChanging(Nullable value); + partial void OnProductAssemblyIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ComponentID + { + get + { + return _ComponentID; + } + set + { + OnComponentIDChanging(value); + _ComponentID = value; + OnComponentIDChanged(); + } + } + private global::System.Int32 _ComponentID; + partial void OnComponentIDChanging(global::System.Int32 value); + partial void OnComponentIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartDate + { + get + { + return _StartDate; + } + set + { + OnStartDateChanging(value); + _StartDate = value; + OnStartDateChanged(); + } + } + private global::System.DateTime _StartDate; + partial void OnStartDateChanging(global::System.DateTime value); + partial void OnStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable EndDate + { + get + { + return _EndDate; + } + set + { + OnEndDateChanging(value); + _EndDate = value; + OnEndDateChanged(); + } + } + private Nullable _EndDate; + partial void OnEndDateChanging(Nullable value); + partial void OnEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String UnitMeasureCode + { + get + { + return _UnitMeasureCode; + } + set + { + OnUnitMeasureCodeChanging(value); + _UnitMeasureCode = value; + OnUnitMeasureCodeChanged(); + } + } + private global::System.String _UnitMeasureCode; + partial void OnUnitMeasureCodeChanging(global::System.String value); + partial void OnUnitMeasureCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 BOMLevel + { + get + { + return _BOMLevel; + } + set + { + OnBOMLevelChanging(value); + _BOMLevel = value; + OnBOMLevelChanged(); + } + } + private global::System.Int16 _BOMLevel; + partial void OnBOMLevelChanging(global::System.Int16 value); + partial void OnBOMLevelChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal PerAssemblyQty + { + get + { + return _PerAssemblyQty; + } + set + { + OnPerAssemblyQtyChanging(value); + _PerAssemblyQty = value; + OnPerAssemblyQtyChanged(); + } + } + private global::System.Decimal _PerAssemblyQty; + partial void OnPerAssemblyQtyChanging(global::System.Decimal value); + partial void OnPerAssemblyQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference Product1Reference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public UnitMeasure UnitMeasure + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference UnitMeasureReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Contact + { + #region Factory Method + + /// + /// Create a new Contact object. + /// + /// Initial value of the ContactID property. + /// Initial value of the NameStyle property. + /// Initial value of the FirstName property. + /// Initial value of the LastName property. + /// Initial value of the EmailPromotion property. + /// Initial value of the PasswordHash property. + /// Initial value of the PasswordSalt property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static Contact CreateContact(global::System.Int32 contactID, global::System.Boolean nameStyle, global::System.String firstName, global::System.String lastName, global::System.Int32 emailPromotion, global::System.String passwordHash, global::System.String passwordSalt, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + Contact contact = new Contact(); + contact.ContactID = contactID; + contact.NameStyle = nameStyle; + contact.FirstName = firstName; + contact.LastName = lastName; + contact.EmailPromotion = emailPromotion; + contact.PasswordHash = passwordHash; + contact.PasswordSalt = passwordSalt; + contact.rowguid = rowguid; + contact.ModifiedDate = modifiedDate; + return contact; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactID + { + get + { + return _ContactID; + } + set + { + if (_ContactID != value) + { + OnContactIDChanging(value); + _ContactID = value; + OnContactIDChanged(); + } + } + } + private global::System.Int32 _ContactID; + partial void OnContactIDChanging(global::System.Int32 value); + partial void OnContactIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean NameStyle + { + get + { + return _NameStyle; + } + set + { + OnNameStyleChanging(value); + _NameStyle = value; + OnNameStyleChanged(); + } + } + private global::System.Boolean _NameStyle; + partial void OnNameStyleChanging(global::System.Boolean value); + partial void OnNameStyleChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Title + { + get + { + return _Title; + } + set + { + OnTitleChanging(value); + _Title = value; + OnTitleChanged(); + } + } + private global::System.String _Title; + partial void OnTitleChanging(global::System.String value); + partial void OnTitleChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String FirstName + { + get + { + return _FirstName; + } + set + { + OnFirstNameChanging(value); + _FirstName = value; + OnFirstNameChanged(); + } + } + private global::System.String _FirstName; + partial void OnFirstNameChanging(global::System.String value); + partial void OnFirstNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String MiddleName + { + get + { + return _MiddleName; + } + set + { + OnMiddleNameChanging(value); + _MiddleName = value; + OnMiddleNameChanged(); + } + } + private global::System.String _MiddleName; + partial void OnMiddleNameChanging(global::System.String value); + partial void OnMiddleNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String LastName + { + get + { + return _LastName; + } + set + { + OnLastNameChanging(value); + _LastName = value; + OnLastNameChanged(); + } + } + private global::System.String _LastName; + partial void OnLastNameChanging(global::System.String value); + partial void OnLastNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Suffix + { + get + { + return _Suffix; + } + set + { + OnSuffixChanging(value); + _Suffix = value; + OnSuffixChanged(); + } + } + private global::System.String _Suffix; + partial void OnSuffixChanging(global::System.String value); + partial void OnSuffixChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String EmailAddress + { + get + { + return _EmailAddress; + } + set + { + OnEmailAddressChanging(value); + _EmailAddress = value; + OnEmailAddressChanged(); + } + } + private global::System.String _EmailAddress; + partial void OnEmailAddressChanging(global::System.String value); + partial void OnEmailAddressChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 EmailPromotion + { + get + { + return _EmailPromotion; + } + set + { + OnEmailPromotionChanging(value); + _EmailPromotion = value; + OnEmailPromotionChanged(); + } + } + private global::System.Int32 _EmailPromotion; + partial void OnEmailPromotionChanging(global::System.Int32 value); + partial void OnEmailPromotionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Phone + { + get + { + return _Phone; + } + set + { + OnPhoneChanging(value); + _Phone = value; + OnPhoneChanged(); + } + } + private global::System.String _Phone; + partial void OnPhoneChanging(global::System.String value); + partial void OnPhoneChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String PasswordHash + { + get + { + return _PasswordHash; + } + set + { + OnPasswordHashChanging(value); + _PasswordHash = value; + OnPasswordHashChanged(); + } + } + private global::System.String _PasswordHash; + partial void OnPasswordHashChanging(global::System.String value); + partial void OnPasswordHashChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String PasswordSalt + { + get + { + return _PasswordSalt; + } + set + { + OnPasswordSaltChanging(value); + _PasswordSalt = value; + OnPasswordSaltChanged(); + } + } + private global::System.String _PasswordSalt; + partial void OnPasswordSaltChanging(global::System.String value); + partial void OnPasswordSaltChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String AdditionalContactInfo + { + get + { + return _AdditionalContactInfo; + } + set + { + OnAdditionalContactInfoChanging(value); + _AdditionalContactInfo = value; + OnAdditionalContactInfoChanged(); + } + } + private global::System.String _AdditionalContactInfo; + partial void OnAdditionalContactInfoChanging(global::System.String value); + partial void OnAdditionalContactInfoChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Employees + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Employee_Contact_ContactID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Employee_Contact_ContactID", "Employee", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ContactCreditCards + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "ContactCreditCard"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "ContactCreditCard", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Individuals + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Individual_Contact_ContactID", "Individual"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Individual_Contact_ContactID", "Individual", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection StoreContacts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "StoreContact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "StoreContact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection VendorContacts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "VendorContact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "VendorContact", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ContactCreditCard + { + #region Factory Method + + /// + /// Create a new ContactCreditCard object. + /// + /// Initial value of the ContactID property. + /// Initial value of the CreditCardID property. + /// Initial value of the ModifiedDate property. + public static ContactCreditCard CreateContactCreditCard(global::System.Int32 contactID, global::System.Int32 creditCardID, global::System.DateTime modifiedDate) + { + ContactCreditCard contactCreditCard = new ContactCreditCard(); + contactCreditCard.ContactID = contactID; + contactCreditCard.CreditCardID = creditCardID; + contactCreditCard.ModifiedDate = modifiedDate; + return contactCreditCard; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactID + { + get + { + return _ContactID; + } + set + { + if (_ContactID != value) + { + OnContactIDChanging(value); + _ContactID = value; + OnContactIDChanged(); + } + } + } + private global::System.Int32 _ContactID; + partial void OnContactIDChanging(global::System.Int32 value); + partial void OnContactIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CreditCardID + { + get + { + return _CreditCardID; + } + set + { + if (_CreditCardID != value) + { + OnCreditCardIDChanging(value); + _CreditCardID = value; + OnCreditCardIDChanged(); + } + } + } + private global::System.Int32 _CreditCardID; + partial void OnCreditCardIDChanging(global::System.Int32 value); + partial void OnCreditCardIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Contact Contact + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public CreditCard CreditCard + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CreditCardReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ContactType + { + #region Factory Method + + /// + /// Create a new ContactType object. + /// + /// Initial value of the ContactTypeID property. + /// Initial value of the Name property. + /// Initial value of the ModifiedDate property. + public static ContactType CreateContactType(global::System.Int32 contactTypeID, global::System.String name, global::System.DateTime modifiedDate) + { + ContactType contactType = new ContactType(); + contactType.ContactTypeID = contactTypeID; + contactType.Name = name; + contactType.ModifiedDate = modifiedDate; + return contactType; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactTypeID + { + get + { + return _ContactTypeID; + } + set + { + if (_ContactTypeID != value) + { + OnContactTypeIDChanging(value); + _ContactTypeID = value; + OnContactTypeIDChanged(); + } + } + } + private global::System.Int32 _ContactTypeID; + partial void OnContactTypeIDChanging(global::System.Int32 value); + partial void OnContactTypeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection StoreContacts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "StoreContact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "StoreContact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection VendorContacts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "VendorContact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "VendorContact", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class CountryRegion + { + #region Factory Method + + /// + /// Create a new CountryRegion object. + /// + /// Initial value of the CountryRegionCode property. + /// Initial value of the Name property. + /// Initial value of the ModifiedDate property. + public static CountryRegion CreateCountryRegion(global::System.String countryRegionCode, global::System.String name, global::System.DateTime modifiedDate) + { + CountryRegion countryRegion = new CountryRegion(); + countryRegion.CountryRegionCode = countryRegionCode; + countryRegion.Name = name; + countryRegion.ModifiedDate = modifiedDate; + return countryRegion; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CountryRegionCode + { + get + { + return _CountryRegionCode; + } + set + { + if (_CountryRegionCode != value) + { + OnCountryRegionCodeChanging(value); + _CountryRegionCode = value; + OnCountryRegionCodeChanged(); + } + } + } + private global::System.String _CountryRegionCode; + partial void OnCountryRegionCodeChanging(global::System.String value); + partial void OnCountryRegionCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection CountryRegionCurrencies + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegionCurrency"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegionCurrency", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection StateProvinces + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "StateProvince"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "StateProvince", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class CountryRegionCurrency + { + #region Factory Method + + /// + /// Create a new CountryRegionCurrency object. + /// + /// Initial value of the CountryRegionCode property. + /// Initial value of the CurrencyCode property. + /// Initial value of the ModifiedDate property. + public static CountryRegionCurrency CreateCountryRegionCurrency(global::System.String countryRegionCode, global::System.String currencyCode, global::System.DateTime modifiedDate) + { + CountryRegionCurrency countryRegionCurrency = new CountryRegionCurrency(); + countryRegionCurrency.CountryRegionCode = countryRegionCode; + countryRegionCurrency.CurrencyCode = currencyCode; + countryRegionCurrency.ModifiedDate = modifiedDate; + return countryRegionCurrency; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CountryRegionCode + { + get + { + return _CountryRegionCode; + } + set + { + if (_CountryRegionCode != value) + { + OnCountryRegionCodeChanging(value); + _CountryRegionCode = value; + OnCountryRegionCodeChanged(); + } + } + } + private global::System.String _CountryRegionCode; + partial void OnCountryRegionCodeChanging(global::System.String value); + partial void OnCountryRegionCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CurrencyCode + { + get + { + return _CurrencyCode; + } + set + { + if (_CurrencyCode != value) + { + OnCurrencyCodeChanging(value); + _CurrencyCode = value; + OnCurrencyCodeChanged(); + } + } + } + private global::System.String _CurrencyCode; + partial void OnCurrencyCodeChanging(global::System.String value); + partial void OnCurrencyCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public CountryRegion CountryRegion + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CountryRegionReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Currency Currency + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CurrencyReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class CreditCard + { + #region Factory Method + + /// + /// Create a new CreditCard object. + /// + /// Initial value of the CreditCardID property. + /// Initial value of the CardType property. + /// Initial value of the CardNumber property. + /// Initial value of the ExpMonth property. + /// Initial value of the ExpYear property. + /// Initial value of the ModifiedDate property. + public static CreditCard CreateCreditCard(global::System.Int32 creditCardID, global::System.String cardType, global::System.String cardNumber, global::System.Byte expMonth, global::System.Int16 expYear, global::System.DateTime modifiedDate) + { + CreditCard creditCard = new CreditCard(); + creditCard.CreditCardID = creditCardID; + creditCard.CardType = cardType; + creditCard.CardNumber = cardNumber; + creditCard.ExpMonth = expMonth; + creditCard.ExpYear = expYear; + creditCard.ModifiedDate = modifiedDate; + return creditCard; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CreditCardID + { + get + { + return _CreditCardID; + } + set + { + if (_CreditCardID != value) + { + OnCreditCardIDChanging(value); + _CreditCardID = value; + OnCreditCardIDChanged(); + } + } + } + private global::System.Int32 _CreditCardID; + partial void OnCreditCardIDChanging(global::System.Int32 value); + partial void OnCreditCardIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CardType + { + get + { + return _CardType; + } + set + { + OnCardTypeChanging(value); + _CardType = value; + OnCardTypeChanged(); + } + } + private global::System.String _CardType; + partial void OnCardTypeChanging(global::System.String value); + partial void OnCardTypeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CardNumber + { + get + { + return _CardNumber; + } + set + { + OnCardNumberChanging(value); + _CardNumber = value; + OnCardNumberChanged(); + } + } + private global::System.String _CardNumber; + partial void OnCardNumberChanging(global::System.String value); + partial void OnCardNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte ExpMonth + { + get + { + return _ExpMonth; + } + set + { + OnExpMonthChanging(value); + _ExpMonth = value; + OnExpMonthChanged(); + } + } + private global::System.Byte _ExpMonth; + partial void OnExpMonthChanging(global::System.Byte value); + partial void OnExpMonthChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 ExpYear + { + get + { + return _ExpYear; + } + set + { + OnExpYearChanging(value); + _ExpYear = value; + OnExpYearChanged(); + } + } + private global::System.Int16 _ExpYear; + partial void OnExpYearChanging(global::System.Int16 value); + partial void OnExpYearChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ContactCreditCards + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "ContactCreditCard"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "ContactCreditCard", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "SalesOrderHeader", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Culture + { + #region Factory Method + + /// + /// Create a new Culture object. + /// + /// Initial value of the CultureID property. + /// Initial value of the Name property. + /// Initial value of the ModifiedDate property. + public static Culture CreateCulture(global::System.String cultureID, global::System.String name, global::System.DateTime modifiedDate) + { + Culture culture = new Culture(); + culture.CultureID = cultureID; + culture.Name = name; + culture.ModifiedDate = modifiedDate; + return culture; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CultureID + { + get + { + return _CultureID; + } + set + { + if (_CultureID != value) + { + OnCultureIDChanging(value); + _CultureID = value; + OnCultureIDChanged(); + } + } + } + private global::System.String _CultureID; + partial void OnCultureIDChanging(global::System.String value); + partial void OnCultureIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductModelProductDescriptionCultures + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "ProductModelProductDescriptionCulture"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "ProductModelProductDescriptionCulture", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Currency + { + #region Factory Method + + /// + /// Create a new Currency object. + /// + /// Initial value of the CurrencyCode property. + /// Initial value of the Name property. + /// Initial value of the ModifiedDate property. + public static Currency CreateCurrency(global::System.String currencyCode, global::System.String name, global::System.DateTime modifiedDate) + { + Currency currency = new Currency(); + currency.CurrencyCode = currencyCode; + currency.Name = name; + currency.ModifiedDate = modifiedDate; + return currency; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CurrencyCode + { + get + { + return _CurrencyCode; + } + set + { + if (_CurrencyCode != value) + { + OnCurrencyCodeChanging(value); + _CurrencyCode = value; + OnCurrencyCodeChanged(); + } + } + } + private global::System.String _CurrencyCode; + partial void OnCurrencyCodeChanging(global::System.String value); + partial void OnCurrencyCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection CountryRegionCurrencies + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "CountryRegionCurrency"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "CountryRegionCurrency", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection CurrencyRates + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "CurrencyRate"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "CurrencyRate", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection CurrencyRates1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "CurrencyRate"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "CurrencyRate", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class CurrencyRate + { + #region Factory Method + + /// + /// Create a new CurrencyRate object. + /// + /// Initial value of the CurrencyRateID property. + /// Initial value of the CurrencyRateDate property. + /// Initial value of the FromCurrencyCode property. + /// Initial value of the ToCurrencyCode property. + /// Initial value of the AverageRate property. + /// Initial value of the EndOfDayRate property. + /// Initial value of the ModifiedDate property. + public static CurrencyRate CreateCurrencyRate(global::System.Int32 currencyRateID, global::System.DateTime currencyRateDate, global::System.String fromCurrencyCode, global::System.String toCurrencyCode, global::System.Decimal averageRate, global::System.Decimal endOfDayRate, global::System.DateTime modifiedDate) + { + CurrencyRate currencyRate = new CurrencyRate(); + currencyRate.CurrencyRateID = currencyRateID; + currencyRate.CurrencyRateDate = currencyRateDate; + currencyRate.FromCurrencyCode = fromCurrencyCode; + currencyRate.ToCurrencyCode = toCurrencyCode; + currencyRate.AverageRate = averageRate; + currencyRate.EndOfDayRate = endOfDayRate; + currencyRate.ModifiedDate = modifiedDate; + return currencyRate; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CurrencyRateID + { + get + { + return _CurrencyRateID; + } + set + { + if (_CurrencyRateID != value) + { + OnCurrencyRateIDChanging(value); + _CurrencyRateID = value; + OnCurrencyRateIDChanged(); + } + } + } + private global::System.Int32 _CurrencyRateID; + partial void OnCurrencyRateIDChanging(global::System.Int32 value); + partial void OnCurrencyRateIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime CurrencyRateDate + { + get + { + return _CurrencyRateDate; + } + set + { + OnCurrencyRateDateChanging(value); + _CurrencyRateDate = value; + OnCurrencyRateDateChanged(); + } + } + private global::System.DateTime _CurrencyRateDate; + partial void OnCurrencyRateDateChanging(global::System.DateTime value); + partial void OnCurrencyRateDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String FromCurrencyCode + { + get + { + return _FromCurrencyCode; + } + set + { + OnFromCurrencyCodeChanging(value); + _FromCurrencyCode = value; + OnFromCurrencyCodeChanged(); + } + } + private global::System.String _FromCurrencyCode; + partial void OnFromCurrencyCodeChanging(global::System.String value); + partial void OnFromCurrencyCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ToCurrencyCode + { + get + { + return _ToCurrencyCode; + } + set + { + OnToCurrencyCodeChanging(value); + _ToCurrencyCode = value; + OnToCurrencyCodeChanged(); + } + } + private global::System.String _ToCurrencyCode; + partial void OnToCurrencyCodeChanging(global::System.String value); + partial void OnToCurrencyCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal AverageRate + { + get + { + return _AverageRate; + } + set + { + OnAverageRateChanging(value); + _AverageRate = value; + OnAverageRateChanged(); + } + } + private global::System.Decimal _AverageRate; + partial void OnAverageRateChanging(global::System.Decimal value); + partial void OnAverageRateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal EndOfDayRate + { + get + { + return _EndOfDayRate; + } + set + { + OnEndOfDayRateChanging(value); + _EndOfDayRate = value; + OnEndOfDayRateChanged(); + } + } + private global::System.Decimal _EndOfDayRate; + partial void OnEndOfDayRateChanging(global::System.Decimal value); + partial void OnEndOfDayRateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Currency Currency + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CurrencyReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Currency Currency1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference Currency1Reference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "SalesOrderHeader", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Customer + { + #region Factory Method + + /// + /// Create a new Customer object. + /// + /// Initial value of the CustomerID property. + /// Initial value of the AccountNumber property. + /// Initial value of the CustomerType property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static Customer CreateCustomer(global::System.Int32 customerID, global::System.String accountNumber, global::System.String customerType, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + Customer customer = new Customer(); + customer.CustomerID = customerID; + customer.AccountNumber = accountNumber; + customer.CustomerType = customerType; + customer.rowguid = rowguid; + customer.ModifiedDate = modifiedDate; + return customer; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CustomerID + { + get + { + return _CustomerID; + } + set + { + if (_CustomerID != value) + { + OnCustomerIDChanging(value); + _CustomerID = value; + OnCustomerIDChanged(); + } + } + } + private global::System.Int32 _CustomerID; + partial void OnCustomerIDChanging(global::System.Int32 value); + partial void OnCustomerIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable TerritoryID + { + get + { + return _TerritoryID; + } + set + { + OnTerritoryIDChanging(value); + _TerritoryID = value; + OnTerritoryIDChanged(); + } + } + private Nullable _TerritoryID; + partial void OnTerritoryIDChanging(Nullable value); + partial void OnTerritoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String AccountNumber + { + get + { + return _AccountNumber; + } + set + { + OnAccountNumberChanging(value); + _AccountNumber = value; + OnAccountNumberChanged(); + } + } + private global::System.String _AccountNumber; + partial void OnAccountNumberChanging(global::System.String value); + partial void OnAccountNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CustomerType + { + get + { + return _CustomerType; + } + set + { + OnCustomerTypeChanging(value); + _CustomerType = value; + OnCustomerTypeChanged(); + } + } + private global::System.String _CustomerType; + partial void OnCustomerTypeChanging(global::System.String value); + partial void OnCustomerTypeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesTerritory SalesTerritory + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesTerritoryReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection CustomerAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "CustomerAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "CustomerAddress", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Individual Individual + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference IndividualReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Store Store + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference StoreReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class CustomerAddress + { + #region Factory Method + + /// + /// Create a new CustomerAddress object. + /// + /// Initial value of the CustomerID property. + /// Initial value of the AddressID property. + /// Initial value of the AddressTypeID property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static CustomerAddress CreateCustomerAddress(global::System.Int32 customerID, global::System.Int32 addressID, global::System.Int32 addressTypeID, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + CustomerAddress customerAddress = new CustomerAddress(); + customerAddress.CustomerID = customerID; + customerAddress.AddressID = addressID; + customerAddress.AddressTypeID = addressTypeID; + customerAddress.rowguid = rowguid; + customerAddress.ModifiedDate = modifiedDate; + return customerAddress; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CustomerID + { + get + { + return _CustomerID; + } + set + { + if (_CustomerID != value) + { + OnCustomerIDChanging(value); + _CustomerID = value; + OnCustomerIDChanged(); + } + } + } + private global::System.Int32 _CustomerID; + partial void OnCustomerIDChanging(global::System.Int32 value); + partial void OnCustomerIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AddressID + { + get + { + return _AddressID; + } + set + { + if (_AddressID != value) + { + OnAddressIDChanging(value); + _AddressID = value; + OnAddressIDChanged(); + } + } + } + private global::System.Int32 _AddressID; + partial void OnAddressIDChanging(global::System.Int32 value); + partial void OnAddressIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AddressTypeID + { + get + { + return _AddressTypeID; + } + set + { + OnAddressTypeIDChanging(value); + _AddressTypeID = value; + OnAddressTypeIDChanged(); + } + } + private global::System.Int32 _AddressTypeID; + partial void OnAddressTypeIDChanging(global::System.Int32 value); + partial void OnAddressTypeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Address Address + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference
AddressReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public AddressType AddressType + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference AddressTypeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Customer Customer + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CustomerReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class DatabaseLog + { + #region Factory Method + + /// + /// Create a new DatabaseLog object. + /// + /// Initial value of the DatabaseLogID property. + /// Initial value of the PostTime property. + /// Initial value of the DatabaseUser property. + /// Initial value of the Event property. + /// Initial value of the TSQL property. + /// Initial value of the XmlEvent property. + public static DatabaseLog CreateDatabaseLog(global::System.Int32 databaseLogID, global::System.DateTime postTime, global::System.String databaseUser, global::System.String @event, global::System.String tSQL, global::System.String xmlEvent) + { + DatabaseLog databaseLog = new DatabaseLog(); + databaseLog.DatabaseLogID = databaseLogID; + databaseLog.PostTime = postTime; + databaseLog.DatabaseUser = databaseUser; + databaseLog.Event = @event; + databaseLog.TSQL = tSQL; + databaseLog.XmlEvent = xmlEvent; + return databaseLog; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 DatabaseLogID + { + get + { + return _DatabaseLogID; + } + set + { + if (_DatabaseLogID != value) + { + OnDatabaseLogIDChanging(value); + _DatabaseLogID = value; + OnDatabaseLogIDChanged(); + } + } + } + private global::System.Int32 _DatabaseLogID; + partial void OnDatabaseLogIDChanging(global::System.Int32 value); + partial void OnDatabaseLogIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime PostTime + { + get + { + return _PostTime; + } + set + { + OnPostTimeChanging(value); + _PostTime = value; + OnPostTimeChanged(); + } + } + private global::System.DateTime _PostTime; + partial void OnPostTimeChanging(global::System.DateTime value); + partial void OnPostTimeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String DatabaseUser + { + get + { + return _DatabaseUser; + } + set + { + OnDatabaseUserChanging(value); + _DatabaseUser = value; + OnDatabaseUserChanged(); + } + } + private global::System.String _DatabaseUser; + partial void OnDatabaseUserChanging(global::System.String value); + partial void OnDatabaseUserChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Event + { + get + { + return _Event; + } + set + { + OnEventChanging(value); + _Event = value; + OnEventChanged(); + } + } + private global::System.String _Event; + partial void OnEventChanging(global::System.String value); + partial void OnEventChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Schema + { + get + { + return _Schema; + } + set + { + OnSchemaChanging(value); + _Schema = value; + OnSchemaChanged(); + } + } + private global::System.String _Schema; + partial void OnSchemaChanging(global::System.String value); + partial void OnSchemaChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Object + { + get + { + return _Object; + } + set + { + OnObjectChanging(value); + _Object = value; + OnObjectChanged(); + } + } + private global::System.String _Object; + partial void OnObjectChanging(global::System.String value); + partial void OnObjectChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String TSQL + { + get + { + return _TSQL; + } + set + { + OnTSQLChanging(value); + _TSQL = value; + OnTSQLChanged(); + } + } + private global::System.String _TSQL; + partial void OnTSQLChanging(global::System.String value); + partial void OnTSQLChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String XmlEvent + { + get + { + return _XmlEvent; + } + set + { + OnXmlEventChanging(value); + _XmlEvent = value; + OnXmlEventChanged(); + } + } + private global::System.String _XmlEvent; + partial void OnXmlEventChanging(global::System.String value); + partial void OnXmlEventChanged(); + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Department + { + #region Factory Method + + /// + /// Create a new Department object. + /// + /// Initial value of the DepartmentID property. + /// Initial value of the Name property. + /// Initial value of the GroupName property. + /// Initial value of the ModifiedDate property. + public static Department CreateDepartment(global::System.Int16 departmentID, global::System.String name, global::System.String groupName, global::System.DateTime modifiedDate) + { + Department department = new Department(); + department.DepartmentID = departmentID; + department.Name = name; + department.GroupName = groupName; + department.ModifiedDate = modifiedDate; + return department; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 DepartmentID + { + get + { + return _DepartmentID; + } + set + { + if (_DepartmentID != value) + { + OnDepartmentIDChanging(value); + _DepartmentID = value; + OnDepartmentIDChanged(); + } + } + } + private global::System.Int16 _DepartmentID; + partial void OnDepartmentIDChanging(global::System.Int16 value); + partial void OnDepartmentIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String GroupName + { + get + { + return _GroupName; + } + set + { + OnGroupNameChanging(value); + _GroupName = value; + OnGroupNameChanged(); + } + } + private global::System.String _GroupName; + partial void OnGroupNameChanging(global::System.String value); + partial void OnGroupNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection EmployeeDepartmentHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "EmployeeDepartmentHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "EmployeeDepartmentHistory", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Document + { + #region Factory Method + + /// + /// Create a new Document object. + /// + /// Initial value of the DocumentID property. + /// Initial value of the Title property. + /// Initial value of the FileName property. + /// Initial value of the FileExtension property. + /// Initial value of the Revision property. + /// Initial value of the ChangeNumber property. + /// Initial value of the Status property. + /// Initial value of the ModifiedDate property. + public static Document CreateDocument(global::System.Int32 documentID, global::System.String title, global::System.String fileName, global::System.String fileExtension, global::System.String revision, global::System.Int32 changeNumber, global::System.Byte status, global::System.DateTime modifiedDate) + { + Document document = new Document(); + document.DocumentID = documentID; + document.Title = title; + document.FileName = fileName; + document.FileExtension = fileExtension; + document.Revision = revision; + document.ChangeNumber = changeNumber; + document.Status = status; + document.ModifiedDate = modifiedDate; + return document; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 DocumentID + { + get + { + return _DocumentID; + } + set + { + if (_DocumentID != value) + { + OnDocumentIDChanging(value); + _DocumentID = value; + OnDocumentIDChanged(); + } + } + } + private global::System.Int32 _DocumentID; + partial void OnDocumentIDChanging(global::System.Int32 value); + partial void OnDocumentIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Title + { + get + { + return _Title; + } + set + { + OnTitleChanging(value); + _Title = value; + OnTitleChanged(); + } + } + private global::System.String _Title; + partial void OnTitleChanging(global::System.String value); + partial void OnTitleChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String FileName + { + get + { + return _FileName; + } + set + { + OnFileNameChanging(value); + _FileName = value; + OnFileNameChanged(); + } + } + private global::System.String _FileName; + partial void OnFileNameChanging(global::System.String value); + partial void OnFileNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String FileExtension + { + get + { + return _FileExtension; + } + set + { + OnFileExtensionChanging(value); + _FileExtension = value; + OnFileExtensionChanged(); + } + } + private global::System.String _FileExtension; + partial void OnFileExtensionChanging(global::System.String value); + partial void OnFileExtensionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Revision + { + get + { + return _Revision; + } + set + { + OnRevisionChanging(value); + _Revision = value; + OnRevisionChanged(); + } + } + private global::System.String _Revision; + partial void OnRevisionChanging(global::System.String value); + partial void OnRevisionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ChangeNumber + { + get + { + return _ChangeNumber; + } + set + { + OnChangeNumberChanging(value); + _ChangeNumber = value; + OnChangeNumberChanged(); + } + } + private global::System.Int32 _ChangeNumber; + partial void OnChangeNumberChanging(global::System.Int32 value); + partial void OnChangeNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte Status + { + get + { + return _Status; + } + set + { + OnStatusChanging(value); + _Status = value; + OnStatusChanged(); + } + } + private global::System.Byte _Status; + partial void OnStatusChanging(global::System.Byte value); + partial void OnStatusChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String DocumentSummary + { + get + { + return _DocumentSummary; + } + set + { + OnDocumentSummaryChanging(value); + _DocumentSummary = value; + OnDocumentSummaryChanged(); + } + } + private global::System.String _DocumentSummary; + partial void OnDocumentSummaryChanging(global::System.String value); + partial void OnDocumentSummaryChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte[] Document1 + { + get + { + return value; + } + set + { + OnDocument1Changing(value); + _Document1 = value; + OnDocument1Changed(); + } + } + private global::System.Byte[] _Document1; + partial void OnDocument1Changing(global::System.Byte[] value); + partial void OnDocument1Changed(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductDocuments + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "ProductDocument"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "ProductDocument", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Employee + { + #region Factory Method + + /// + /// Create a new Employee object. + /// + /// Initial value of the EmployeeID property. + /// Initial value of the NationalIDNumber property. + /// Initial value of the ContactID property. + /// Initial value of the LoginID property. + /// Initial value of the Title property. + /// Initial value of the BirthDate property. + /// Initial value of the MaritalStatus property. + /// Initial value of the Gender property. + /// Initial value of the HireDate property. + /// Initial value of the SalariedFlag property. + /// Initial value of the VacationHours property. + /// Initial value of the SickLeaveHours property. + /// Initial value of the CurrentFlag property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static Employee CreateEmployee(global::System.Int32 employeeID, global::System.String nationalIDNumber, global::System.Int32 contactID, global::System.String loginID, global::System.String title, global::System.DateTime birthDate, global::System.String maritalStatus, global::System.String gender, global::System.DateTime hireDate, global::System.Boolean salariedFlag, global::System.Int16 vacationHours, global::System.Int16 sickLeaveHours, global::System.Boolean currentFlag, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + Employee employee = new Employee(); + employee.EmployeeID = employeeID; + employee.NationalIDNumber = nationalIDNumber; + employee.ContactID = contactID; + employee.LoginID = loginID; + employee.Title = title; + employee.BirthDate = birthDate; + employee.MaritalStatus = maritalStatus; + employee.Gender = gender; + employee.HireDate = hireDate; + employee.SalariedFlag = salariedFlag; + employee.VacationHours = vacationHours; + employee.SickLeaveHours = sickLeaveHours; + employee.CurrentFlag = currentFlag; + employee.rowguid = rowguid; + employee.ModifiedDate = modifiedDate; + return employee; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 EmployeeID + { + get + { + return _EmployeeID; + } + set + { + if (_EmployeeID != value) + { + OnEmployeeIDChanging(value); + _EmployeeID = value; + OnEmployeeIDChanged(); + } + } + } + private global::System.Int32 _EmployeeID; + partial void OnEmployeeIDChanging(global::System.Int32 value); + partial void OnEmployeeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String NationalIDNumber + { + get + { + return _NationalIDNumber; + } + set + { + OnNationalIDNumberChanging(value); + _NationalIDNumber = value; + OnNationalIDNumberChanged(); + } + } + private global::System.String _NationalIDNumber; + partial void OnNationalIDNumberChanging(global::System.String value); + partial void OnNationalIDNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactID + { + get + { + return _ContactID; + } + set + { + OnContactIDChanging(value); + _ContactID = value; + OnContactIDChanged(); + } + } + private global::System.Int32 _ContactID; + partial void OnContactIDChanging(global::System.Int32 value); + partial void OnContactIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String LoginID + { + get + { + return _LoginID; + } + set + { + OnLoginIDChanging(value); + _LoginID = value; + OnLoginIDChanged(); + } + } + private global::System.String _LoginID; + partial void OnLoginIDChanging(global::System.String value); + partial void OnLoginIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ManagerID + { + get + { + return _ManagerID; + } + set + { + OnManagerIDChanging(value); + _ManagerID = value; + OnManagerIDChanged(); + } + } + private Nullable _ManagerID; + partial void OnManagerIDChanging(Nullable value); + partial void OnManagerIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Title + { + get + { + return _Title; + } + set + { + OnTitleChanging(value); + _Title = value; + OnTitleChanged(); + } + } + private global::System.String _Title; + partial void OnTitleChanging(global::System.String value); + partial void OnTitleChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime BirthDate + { + get + { + return _BirthDate; + } + set + { + OnBirthDateChanging(value); + _BirthDate = value; + OnBirthDateChanged(); + } + } + private global::System.DateTime _BirthDate; + partial void OnBirthDateChanging(global::System.DateTime value); + partial void OnBirthDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String MaritalStatus + { + get + { + return _MaritalStatus; + } + set + { + OnMaritalStatusChanging(value); + _MaritalStatus = value; + OnMaritalStatusChanged(); + } + } + private global::System.String _MaritalStatus; + partial void OnMaritalStatusChanging(global::System.String value); + partial void OnMaritalStatusChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Gender + { + get + { + return _Gender; + } + set + { + OnGenderChanging(value); + _Gender = value; + OnGenderChanged(); + } + } + private global::System.String _Gender; + partial void OnGenderChanging(global::System.String value); + partial void OnGenderChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime HireDate + { + get + { + return _HireDate; + } + set + { + OnHireDateChanging(value); + _HireDate = value; + OnHireDateChanged(); + } + } + private global::System.DateTime _HireDate; + partial void OnHireDateChanging(global::System.DateTime value); + partial void OnHireDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean SalariedFlag + { + get + { + return _SalariedFlag; + } + set + { + OnSalariedFlagChanging(value); + _SalariedFlag = value; + OnSalariedFlagChanged(); + } + } + private global::System.Boolean _SalariedFlag; + partial void OnSalariedFlagChanging(global::System.Boolean value); + partial void OnSalariedFlagChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 VacationHours + { + get + { + return _VacationHours; + } + set + { + OnVacationHoursChanging(value); + _VacationHours = value; + OnVacationHoursChanged(); + } + } + private global::System.Int16 _VacationHours; + partial void OnVacationHoursChanging(global::System.Int16 value); + partial void OnVacationHoursChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 SickLeaveHours + { + get + { + return _SickLeaveHours; + } + set + { + OnSickLeaveHoursChanging(value); + _SickLeaveHours = value; + OnSickLeaveHoursChanged(); + } + } + private global::System.Int16 _SickLeaveHours; + partial void OnSickLeaveHoursChanging(global::System.Int16 value); + partial void OnSickLeaveHoursChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean CurrentFlag + { + get + { + return _CurrentFlag; + } + set + { + OnCurrentFlagChanging(value); + _CurrentFlag = value; + OnCurrentFlagChanged(); + } + } + private global::System.Boolean _CurrentFlag; + partial void OnCurrentFlagChanging(global::System.Boolean value); + partial void OnCurrentFlagChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Contact Contact + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Reports + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee1"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee1", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Employee Manager + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ManagerReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection EmployeeAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "EmployeeAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "EmployeeAddress", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection EmployeeDepartmentHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "EmployeeDepartmentHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "EmployeeDepartmentHistory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection EmployeePayHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "EmployeePayHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "EmployeePayHistory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection JobCandidates + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "JobCandidate"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "JobCandidate", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection PurchaseOrders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "PurchaseOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "PurchaseOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesPerson SalesPerson + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesPersonReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class EmployeeAddress + { + #region Factory Method + + /// + /// Create a new EmployeeAddress object. + /// + /// Initial value of the EmployeeID property. + /// Initial value of the AddressID property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static EmployeeAddress CreateEmployeeAddress(global::System.Int32 employeeID, global::System.Int32 addressID, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + EmployeeAddress employeeAddress = new EmployeeAddress(); + employeeAddress.EmployeeID = employeeID; + employeeAddress.AddressID = addressID; + employeeAddress.rowguid = rowguid; + employeeAddress.ModifiedDate = modifiedDate; + return employeeAddress; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 EmployeeID + { + get + { + return _EmployeeID; + } + set + { + if (_EmployeeID != value) + { + OnEmployeeIDChanging(value); + _EmployeeID = value; + OnEmployeeIDChanged(); + } + } + } + private global::System.Int32 _EmployeeID; + partial void OnEmployeeIDChanging(global::System.Int32 value); + partial void OnEmployeeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AddressID + { + get + { + return _AddressID; + } + set + { + if (_AddressID != value) + { + OnAddressIDChanging(value); + _AddressID = value; + OnAddressIDChanged(); + } + } + } + private global::System.Int32 _AddressID; + partial void OnAddressIDChanging(global::System.Int32 value); + partial void OnAddressIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Employee Employee + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference EmployeeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Address Address + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference
AddressReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class EmployeeDepartmentHistory + { + #region Factory Method + + /// + /// Create a new EmployeeDepartmentHistory object. + /// + /// Initial value of the EmployeeID property. + /// Initial value of the DepartmentID property. + /// Initial value of the ShiftID property. + /// Initial value of the StartDate property. + /// Initial value of the ModifiedDate property. + public static EmployeeDepartmentHistory CreateEmployeeDepartmentHistory(global::System.Int32 employeeID, global::System.Int16 departmentID, global::System.Byte shiftID, global::System.DateTime startDate, global::System.DateTime modifiedDate) + { + EmployeeDepartmentHistory employeeDepartmentHistory = new EmployeeDepartmentHistory(); + employeeDepartmentHistory.EmployeeID = employeeID; + employeeDepartmentHistory.DepartmentID = departmentID; + employeeDepartmentHistory.ShiftID = shiftID; + employeeDepartmentHistory.StartDate = startDate; + employeeDepartmentHistory.ModifiedDate = modifiedDate; + return employeeDepartmentHistory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 EmployeeID + { + get + { + return _EmployeeID; + } + set + { + if (_EmployeeID != value) + { + OnEmployeeIDChanging(value); + _EmployeeID = value; + OnEmployeeIDChanged(); + } + } + } + private global::System.Int32 _EmployeeID; + partial void OnEmployeeIDChanging(global::System.Int32 value); + partial void OnEmployeeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 DepartmentID + { + get + { + return _DepartmentID; + } + set + { + if (_DepartmentID != value) + { + OnDepartmentIDChanging(value); + _DepartmentID = value; + OnDepartmentIDChanged(); + } + } + } + private global::System.Int16 _DepartmentID; + partial void OnDepartmentIDChanging(global::System.Int16 value); + partial void OnDepartmentIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte ShiftID + { + get + { + return _ShiftID; + } + set + { + if (_ShiftID != value) + { + OnShiftIDChanging(value); + _ShiftID = value; + OnShiftIDChanged(); + } + } + } + private global::System.Byte _ShiftID; + partial void OnShiftIDChanging(global::System.Byte value); + partial void OnShiftIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartDate + { + get + { + return _StartDate; + } + set + { + if (_StartDate != value) + { + OnStartDateChanging(value); + _StartDate = value; + OnStartDateChanged(); + } + } + } + private global::System.DateTime _StartDate; + partial void OnStartDateChanging(global::System.DateTime value); + partial void OnStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable EndDate + { + get + { + return _EndDate; + } + set + { + OnEndDateChanging(value); + _EndDate = value; + OnEndDateChanged(); + } + } + private Nullable _EndDate; + partial void OnEndDateChanging(Nullable value); + partial void OnEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Department Department + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference DepartmentReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Employee Employee + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference EmployeeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Shift Shift + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ShiftReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class EmployeePayHistory + { + #region Factory Method + + /// + /// Create a new EmployeePayHistory object. + /// + /// Initial value of the EmployeeID property. + /// Initial value of the RateChangeDate property. + /// Initial value of the Rate property. + /// Initial value of the PayFrequency property. + /// Initial value of the ModifiedDate property. + public static EmployeePayHistory CreateEmployeePayHistory(global::System.Int32 employeeID, global::System.DateTime rateChangeDate, global::System.Decimal rate, global::System.Byte payFrequency, global::System.DateTime modifiedDate) + { + EmployeePayHistory employeePayHistory = new EmployeePayHistory(); + employeePayHistory.EmployeeID = employeeID; + employeePayHistory.RateChangeDate = rateChangeDate; + employeePayHistory.Rate = rate; + employeePayHistory.PayFrequency = payFrequency; + employeePayHistory.ModifiedDate = modifiedDate; + return employeePayHistory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 EmployeeID + { + get + { + return _EmployeeID; + } + set + { + if (_EmployeeID != value) + { + OnEmployeeIDChanging(value); + _EmployeeID = value; + OnEmployeeIDChanged(); + } + } + } + private global::System.Int32 _EmployeeID; + partial void OnEmployeeIDChanging(global::System.Int32 value); + partial void OnEmployeeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime RateChangeDate + { + get + { + return _RateChangeDate; + } + set + { + if (_RateChangeDate != value) + { + OnRateChangeDateChanging(value); + _RateChangeDate = value; + OnRateChangeDateChanged(); + } + } + } + private global::System.DateTime _RateChangeDate; + partial void OnRateChangeDateChanging(global::System.DateTime value); + partial void OnRateChangeDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal Rate + { + get + { + return _Rate; + } + set + { + OnRateChanging(value); + _Rate = value; + OnRateChanged(); + } + } + private global::System.Decimal _Rate; + partial void OnRateChanging(global::System.Decimal value); + partial void OnRateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte PayFrequency + { + get + { + return _PayFrequency; + } + set + { + OnPayFrequencyChanging(value); + _PayFrequency = value; + OnPayFrequencyChanged(); + } + } + private global::System.Byte _PayFrequency; + partial void OnPayFrequencyChanging(global::System.Byte value); + partial void OnPayFrequencyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Employee Employee + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference EmployeeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ErrorLog + { + #region Factory Method + + /// + /// Create a new ErrorLog object. + /// + /// Initial value of the ErrorLogID property. + /// Initial value of the ErrorTime property. + /// Initial value of the UserName property. + /// Initial value of the ErrorNumber property. + /// Initial value of the ErrorMessage property. + public static ErrorLog CreateErrorLog(global::System.Int32 errorLogID, global::System.DateTime errorTime, global::System.String userName, global::System.Int32 errorNumber, global::System.String errorMessage) + { + ErrorLog errorLog = new ErrorLog(); + errorLog.ErrorLogID = errorLogID; + errorLog.ErrorTime = errorTime; + errorLog.UserName = userName; + errorLog.ErrorNumber = errorNumber; + errorLog.ErrorMessage = errorMessage; + return errorLog; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ErrorLogID + { + get + { + return _ErrorLogID; + } + set + { + if (_ErrorLogID != value) + { + OnErrorLogIDChanging(value); + _ErrorLogID = value; + OnErrorLogIDChanged(); + } + } + } + private global::System.Int32 _ErrorLogID; + partial void OnErrorLogIDChanging(global::System.Int32 value); + partial void OnErrorLogIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ErrorTime + { + get + { + return _ErrorTime; + } + set + { + OnErrorTimeChanging(value); + _ErrorTime = value; + OnErrorTimeChanged(); + } + } + private global::System.DateTime _ErrorTime; + partial void OnErrorTimeChanging(global::System.DateTime value); + partial void OnErrorTimeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String UserName + { + get + { + return _UserName; + } + set + { + OnUserNameChanging(value); + _UserName = value; + OnUserNameChanged(); + } + } + private global::System.String _UserName; + partial void OnUserNameChanging(global::System.String value); + partial void OnUserNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ErrorNumber + { + get + { + return _ErrorNumber; + } + set + { + OnErrorNumberChanging(value); + _ErrorNumber = value; + OnErrorNumberChanged(); + } + } + private global::System.Int32 _ErrorNumber; + partial void OnErrorNumberChanging(global::System.Int32 value); + partial void OnErrorNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ErrorSeverity + { + get + { + return _ErrorSeverity; + } + set + { + OnErrorSeverityChanging(value); + _ErrorSeverity = value; + OnErrorSeverityChanged(); + } + } + private Nullable _ErrorSeverity; + partial void OnErrorSeverityChanging(Nullable value); + partial void OnErrorSeverityChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ErrorState + { + get + { + return _ErrorState; + } + set + { + OnErrorStateChanging(value); + _ErrorState = value; + OnErrorStateChanged(); + } + } + private Nullable _ErrorState; + partial void OnErrorStateChanging(Nullable value); + partial void OnErrorStateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ErrorProcedure + { + get + { + return _ErrorProcedure; + } + set + { + OnErrorProcedureChanging(value); + _ErrorProcedure = value; + OnErrorProcedureChanged(); + } + } + private global::System.String _ErrorProcedure; + partial void OnErrorProcedureChanging(global::System.String value); + partial void OnErrorProcedureChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ErrorLine + { + get + { + return _ErrorLine; + } + set + { + OnErrorLineChanging(value); + _ErrorLine = value; + OnErrorLineChanged(); + } + } + private Nullable _ErrorLine; + partial void OnErrorLineChanging(Nullable value); + partial void OnErrorLineChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ErrorMessage + { + get + { + return _ErrorMessage; + } + set + { + OnErrorMessageChanging(value); + _ErrorMessage = value; + OnErrorMessageChanged(); + } + } + private global::System.String _ErrorMessage; + partial void OnErrorMessageChanging(global::System.String value); + partial void OnErrorMessageChanged(); + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Illustration + { + #region Factory Method + + /// + /// Create a new Illustration object. + /// + /// Initial value of the IllustrationID property. + /// Initial value of the ModifiedDate property. + public static Illustration CreateIllustration(global::System.Int32 illustrationID, global::System.DateTime modifiedDate) + { + Illustration illustration = new Illustration(); + illustration.IllustrationID = illustrationID; + illustration.ModifiedDate = modifiedDate; + return illustration; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 IllustrationID + { + get + { + return _IllustrationID; + } + set + { + if (_IllustrationID != value) + { + OnIllustrationIDChanging(value); + _IllustrationID = value; + OnIllustrationIDChanged(); + } + } + } + private global::System.Int32 _IllustrationID; + partial void OnIllustrationIDChanging(global::System.Int32 value); + partial void OnIllustrationIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Diagram + { + get + { + return _Diagram; + } + set + { + OnDiagramChanging(value); + _Diagram = value; + OnDiagramChanged(); + } + } + private global::System.String _Diagram; + partial void OnDiagramChanging(global::System.String value); + partial void OnDiagramChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductModelIllustrations + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "ProductModelIllustration"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "ProductModelIllustration", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Individual + { + #region Factory Method + + /// + /// Create a new Individual object. + /// + /// Initial value of the CustomerID property. + /// Initial value of the ContactID property. + /// Initial value of the ModifiedDate property. + public static Individual CreateIndividual(global::System.Int32 customerID, global::System.Int32 contactID, global::System.DateTime modifiedDate) + { + Individual individual = new Individual(); + individual.CustomerID = customerID; + individual.ContactID = contactID; + individual.ModifiedDate = modifiedDate; + return individual; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CustomerID + { + get + { + return _CustomerID; + } + set + { + if (_CustomerID != value) + { + OnCustomerIDChanging(value); + _CustomerID = value; + OnCustomerIDChanged(); + } + } + } + private global::System.Int32 _CustomerID; + partial void OnCustomerIDChanging(global::System.Int32 value); + partial void OnCustomerIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactID + { + get + { + return _ContactID; + } + set + { + OnContactIDChanging(value); + _ContactID = value; + OnContactIDChanged(); + } + } + private global::System.Int32 _ContactID; + partial void OnContactIDChanging(global::System.Int32 value); + partial void OnContactIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Demographics + { + get + { + return _Demographics; + } + set + { + OnDemographicsChanging(value); + _Demographics = value; + OnDemographicsChanged(); + } + } + private global::System.String _Demographics; + partial void OnDemographicsChanging(global::System.String value); + partial void OnDemographicsChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Contact Contact + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Customer Customer + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CustomerReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class JobCandidate + { + #region Factory Method + + /// + /// Create a new JobCandidate object. + /// + /// Initial value of the JobCandidateID property. + /// Initial value of the ModifiedDate property. + public static JobCandidate CreateJobCandidate(global::System.Int32 jobCandidateID, global::System.DateTime modifiedDate) + { + JobCandidate jobCandidate = new JobCandidate(); + jobCandidate.JobCandidateID = jobCandidateID; + jobCandidate.ModifiedDate = modifiedDate; + return jobCandidate; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 JobCandidateID + { + get + { + return _JobCandidateID; + } + set + { + if (_JobCandidateID != value) + { + OnJobCandidateIDChanging(value); + _JobCandidateID = value; + OnJobCandidateIDChanged(); + } + } + } + private global::System.Int32 _JobCandidateID; + partial void OnJobCandidateIDChanging(global::System.Int32 value); + partial void OnJobCandidateIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable EmployeeID + { + get + { + return _EmployeeID; + } + set + { + OnEmployeeIDChanging(value); + _EmployeeID = value; + OnEmployeeIDChanged(); + } + } + private Nullable _EmployeeID; + partial void OnEmployeeIDChanging(Nullable value); + partial void OnEmployeeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Resume + { + get + { + return _Resume; + } + set + { + OnResumeChanging(value); + _Resume = value; + OnResumeChanged(); + } + } + private global::System.String _Resume; + partial void OnResumeChanging(global::System.String value); + partial void OnResumeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Employee Employee + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference EmployeeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Location + { + #region Factory Method + + /// + /// Create a new Location object. + /// + /// Initial value of the LocationID property. + /// Initial value of the Name property. + /// Initial value of the CostRate property. + /// Initial value of the Availability property. + /// Initial value of the ModifiedDate property. + public static Location CreateLocation(global::System.Int16 locationID, global::System.String name, global::System.Decimal costRate, global::System.Decimal availability, global::System.DateTime modifiedDate) + { + Location location = new Location(); + location.LocationID = locationID; + location.Name = name; + location.CostRate = costRate; + location.Availability = availability; + location.ModifiedDate = modifiedDate; + return location; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 LocationID + { + get + { + return _LocationID; + } + set + { + if (_LocationID != value) + { + OnLocationIDChanging(value); + _LocationID = value; + OnLocationIDChanged(); + } + } + } + private global::System.Int16 _LocationID; + partial void OnLocationIDChanging(global::System.Int16 value); + partial void OnLocationIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal CostRate + { + get + { + return _CostRate; + } + set + { + OnCostRateChanging(value); + _CostRate = value; + OnCostRateChanged(); + } + } + private global::System.Decimal _CostRate; + partial void OnCostRateChanging(global::System.Decimal value); + partial void OnCostRateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal Availability + { + get + { + return _Availability; + } + set + { + OnAvailabilityChanging(value); + _Availability = value; + OnAvailabilityChanged(); + } + } + private global::System.Decimal _Availability; + partial void OnAvailabilityChanging(global::System.Decimal value); + partial void OnAvailabilityChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductInventories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "ProductInventory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "ProductInventory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection WorkOrderRoutings + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "WorkOrderRouting"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "WorkOrderRouting", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Product + { + #region Factory Method + + /// + /// Create a new Product object. + /// + /// Initial value of the ProductID property. + /// Initial value of the Name property. + /// Initial value of the ProductNumber property. + /// Initial value of the MakeFlag property. + /// Initial value of the FinishedGoodsFlag property. + /// Initial value of the SafetyStockLevel property. + /// Initial value of the ReorderPoint property. + /// Initial value of the StandardCost property. + /// Initial value of the ListPrice property. + /// Initial value of the DaysToManufacture property. + /// Initial value of the SellStartDate property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static Product CreateProduct(global::System.Int32 productID, global::System.String name, global::System.String productNumber, global::System.Boolean makeFlag, global::System.Boolean finishedGoodsFlag, global::System.Int16 safetyStockLevel, global::System.Int16 reorderPoint, global::System.Decimal standardCost, global::System.Decimal listPrice, global::System.Int32 daysToManufacture, global::System.DateTime sellStartDate, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + Product product = new Product(); + product.ProductID = productID; + product.Name = name; + product.ProductNumber = productNumber; + product.MakeFlag = makeFlag; + product.FinishedGoodsFlag = finishedGoodsFlag; + product.SafetyStockLevel = safetyStockLevel; + product.ReorderPoint = reorderPoint; + product.StandardCost = standardCost; + product.ListPrice = listPrice; + product.DaysToManufacture = daysToManufacture; + product.SellStartDate = sellStartDate; + product.rowguid = rowguid; + product.ModifiedDate = modifiedDate; + return product; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ProductNumber + { + get + { + return _ProductNumber; + } + set + { + OnProductNumberChanging(value); + _ProductNumber = value; + OnProductNumberChanged(); + } + } + private global::System.String _ProductNumber; + partial void OnProductNumberChanging(global::System.String value); + partial void OnProductNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean MakeFlag + { + get + { + return _MakeFlag; + } + set + { + OnMakeFlagChanging(value); + _MakeFlag = value; + OnMakeFlagChanged(); + } + } + private global::System.Boolean _MakeFlag; + partial void OnMakeFlagChanging(global::System.Boolean value); + partial void OnMakeFlagChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean FinishedGoodsFlag + { + get + { + return _FinishedGoodsFlag; + } + set + { + OnFinishedGoodsFlagChanging(value); + _FinishedGoodsFlag = value; + OnFinishedGoodsFlagChanged(); + } + } + private global::System.Boolean _FinishedGoodsFlag; + partial void OnFinishedGoodsFlagChanging(global::System.Boolean value); + partial void OnFinishedGoodsFlagChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Color + { + get + { + return _Color; + } + set + { + OnColorChanging(value); + _Color = value; + OnColorChanged(); + } + } + private global::System.String _Color; + partial void OnColorChanging(global::System.String value); + partial void OnColorChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 SafetyStockLevel + { + get + { + return _SafetyStockLevel; + } + set + { + OnSafetyStockLevelChanging(value); + _SafetyStockLevel = value; + OnSafetyStockLevelChanged(); + } + } + private global::System.Int16 _SafetyStockLevel; + partial void OnSafetyStockLevelChanging(global::System.Int16 value); + partial void OnSafetyStockLevelChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 ReorderPoint + { + get + { + return _ReorderPoint; + } + set + { + OnReorderPointChanging(value); + _ReorderPoint = value; + OnReorderPointChanged(); + } + } + private global::System.Int16 _ReorderPoint; + partial void OnReorderPointChanging(global::System.Int16 value); + partial void OnReorderPointChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal StandardCost + { + get + { + return _StandardCost; + } + set + { + OnStandardCostChanging(value); + _StandardCost = value; + OnStandardCostChanged(); + } + } + private global::System.Decimal _StandardCost; + partial void OnStandardCostChanging(global::System.Decimal value); + partial void OnStandardCostChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal ListPrice + { + get + { + return _ListPrice; + } + set + { + OnListPriceChanging(value); + _ListPrice = value; + OnListPriceChanged(); + } + } + private global::System.Decimal _ListPrice; + partial void OnListPriceChanging(global::System.Decimal value); + partial void OnListPriceChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Size + { + get + { + return _Size; + } + set + { + OnSizeChanging(value); + _Size = value; + OnSizeChanged(); + } + } + private global::System.String _Size; + partial void OnSizeChanging(global::System.String value); + partial void OnSizeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String SizeUnitMeasureCode + { + get + { + return _SizeUnitMeasureCode; + } + set + { + OnSizeUnitMeasureCodeChanging(value); + _SizeUnitMeasureCode = value; + OnSizeUnitMeasureCodeChanged(); + } + } + private global::System.String _SizeUnitMeasureCode; + partial void OnSizeUnitMeasureCodeChanging(global::System.String value); + partial void OnSizeUnitMeasureCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String WeightUnitMeasureCode + { + get + { + return _WeightUnitMeasureCode; + } + set + { + OnWeightUnitMeasureCodeChanging(value); + _WeightUnitMeasureCode = value; + OnWeightUnitMeasureCodeChanged(); + } + } + private global::System.String _WeightUnitMeasureCode; + partial void OnWeightUnitMeasureCodeChanging(global::System.String value); + partial void OnWeightUnitMeasureCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable Weight + { + get + { + return _Weight; + } + set + { + OnWeightChanging(value); + _Weight = value; + OnWeightChanged(); + } + } + private Nullable _Weight; + partial void OnWeightChanging(Nullable value); + partial void OnWeightChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 DaysToManufacture + { + get + { + return _DaysToManufacture; + } + set + { + OnDaysToManufactureChanging(value); + _DaysToManufacture = value; + OnDaysToManufactureChanged(); + } + } + private global::System.Int32 _DaysToManufacture; + partial void OnDaysToManufactureChanging(global::System.Int32 value); + partial void OnDaysToManufactureChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ProductLine + { + get + { + return _ProductLine; + } + set + { + OnProductLineChanging(value); + _ProductLine = value; + OnProductLineChanged(); + } + } + private global::System.String _ProductLine; + partial void OnProductLineChanging(global::System.String value); + partial void OnProductLineChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Class + { + get + { + return _Class; + } + set + { + OnClassChanging(value); + _Class = value; + OnClassChanged(); + } + } + private global::System.String _Class; + partial void OnClassChanging(global::System.String value); + partial void OnClassChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Style + { + get + { + return _Style; + } + set + { + OnStyleChanging(value); + _Style = value; + OnStyleChanged(); + } + } + private global::System.String _Style; + partial void OnStyleChanging(global::System.String value); + partial void OnStyleChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ProductSubcategoryID + { + get + { + return _ProductSubcategoryID; + } + set + { + OnProductSubcategoryIDChanging(value); + _ProductSubcategoryID = value; + OnProductSubcategoryIDChanged(); + } + } + private Nullable _ProductSubcategoryID; + partial void OnProductSubcategoryIDChanging(Nullable value); + partial void OnProductSubcategoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ProductModelID + { + get + { + return _ProductModelID; + } + set + { + OnProductModelIDChanging(value); + _ProductModelID = value; + OnProductModelIDChanged(); + } + } + private Nullable _ProductModelID; + partial void OnProductModelIDChanging(Nullable value); + partial void OnProductModelIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime SellStartDate + { + get + { + return _SellStartDate; + } + set + { + OnSellStartDateChanging(value); + _SellStartDate = value; + OnSellStartDateChanged(); + } + } + private global::System.DateTime _SellStartDate; + partial void OnSellStartDateChanging(global::System.DateTime value); + partial void OnSellStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable SellEndDate + { + get + { + return _SellEndDate; + } + set + { + OnSellEndDateChanging(value); + _SellEndDate = value; + OnSellEndDateChanged(); + } + } + private Nullable _SellEndDate; + partial void OnSellEndDateChanging(Nullable value); + partial void OnSellEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable DiscontinuedDate + { + get + { + return _DiscontinuedDate; + } + set + { + OnDiscontinuedDateChanging(value); + _DiscontinuedDate = value; + OnDiscontinuedDateChanged(); + } + } + private Nullable _DiscontinuedDate; + partial void OnDiscontinuedDateChanging(Nullable value); + partial void OnDiscontinuedDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection BillOfMaterials + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "BillOfMaterials"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "BillOfMaterials", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection BillOfMaterials1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "BillOfMaterials"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "BillOfMaterials", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ProductModel ProductModel + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductModelReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ProductSubcategory ProductSubcategory + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductSubcategoryReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public UnitMeasure UnitMeasure + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference UnitMeasureReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public UnitMeasure UnitMeasure1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference UnitMeasure1Reference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductCostHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "ProductCostHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "ProductCostHistory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductDocuments + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "ProductDocument"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "ProductDocument", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductInventories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "ProductInventory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "ProductInventory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductListPriceHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "ProductListPriceHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "ProductListPriceHistory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductProductPhotoes + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "ProductProductPhoto"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "ProductProductPhoto", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductReviews + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductReview_Product_ProductID", "ProductReview"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductReview_Product_ProductID", "ProductReview", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductVendors + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "ProductVendor"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "ProductVendor", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection PurchaseOrderDetails + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "PurchaseOrderDetail"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "PurchaseOrderDetail", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ShoppingCartItems + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "ShoppingCartItem"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "ShoppingCartItem", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SpecialOfferProducts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "SpecialOfferProduct"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "SpecialOfferProduct", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection TransactionHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "TransactionHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "TransactionHistory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection WorkOrders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "WorkOrder"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "WorkOrder", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductCategory + { + #region Factory Method + + /// + /// Create a new ProductCategory object. + /// + /// Initial value of the ProductCategoryID property. + /// Initial value of the Name property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static ProductCategory CreateProductCategory(global::System.Int32 productCategoryID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + ProductCategory productCategory = new ProductCategory(); + productCategory.ProductCategoryID = productCategoryID; + productCategory.Name = name; + productCategory.rowguid = rowguid; + productCategory.ModifiedDate = modifiedDate; + return productCategory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductCategoryID + { + get + { + return _ProductCategoryID; + } + set + { + if (_ProductCategoryID != value) + { + OnProductCategoryIDChanging(value); + _ProductCategoryID = value; + OnProductCategoryIDChanged(); + } + } + } + private global::System.Int32 _ProductCategoryID; + partial void OnProductCategoryIDChanging(global::System.Int32 value); + partial void OnProductCategoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductSubcategories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductSubcategory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductSubcategory", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductCostHistory + { + #region Factory Method + + /// + /// Create a new ProductCostHistory object. + /// + /// Initial value of the ProductID property. + /// Initial value of the StartDate property. + /// Initial value of the StandardCost property. + /// Initial value of the ModifiedDate property. + public static ProductCostHistory CreateProductCostHistory(global::System.Int32 productID, global::System.DateTime startDate, global::System.Decimal standardCost, global::System.DateTime modifiedDate) + { + ProductCostHistory productCostHistory = new ProductCostHistory(); + productCostHistory.ProductID = productID; + productCostHistory.StartDate = startDate; + productCostHistory.StandardCost = standardCost; + productCostHistory.ModifiedDate = modifiedDate; + return productCostHistory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartDate + { + get + { + return _StartDate; + } + set + { + if (_StartDate != value) + { + OnStartDateChanging(value); + _StartDate = value; + OnStartDateChanged(); + } + } + } + private global::System.DateTime _StartDate; + partial void OnStartDateChanging(global::System.DateTime value); + partial void OnStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable EndDate + { + get + { + return _EndDate; + } + set + { + OnEndDateChanging(value); + _EndDate = value; + OnEndDateChanged(); + } + } + private Nullable _EndDate; + partial void OnEndDateChanging(Nullable value); + partial void OnEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal StandardCost + { + get + { + return _StandardCost; + } + set + { + OnStandardCostChanging(value); + _StandardCost = value; + OnStandardCostChanged(); + } + } + private global::System.Decimal _StandardCost; + partial void OnStandardCostChanging(global::System.Decimal value); + partial void OnStandardCostChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductDescription + { + #region Factory Method + + /// + /// Create a new ProductDescription object. + /// + /// Initial value of the ProductDescriptionID property. + /// Initial value of the Description property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static ProductDescription CreateProductDescription(global::System.Int32 productDescriptionID, global::System.String description, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + ProductDescription productDescription = new ProductDescription(); + productDescription.ProductDescriptionID = productDescriptionID; + productDescription.Description = description; + productDescription.rowguid = rowguid; + productDescription.ModifiedDate = modifiedDate; + return productDescription; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductDescriptionID + { + get + { + return _ProductDescriptionID; + } + set + { + if (_ProductDescriptionID != value) + { + OnProductDescriptionIDChanging(value); + _ProductDescriptionID = value; + OnProductDescriptionIDChanged(); + } + } + } + private global::System.Int32 _ProductDescriptionID; + partial void OnProductDescriptionIDChanging(global::System.Int32 value); + partial void OnProductDescriptionIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Description + { + get + { + return _Description; + } + set + { + OnDescriptionChanging(value); + _Description = value; + OnDescriptionChanged(); + } + } + private global::System.String _Description; + partial void OnDescriptionChanging(global::System.String value); + partial void OnDescriptionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductModelProductDescriptionCultures + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductModelProductDescriptionCulture"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductModelProductDescriptionCulture", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductDocument + { + #region Factory Method + + /// + /// Create a new ProductDocument object. + /// + /// Initial value of the ProductID property. + /// Initial value of the DocumentID property. + /// Initial value of the ModifiedDate property. + public static ProductDocument CreateProductDocument(global::System.Int32 productID, global::System.Int32 documentID, global::System.DateTime modifiedDate) + { + ProductDocument productDocument = new ProductDocument(); + productDocument.ProductID = productID; + productDocument.DocumentID = documentID; + productDocument.ModifiedDate = modifiedDate; + return productDocument; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 DocumentID + { + get + { + return _DocumentID; + } + set + { + if (_DocumentID != value) + { + OnDocumentIDChanging(value); + _DocumentID = value; + OnDocumentIDChanged(); + } + } + } + private global::System.Int32 _DocumentID; + partial void OnDocumentIDChanging(global::System.Int32 value); + partial void OnDocumentIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Document Document + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference DocumentReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductInventory + { + #region Factory Method + + /// + /// Create a new ProductInventory object. + /// + /// Initial value of the ProductID property. + /// Initial value of the LocationID property. + /// Initial value of the Shelf property. + /// Initial value of the Bin property. + /// Initial value of the Quantity property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static ProductInventory CreateProductInventory(global::System.Int32 productID, global::System.Int16 locationID, global::System.String shelf, global::System.Byte bin, global::System.Int16 quantity, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + ProductInventory productInventory = new ProductInventory(); + productInventory.ProductID = productID; + productInventory.LocationID = locationID; + productInventory.Shelf = shelf; + productInventory.Bin = bin; + productInventory.Quantity = quantity; + productInventory.rowguid = rowguid; + productInventory.ModifiedDate = modifiedDate; + return productInventory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 LocationID + { + get + { + return _LocationID; + } + set + { + if (_LocationID != value) + { + OnLocationIDChanging(value); + _LocationID = value; + OnLocationIDChanged(); + } + } + } + private global::System.Int16 _LocationID; + partial void OnLocationIDChanging(global::System.Int16 value); + partial void OnLocationIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Shelf + { + get + { + return _Shelf; + } + set + { + OnShelfChanging(value); + _Shelf = value; + OnShelfChanged(); + } + } + private global::System.String _Shelf; + partial void OnShelfChanging(global::System.String value); + partial void OnShelfChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte Bin + { + get + { + return _Bin; + } + set + { + OnBinChanging(value); + _Bin = value; + OnBinChanged(); + } + } + private global::System.Byte _Bin; + partial void OnBinChanging(global::System.Byte value); + partial void OnBinChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 Quantity + { + get + { + return _Quantity; + } + set + { + OnQuantityChanging(value); + _Quantity = value; + OnQuantityChanged(); + } + } + private global::System.Int16 _Quantity; + partial void OnQuantityChanging(global::System.Int16 value); + partial void OnQuantityChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Location Location + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference LocationReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductListPriceHistory + { + #region Factory Method + + /// + /// Create a new ProductListPriceHistory object. + /// + /// Initial value of the ProductID property. + /// Initial value of the StartDate property. + /// Initial value of the ListPrice property. + /// Initial value of the ModifiedDate property. + public static ProductListPriceHistory CreateProductListPriceHistory(global::System.Int32 productID, global::System.DateTime startDate, global::System.Decimal listPrice, global::System.DateTime modifiedDate) + { + ProductListPriceHistory productListPriceHistory = new ProductListPriceHistory(); + productListPriceHistory.ProductID = productID; + productListPriceHistory.StartDate = startDate; + productListPriceHistory.ListPrice = listPrice; + productListPriceHistory.ModifiedDate = modifiedDate; + return productListPriceHistory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartDate + { + get + { + return _StartDate; + } + set + { + if (_StartDate != value) + { + OnStartDateChanging(value); + _StartDate = value; + OnStartDateChanged(); + } + } + } + private global::System.DateTime _StartDate; + partial void OnStartDateChanging(global::System.DateTime value); + partial void OnStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable EndDate + { + get + { + return _EndDate; + } + set + { + OnEndDateChanging(value); + _EndDate = value; + OnEndDateChanged(); + } + } + private Nullable _EndDate; + partial void OnEndDateChanging(Nullable value); + partial void OnEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal ListPrice + { + get + { + return _ListPrice; + } + set + { + OnListPriceChanging(value); + _ListPrice = value; + OnListPriceChanged(); + } + } + private global::System.Decimal _ListPrice; + partial void OnListPriceChanging(global::System.Decimal value); + partial void OnListPriceChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductModel + { + #region Factory Method + + /// + /// Create a new ProductModel object. + /// + /// Initial value of the ProductModelID property. + /// Initial value of the Name property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static ProductModel CreateProductModel(global::System.Int32 productModelID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + ProductModel productModel = new ProductModel(); + productModel.ProductModelID = productModelID; + productModel.Name = name; + productModel.rowguid = rowguid; + productModel.ModifiedDate = modifiedDate; + return productModel; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductModelID + { + get + { + return _ProductModelID; + } + set + { + if (_ProductModelID != value) + { + OnProductModelIDChanging(value); + _ProductModelID = value; + OnProductModelIDChanged(); + } + } + } + private global::System.Int32 _ProductModelID; + partial void OnProductModelIDChanging(global::System.Int32 value); + partial void OnProductModelIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CatalogDescription + { + get + { + return _CatalogDescription; + } + set + { + OnCatalogDescriptionChanging(value); + _CatalogDescription = value; + OnCatalogDescriptionChanged(); + } + } + private global::System.String _CatalogDescription; + partial void OnCatalogDescriptionChanging(global::System.String value); + partial void OnCatalogDescriptionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Instructions + { + get + { + return _Instructions; + } + set + { + OnInstructionsChanging(value); + _Instructions = value; + OnInstructionsChanged(); + } + } + private global::System.String _Instructions; + partial void OnInstructionsChanging(global::System.String value); + partial void OnInstructionsChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Products + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductModelIllustrations + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModelIllustration"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModelIllustration", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductModelProductDescriptionCultures + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModelProductDescriptionCulture"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModelProductDescriptionCulture", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductModelIllustration + { + #region Factory Method + + /// + /// Create a new ProductModelIllustration object. + /// + /// Initial value of the ProductModelID property. + /// Initial value of the IllustrationID property. + /// Initial value of the ModifiedDate property. + public static ProductModelIllustration CreateProductModelIllustration(global::System.Int32 productModelID, global::System.Int32 illustrationID, global::System.DateTime modifiedDate) + { + ProductModelIllustration productModelIllustration = new ProductModelIllustration(); + productModelIllustration.ProductModelID = productModelID; + productModelIllustration.IllustrationID = illustrationID; + productModelIllustration.ModifiedDate = modifiedDate; + return productModelIllustration; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductModelID + { + get + { + return _ProductModelID; + } + set + { + if (_ProductModelID != value) + { + OnProductModelIDChanging(value); + _ProductModelID = value; + OnProductModelIDChanged(); + } + } + } + private global::System.Int32 _ProductModelID; + partial void OnProductModelIDChanging(global::System.Int32 value); + partial void OnProductModelIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 IllustrationID + { + get + { + return _IllustrationID; + } + set + { + if (_IllustrationID != value) + { + OnIllustrationIDChanging(value); + _IllustrationID = value; + OnIllustrationIDChanged(); + } + } + } + private global::System.Int32 _IllustrationID; + partial void OnIllustrationIDChanging(global::System.Int32 value); + partial void OnIllustrationIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Illustration Illustration + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference IllustrationReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ProductModel ProductModel + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductModelReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductModelProductDescriptionCulture + { + #region Factory Method + + /// + /// Create a new ProductModelProductDescriptionCulture object. + /// + /// Initial value of the ProductModelID property. + /// Initial value of the ProductDescriptionID property. + /// Initial value of the CultureID property. + /// Initial value of the ModifiedDate property. + public static ProductModelProductDescriptionCulture CreateProductModelProductDescriptionCulture(global::System.Int32 productModelID, global::System.Int32 productDescriptionID, global::System.String cultureID, global::System.DateTime modifiedDate) + { + ProductModelProductDescriptionCulture productModelProductDescriptionCulture = new ProductModelProductDescriptionCulture(); + productModelProductDescriptionCulture.ProductModelID = productModelID; + productModelProductDescriptionCulture.ProductDescriptionID = productDescriptionID; + productModelProductDescriptionCulture.CultureID = cultureID; + productModelProductDescriptionCulture.ModifiedDate = modifiedDate; + return productModelProductDescriptionCulture; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductModelID + { + get + { + return _ProductModelID; + } + set + { + if (_ProductModelID != value) + { + OnProductModelIDChanging(value); + _ProductModelID = value; + OnProductModelIDChanged(); + } + } + } + private global::System.Int32 _ProductModelID; + partial void OnProductModelIDChanging(global::System.Int32 value); + partial void OnProductModelIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductDescriptionID + { + get + { + return _ProductDescriptionID; + } + set + { + if (_ProductDescriptionID != value) + { + OnProductDescriptionIDChanging(value); + _ProductDescriptionID = value; + OnProductDescriptionIDChanged(); + } + } + } + private global::System.Int32 _ProductDescriptionID; + partial void OnProductDescriptionIDChanging(global::System.Int32 value); + partial void OnProductDescriptionIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CultureID + { + get + { + return _CultureID; + } + set + { + if (_CultureID != value) + { + OnCultureIDChanging(value); + _CultureID = value; + OnCultureIDChanged(); + } + } + } + private global::System.String _CultureID; + partial void OnCultureIDChanging(global::System.String value); + partial void OnCultureIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Culture Culture + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CultureReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ProductDescription ProductDescription + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductDescriptionReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ProductModel ProductModel + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductModelReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductPhoto + { + #region Factory Method + + /// + /// Create a new ProductPhoto object. + /// + /// Initial value of the ProductPhotoID property. + /// Initial value of the ModifiedDate property. + public static ProductPhoto CreateProductPhoto(global::System.Int32 productPhotoID, global::System.DateTime modifiedDate) + { + ProductPhoto productPhoto = new ProductPhoto(); + productPhoto.ProductPhotoID = productPhotoID; + productPhoto.ModifiedDate = modifiedDate; + return productPhoto; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductPhotoID + { + get + { + return _ProductPhotoID; + } + set + { + if (_ProductPhotoID != value) + { + OnProductPhotoIDChanging(value); + _ProductPhotoID = value; + OnProductPhotoIDChanged(); + } + } + } + private global::System.Int32 _ProductPhotoID; + partial void OnProductPhotoIDChanging(global::System.Int32 value); + partial void OnProductPhotoIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte[] ThumbNailPhoto + { + get + { + return value; + } + set + { + OnThumbNailPhotoChanging(value); + _ThumbNailPhoto = value; + OnThumbNailPhotoChanged(); + } + } + private global::System.Byte[] _ThumbNailPhoto; + partial void OnThumbNailPhotoChanging(global::System.Byte[] value); + partial void OnThumbNailPhotoChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ThumbnailPhotoFileName + { + get + { + return _ThumbnailPhotoFileName; + } + set + { + OnThumbnailPhotoFileNameChanging(value); + _ThumbnailPhotoFileName = value; + OnThumbnailPhotoFileNameChanged(); + } + } + private global::System.String _ThumbnailPhotoFileName; + partial void OnThumbnailPhotoFileNameChanging(global::System.String value); + partial void OnThumbnailPhotoFileNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte[] LargePhoto + { + get + { + return value; + } + set + { + OnLargePhotoChanging(value); + _LargePhoto = value; + OnLargePhotoChanged(); + } + } + private global::System.Byte[] _LargePhoto; + partial void OnLargePhotoChanging(global::System.Byte[] value); + partial void OnLargePhotoChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String LargePhotoFileName + { + get + { + return _LargePhotoFileName; + } + set + { + OnLargePhotoFileNameChanging(value); + _LargePhotoFileName = value; + OnLargePhotoFileNameChanged(); + } + } + private global::System.String _LargePhotoFileName; + partial void OnLargePhotoFileNameChanging(global::System.String value); + partial void OnLargePhotoFileNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductProductPhotoes + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductProductPhoto"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductProductPhoto", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductProductPhoto + { + #region Factory Method + + /// + /// Create a new ProductProductPhoto object. + /// + /// Initial value of the ProductID property. + /// Initial value of the ProductPhotoID property. + /// Initial value of the Primary property. + /// Initial value of the ModifiedDate property. + public static ProductProductPhoto CreateProductProductPhoto(global::System.Int32 productID, global::System.Int32 productPhotoID, global::System.Boolean primary, global::System.DateTime modifiedDate) + { + ProductProductPhoto productProductPhoto = new ProductProductPhoto(); + productProductPhoto.ProductID = productID; + productProductPhoto.ProductPhotoID = productPhotoID; + productProductPhoto.Primary = primary; + productProductPhoto.ModifiedDate = modifiedDate; + return productProductPhoto; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductPhotoID + { + get + { + return _ProductPhotoID; + } + set + { + if (_ProductPhotoID != value) + { + OnProductPhotoIDChanging(value); + _ProductPhotoID = value; + OnProductPhotoIDChanged(); + } + } + } + private global::System.Int32 _ProductPhotoID; + partial void OnProductPhotoIDChanging(global::System.Int32 value); + partial void OnProductPhotoIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean Primary + { + get + { + return _Primary; + } + set + { + OnPrimaryChanging(value); + _Primary = value; + OnPrimaryChanged(); + } + } + private global::System.Boolean _Primary; + partial void OnPrimaryChanging(global::System.Boolean value); + partial void OnPrimaryChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ProductPhoto ProductPhoto + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductPhotoReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductReview + { + #region Factory Method + + /// + /// Create a new ProductReview object. + /// + /// Initial value of the ProductReviewID property. + /// Initial value of the ProductID property. + /// Initial value of the ReviewerName property. + /// Initial value of the ReviewDate property. + /// Initial value of the EmailAddress property. + /// Initial value of the Rating property. + /// Initial value of the ModifiedDate property. + public static ProductReview CreateProductReview(global::System.Int32 productReviewID, global::System.Int32 productID, global::System.String reviewerName, global::System.DateTime reviewDate, global::System.String emailAddress, global::System.Int32 rating, global::System.DateTime modifiedDate) + { + ProductReview productReview = new ProductReview(); + productReview.ProductReviewID = productReviewID; + productReview.ProductID = productID; + productReview.ReviewerName = reviewerName; + productReview.ReviewDate = reviewDate; + productReview.EmailAddress = emailAddress; + productReview.Rating = rating; + productReview.ModifiedDate = modifiedDate; + return productReview; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductReviewID + { + get + { + return _ProductReviewID; + } + set + { + if (_ProductReviewID != value) + { + OnProductReviewIDChanging(value); + _ProductReviewID = value; + OnProductReviewIDChanged(); + } + } + } + private global::System.Int32 _ProductReviewID; + partial void OnProductReviewIDChanging(global::System.Int32 value); + partial void OnProductReviewIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ReviewerName + { + get + { + return _ReviewerName; + } + set + { + OnReviewerNameChanging(value); + _ReviewerName = value; + OnReviewerNameChanged(); + } + } + private global::System.String _ReviewerName; + partial void OnReviewerNameChanging(global::System.String value); + partial void OnReviewerNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ReviewDate + { + get + { + return _ReviewDate; + } + set + { + OnReviewDateChanging(value); + _ReviewDate = value; + OnReviewDateChanged(); + } + } + private global::System.DateTime _ReviewDate; + partial void OnReviewDateChanging(global::System.DateTime value); + partial void OnReviewDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String EmailAddress + { + get + { + return _EmailAddress; + } + set + { + OnEmailAddressChanging(value); + _EmailAddress = value; + OnEmailAddressChanged(); + } + } + private global::System.String _EmailAddress; + partial void OnEmailAddressChanging(global::System.String value); + partial void OnEmailAddressChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 Rating + { + get + { + return _Rating; + } + set + { + OnRatingChanging(value); + _Rating = value; + OnRatingChanged(); + } + } + private global::System.Int32 _Rating; + partial void OnRatingChanging(global::System.Int32 value); + partial void OnRatingChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Comments + { + get + { + return _Comments; + } + set + { + OnCommentsChanging(value); + _Comments = value; + OnCommentsChanged(); + } + } + private global::System.String _Comments; + partial void OnCommentsChanging(global::System.String value); + partial void OnCommentsChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductSubcategory + { + #region Factory Method + + /// + /// Create a new ProductSubcategory object. + /// + /// Initial value of the ProductSubcategoryID property. + /// Initial value of the ProductCategoryID property. + /// Initial value of the Name property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static ProductSubcategory CreateProductSubcategory(global::System.Int32 productSubcategoryID, global::System.Int32 productCategoryID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + ProductSubcategory productSubcategory = new ProductSubcategory(); + productSubcategory.ProductSubcategoryID = productSubcategoryID; + productSubcategory.ProductCategoryID = productCategoryID; + productSubcategory.Name = name; + productSubcategory.rowguid = rowguid; + productSubcategory.ModifiedDate = modifiedDate; + return productSubcategory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductSubcategoryID + { + get + { + return _ProductSubcategoryID; + } + set + { + if (_ProductSubcategoryID != value) + { + OnProductSubcategoryIDChanging(value); + _ProductSubcategoryID = value; + OnProductSubcategoryIDChanged(); + } + } + } + private global::System.Int32 _ProductSubcategoryID; + partial void OnProductSubcategoryIDChanging(global::System.Int32 value); + partial void OnProductSubcategoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductCategoryID + { + get + { + return _ProductCategoryID; + } + set + { + OnProductCategoryIDChanging(value); + _ProductCategoryID = value; + OnProductCategoryIDChanged(); + } + } + private global::System.Int32 _ProductCategoryID; + partial void OnProductCategoryIDChanging(global::System.Int32 value); + partial void OnProductCategoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Products + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ProductCategory ProductCategory + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductCategoryReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ProductVendor + { + #region Factory Method + + /// + /// Create a new ProductVendor object. + /// + /// Initial value of the ProductID property. + /// Initial value of the VendorID property. + /// Initial value of the AverageLeadTime property. + /// Initial value of the StandardPrice property. + /// Initial value of the MinOrderQty property. + /// Initial value of the MaxOrderQty property. + /// Initial value of the UnitMeasureCode property. + /// Initial value of the ModifiedDate property. + public static ProductVendor CreateProductVendor(global::System.Int32 productID, global::System.Int32 vendorID, global::System.Int32 averageLeadTime, global::System.Decimal standardPrice, global::System.Int32 minOrderQty, global::System.Int32 maxOrderQty, global::System.String unitMeasureCode, global::System.DateTime modifiedDate) + { + ProductVendor productVendor = new ProductVendor(); + productVendor.ProductID = productID; + productVendor.VendorID = vendorID; + productVendor.AverageLeadTime = averageLeadTime; + productVendor.StandardPrice = standardPrice; + productVendor.MinOrderQty = minOrderQty; + productVendor.MaxOrderQty = maxOrderQty; + productVendor.UnitMeasureCode = unitMeasureCode; + productVendor.ModifiedDate = modifiedDate; + return productVendor; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 VendorID + { + get + { + return _VendorID; + } + set + { + if (_VendorID != value) + { + OnVendorIDChanging(value); + _VendorID = value; + OnVendorIDChanged(); + } + } + } + private global::System.Int32 _VendorID; + partial void OnVendorIDChanging(global::System.Int32 value); + partial void OnVendorIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AverageLeadTime + { + get + { + return _AverageLeadTime; + } + set + { + OnAverageLeadTimeChanging(value); + _AverageLeadTime = value; + OnAverageLeadTimeChanged(); + } + } + private global::System.Int32 _AverageLeadTime; + partial void OnAverageLeadTimeChanging(global::System.Int32 value); + partial void OnAverageLeadTimeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal StandardPrice + { + get + { + return _StandardPrice; + } + set + { + OnStandardPriceChanging(value); + _StandardPrice = value; + OnStandardPriceChanged(); + } + } + private global::System.Decimal _StandardPrice; + partial void OnStandardPriceChanging(global::System.Decimal value); + partial void OnStandardPriceChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable LastReceiptCost + { + get + { + return _LastReceiptCost; + } + set + { + OnLastReceiptCostChanging(value); + _LastReceiptCost = value; + OnLastReceiptCostChanged(); + } + } + private Nullable _LastReceiptCost; + partial void OnLastReceiptCostChanging(Nullable value); + partial void OnLastReceiptCostChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable LastReceiptDate + { + get + { + return _LastReceiptDate; + } + set + { + OnLastReceiptDateChanging(value); + _LastReceiptDate = value; + OnLastReceiptDateChanged(); + } + } + private Nullable _LastReceiptDate; + partial void OnLastReceiptDateChanging(Nullable value); + partial void OnLastReceiptDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 MinOrderQty + { + get + { + return _MinOrderQty; + } + set + { + OnMinOrderQtyChanging(value); + _MinOrderQty = value; + OnMinOrderQtyChanged(); + } + } + private global::System.Int32 _MinOrderQty; + partial void OnMinOrderQtyChanging(global::System.Int32 value); + partial void OnMinOrderQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 MaxOrderQty + { + get + { + return _MaxOrderQty; + } + set + { + OnMaxOrderQtyChanging(value); + _MaxOrderQty = value; + OnMaxOrderQtyChanged(); + } + } + private global::System.Int32 _MaxOrderQty; + partial void OnMaxOrderQtyChanging(global::System.Int32 value); + partial void OnMaxOrderQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable OnOrderQty + { + get + { + return _OnOrderQty; + } + set + { + OnOnOrderQtyChanging(value); + _OnOrderQty = value; + OnOnOrderQtyChanged(); + } + } + private Nullable _OnOrderQty; + partial void OnOnOrderQtyChanging(Nullable value); + partial void OnOnOrderQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String UnitMeasureCode + { + get + { + return _UnitMeasureCode; + } + set + { + OnUnitMeasureCodeChanging(value); + _UnitMeasureCode = value; + OnUnitMeasureCodeChanged(); + } + } + private global::System.String _UnitMeasureCode; + partial void OnUnitMeasureCodeChanging(global::System.String value); + partial void OnUnitMeasureCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public UnitMeasure UnitMeasure + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference UnitMeasureReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Vendor Vendor + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference VendorReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class PurchaseOrder + { + #region Factory Method + + /// + /// Create a new PurchaseOrder object. + /// + /// Initial value of the PurchaseOrderID property. + /// Initial value of the RevisionNumber property. + /// Initial value of the Status property. + /// Initial value of the EmployeeID property. + /// Initial value of the VendorID property. + /// Initial value of the ShipMethodID property. + /// Initial value of the OrderDate property. + /// Initial value of the SubTotal property. + /// Initial value of the TaxAmt property. + /// Initial value of the Freight property. + /// Initial value of the TotalDue property. + /// Initial value of the ModifiedDate property. + public static PurchaseOrder CreatePurchaseOrder(global::System.Int32 purchaseOrderID, global::System.Byte revisionNumber, global::System.Byte status, global::System.Int32 employeeID, global::System.Int32 vendorID, global::System.Int32 shipMethodID, global::System.DateTime orderDate, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.DateTime modifiedDate) + { + PurchaseOrder purchaseOrder = new PurchaseOrder(); + purchaseOrder.PurchaseOrderID = purchaseOrderID; + purchaseOrder.RevisionNumber = revisionNumber; + purchaseOrder.Status = status; + purchaseOrder.EmployeeID = employeeID; + purchaseOrder.VendorID = vendorID; + purchaseOrder.ShipMethodID = shipMethodID; + purchaseOrder.OrderDate = orderDate; + purchaseOrder.SubTotal = subTotal; + purchaseOrder.TaxAmt = taxAmt; + purchaseOrder.Freight = freight; + purchaseOrder.TotalDue = totalDue; + purchaseOrder.ModifiedDate = modifiedDate; + return purchaseOrder; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 PurchaseOrderID + { + get + { + return _PurchaseOrderID; + } + set + { + if (_PurchaseOrderID != value) + { + OnPurchaseOrderIDChanging(value); + _PurchaseOrderID = value; + OnPurchaseOrderIDChanged(); + } + } + } + private global::System.Int32 _PurchaseOrderID; + partial void OnPurchaseOrderIDChanging(global::System.Int32 value); + partial void OnPurchaseOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte RevisionNumber + { + get + { + return _RevisionNumber; + } + set + { + OnRevisionNumberChanging(value); + _RevisionNumber = value; + OnRevisionNumberChanged(); + } + } + private global::System.Byte _RevisionNumber; + partial void OnRevisionNumberChanging(global::System.Byte value); + partial void OnRevisionNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte Status + { + get + { + return _Status; + } + set + { + OnStatusChanging(value); + _Status = value; + OnStatusChanged(); + } + } + private global::System.Byte _Status; + partial void OnStatusChanging(global::System.Byte value); + partial void OnStatusChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 EmployeeID + { + get + { + return _EmployeeID; + } + set + { + OnEmployeeIDChanging(value); + _EmployeeID = value; + OnEmployeeIDChanged(); + } + } + private global::System.Int32 _EmployeeID; + partial void OnEmployeeIDChanging(global::System.Int32 value); + partial void OnEmployeeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 VendorID + { + get + { + return _VendorID; + } + set + { + OnVendorIDChanging(value); + _VendorID = value; + OnVendorIDChanged(); + } + } + private global::System.Int32 _VendorID; + partial void OnVendorIDChanging(global::System.Int32 value); + partial void OnVendorIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ShipMethodID + { + get + { + return _ShipMethodID; + } + set + { + OnShipMethodIDChanging(value); + _ShipMethodID = value; + OnShipMethodIDChanged(); + } + } + private global::System.Int32 _ShipMethodID; + partial void OnShipMethodIDChanging(global::System.Int32 value); + partial void OnShipMethodIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime OrderDate + { + get + { + return _OrderDate; + } + set + { + OnOrderDateChanging(value); + _OrderDate = value; + OnOrderDateChanged(); + } + } + private global::System.DateTime _OrderDate; + partial void OnOrderDateChanging(global::System.DateTime value); + partial void OnOrderDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ShipDate + { + get + { + return _ShipDate; + } + set + { + OnShipDateChanging(value); + _ShipDate = value; + OnShipDateChanged(); + } + } + private Nullable _ShipDate; + partial void OnShipDateChanging(Nullable value); + partial void OnShipDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal SubTotal + { + get + { + return _SubTotal; + } + set + { + OnSubTotalChanging(value); + _SubTotal = value; + OnSubTotalChanged(); + } + } + private global::System.Decimal _SubTotal; + partial void OnSubTotalChanging(global::System.Decimal value); + partial void OnSubTotalChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal TaxAmt + { + get + { + return _TaxAmt; + } + set + { + OnTaxAmtChanging(value); + _TaxAmt = value; + OnTaxAmtChanged(); + } + } + private global::System.Decimal _TaxAmt; + partial void OnTaxAmtChanging(global::System.Decimal value); + partial void OnTaxAmtChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal Freight + { + get + { + return _Freight; + } + set + { + OnFreightChanging(value); + _Freight = value; + OnFreightChanged(); + } + } + private global::System.Decimal _Freight; + partial void OnFreightChanging(global::System.Decimal value); + partial void OnFreightChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal TotalDue + { + get + { + return _TotalDue; + } + set + { + OnTotalDueChanging(value); + _TotalDue = value; + OnTotalDueChanged(); + } + } + private global::System.Decimal _TotalDue; + partial void OnTotalDueChanging(global::System.Decimal value); + partial void OnTotalDueChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Employee Employee + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference EmployeeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection PurchaseOrderDetails + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderDetail"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderDetail", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ShipMethod ShipMethod + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ShipMethodReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Vendor Vendor + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference VendorReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class PurchaseOrderDetail + { + #region Factory Method + + /// + /// Create a new PurchaseOrderDetail object. + /// + /// Initial value of the PurchaseOrderID property. + /// Initial value of the PurchaseOrderDetailID property. + /// Initial value of the DueDate property. + /// Initial value of the OrderQty property. + /// Initial value of the ProductID property. + /// Initial value of the UnitPrice property. + /// Initial value of the LineTotal property. + /// Initial value of the ReceivedQty property. + /// Initial value of the RejectedQty property. + /// Initial value of the StockedQty property. + /// Initial value of the ModifiedDate property. + public static PurchaseOrderDetail CreatePurchaseOrderDetail(global::System.Int32 purchaseOrderID, global::System.Int32 purchaseOrderDetailID, global::System.DateTime dueDate, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Decimal unitPrice, global::System.Decimal lineTotal, global::System.Decimal receivedQty, global::System.Decimal rejectedQty, global::System.Decimal stockedQty, global::System.DateTime modifiedDate) + { + PurchaseOrderDetail purchaseOrderDetail = new PurchaseOrderDetail(); + purchaseOrderDetail.PurchaseOrderID = purchaseOrderID; + purchaseOrderDetail.PurchaseOrderDetailID = purchaseOrderDetailID; + purchaseOrderDetail.DueDate = dueDate; + purchaseOrderDetail.OrderQty = orderQty; + purchaseOrderDetail.ProductID = productID; + purchaseOrderDetail.UnitPrice = unitPrice; + purchaseOrderDetail.LineTotal = lineTotal; + purchaseOrderDetail.ReceivedQty = receivedQty; + purchaseOrderDetail.RejectedQty = rejectedQty; + purchaseOrderDetail.StockedQty = stockedQty; + purchaseOrderDetail.ModifiedDate = modifiedDate; + return purchaseOrderDetail; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 PurchaseOrderID + { + get + { + return _PurchaseOrderID; + } + set + { + if (_PurchaseOrderID != value) + { + OnPurchaseOrderIDChanging(value); + _PurchaseOrderID = value; + OnPurchaseOrderIDChanged(); + } + } + } + private global::System.Int32 _PurchaseOrderID; + partial void OnPurchaseOrderIDChanging(global::System.Int32 value); + partial void OnPurchaseOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 PurchaseOrderDetailID + { + get + { + return _PurchaseOrderDetailID; + } + set + { + if (_PurchaseOrderDetailID != value) + { + OnPurchaseOrderDetailIDChanging(value); + _PurchaseOrderDetailID = value; + OnPurchaseOrderDetailIDChanged(); + } + } + } + private global::System.Int32 _PurchaseOrderDetailID; + partial void OnPurchaseOrderDetailIDChanging(global::System.Int32 value); + partial void OnPurchaseOrderDetailIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime DueDate + { + get + { + return _DueDate; + } + set + { + OnDueDateChanging(value); + _DueDate = value; + OnDueDateChanged(); + } + } + private global::System.DateTime _DueDate; + partial void OnDueDateChanging(global::System.DateTime value); + partial void OnDueDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 OrderQty + { + get + { + return _OrderQty; + } + set + { + OnOrderQtyChanging(value); + _OrderQty = value; + OnOrderQtyChanged(); + } + } + private global::System.Int16 _OrderQty; + partial void OnOrderQtyChanging(global::System.Int16 value); + partial void OnOrderQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal UnitPrice + { + get + { + return _UnitPrice; + } + set + { + OnUnitPriceChanging(value); + _UnitPrice = value; + OnUnitPriceChanged(); + } + } + private global::System.Decimal _UnitPrice; + partial void OnUnitPriceChanging(global::System.Decimal value); + partial void OnUnitPriceChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal LineTotal + { + get + { + return _LineTotal; + } + set + { + OnLineTotalChanging(value); + _LineTotal = value; + OnLineTotalChanged(); + } + } + private global::System.Decimal _LineTotal; + partial void OnLineTotalChanging(global::System.Decimal value); + partial void OnLineTotalChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal ReceivedQty + { + get + { + return _ReceivedQty; + } + set + { + OnReceivedQtyChanging(value); + _ReceivedQty = value; + OnReceivedQtyChanged(); + } + } + private global::System.Decimal _ReceivedQty; + partial void OnReceivedQtyChanging(global::System.Decimal value); + partial void OnReceivedQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal RejectedQty + { + get + { + return _RejectedQty; + } + set + { + OnRejectedQtyChanging(value); + _RejectedQty = value; + OnRejectedQtyChanged(); + } + } + private global::System.Decimal _RejectedQty; + partial void OnRejectedQtyChanging(global::System.Decimal value); + partial void OnRejectedQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal StockedQty + { + get + { + return _StockedQty; + } + set + { + OnStockedQtyChanging(value); + _StockedQty = value; + OnStockedQtyChanged(); + } + } + private global::System.Decimal _StockedQty; + partial void OnStockedQtyChanging(global::System.Decimal value); + partial void OnStockedQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public PurchaseOrder PurchaseOrder + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference PurchaseOrderReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesOrderDetail + { + #region Factory Method + + /// + /// Create a new SalesOrderDetail object. + /// + /// Initial value of the SalesOrderID property. + /// Initial value of the SalesOrderDetailID property. + /// Initial value of the OrderQty property. + /// Initial value of the ProductID property. + /// Initial value of the SpecialOfferID property. + /// Initial value of the UnitPrice property. + /// Initial value of the UnitPriceDiscount property. + /// Initial value of the LineTotal property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 salesOrderID, global::System.Int32 salesOrderDetailID, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Int32 specialOfferID, global::System.Decimal unitPrice, global::System.Decimal unitPriceDiscount, global::System.Decimal lineTotal, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SalesOrderDetail salesOrderDetail = new SalesOrderDetail(); + salesOrderDetail.SalesOrderID = salesOrderID; + salesOrderDetail.SalesOrderDetailID = salesOrderDetailID; + salesOrderDetail.OrderQty = orderQty; + salesOrderDetail.ProductID = productID; + salesOrderDetail.SpecialOfferID = specialOfferID; + salesOrderDetail.UnitPrice = unitPrice; + salesOrderDetail.UnitPriceDiscount = unitPriceDiscount; + salesOrderDetail.LineTotal = lineTotal; + salesOrderDetail.rowguid = rowguid; + salesOrderDetail.ModifiedDate = modifiedDate; + return salesOrderDetail; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesOrderID + { + get + { + return _SalesOrderID; + } + set + { + if (_SalesOrderID != value) + { + OnSalesOrderIDChanging(value); + _SalesOrderID = value; + OnSalesOrderIDChanged(); + } + } + } + private global::System.Int32 _SalesOrderID; + partial void OnSalesOrderIDChanging(global::System.Int32 value); + partial void OnSalesOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesOrderDetailID + { + get + { + return _SalesOrderDetailID; + } + set + { + if (_SalesOrderDetailID != value) + { + OnSalesOrderDetailIDChanging(value); + _SalesOrderDetailID = value; + OnSalesOrderDetailIDChanged(); + } + } + } + private global::System.Int32 _SalesOrderDetailID; + partial void OnSalesOrderDetailIDChanging(global::System.Int32 value); + partial void OnSalesOrderDetailIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CarrierTrackingNumber + { + get + { + return _CarrierTrackingNumber; + } + set + { + OnCarrierTrackingNumberChanging(value); + _CarrierTrackingNumber = value; + OnCarrierTrackingNumberChanged(); + } + } + private global::System.String _CarrierTrackingNumber; + partial void OnCarrierTrackingNumberChanging(global::System.String value); + partial void OnCarrierTrackingNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 OrderQty + { + get + { + return _OrderQty; + } + set + { + OnOrderQtyChanging(value); + _OrderQty = value; + OnOrderQtyChanged(); + } + } + private global::System.Int16 _OrderQty; + partial void OnOrderQtyChanging(global::System.Int16 value); + partial void OnOrderQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SpecialOfferID + { + get + { + return _SpecialOfferID; + } + set + { + OnSpecialOfferIDChanging(value); + _SpecialOfferID = value; + OnSpecialOfferIDChanged(); + } + } + private global::System.Int32 _SpecialOfferID; + partial void OnSpecialOfferIDChanging(global::System.Int32 value); + partial void OnSpecialOfferIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal UnitPrice + { + get + { + return _UnitPrice; + } + set + { + OnUnitPriceChanging(value); + _UnitPrice = value; + OnUnitPriceChanged(); + } + } + private global::System.Decimal _UnitPrice; + partial void OnUnitPriceChanging(global::System.Decimal value); + partial void OnUnitPriceChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal UnitPriceDiscount + { + get + { + return _UnitPriceDiscount; + } + set + { + OnUnitPriceDiscountChanging(value); + _UnitPriceDiscount = value; + OnUnitPriceDiscountChanged(); + } + } + private global::System.Decimal _UnitPriceDiscount; + partial void OnUnitPriceDiscountChanging(global::System.Decimal value); + partial void OnUnitPriceDiscountChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal LineTotal + { + get + { + return _LineTotal; + } + set + { + OnLineTotalChanging(value); + _LineTotal = value; + OnLineTotalChanged(); + } + } + private global::System.Decimal _LineTotal; + partial void OnLineTotalChanging(global::System.Decimal value); + partial void OnLineTotalChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesOrderHeader SalesOrderHeader + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesOrderHeaderReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SpecialOfferProduct SpecialOfferProduct + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SpecialOfferProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesOrderHeader + { + #region Factory Method + + /// + /// Create a new SalesOrderHeader object. + /// + /// Initial value of the SalesOrderID property. + /// Initial value of the RevisionNumber property. + /// Initial value of the OrderDate property. + /// Initial value of the DueDate property. + /// Initial value of the Status property. + /// Initial value of the OnlineOrderFlag property. + /// Initial value of the SalesOrderNumber property. + /// Initial value of the CustomerID property. + /// Initial value of the ContactID property. + /// Initial value of the BillToAddressID property. + /// Initial value of the ShipToAddressID property. + /// Initial value of the ShipMethodID property. + /// Initial value of the SubTotal property. + /// Initial value of the TaxAmt property. + /// Initial value of the Freight property. + /// Initial value of the TotalDue property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 salesOrderID, global::System.Byte revisionNumber, global::System.DateTime orderDate, global::System.DateTime dueDate, global::System.Byte status, global::System.Boolean onlineOrderFlag, global::System.String salesOrderNumber, global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 billToAddressID, global::System.Int32 shipToAddressID, global::System.Int32 shipMethodID, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SalesOrderHeader salesOrderHeader = new SalesOrderHeader(); + salesOrderHeader.SalesOrderID = salesOrderID; + salesOrderHeader.RevisionNumber = revisionNumber; + salesOrderHeader.OrderDate = orderDate; + salesOrderHeader.DueDate = dueDate; + salesOrderHeader.Status = status; + salesOrderHeader.OnlineOrderFlag = onlineOrderFlag; + salesOrderHeader.SalesOrderNumber = salesOrderNumber; + salesOrderHeader.CustomerID = customerID; + salesOrderHeader.ContactID = contactID; + salesOrderHeader.BillToAddressID = billToAddressID; + salesOrderHeader.ShipToAddressID = shipToAddressID; + salesOrderHeader.ShipMethodID = shipMethodID; + salesOrderHeader.SubTotal = subTotal; + salesOrderHeader.TaxAmt = taxAmt; + salesOrderHeader.Freight = freight; + salesOrderHeader.TotalDue = totalDue; + salesOrderHeader.rowguid = rowguid; + salesOrderHeader.ModifiedDate = modifiedDate; + return salesOrderHeader; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesOrderID + { + get + { + return _SalesOrderID; + } + set + { + if (_SalesOrderID != value) + { + OnSalesOrderIDChanging(value); + _SalesOrderID = value; + OnSalesOrderIDChanged(); + } + } + } + private global::System.Int32 _SalesOrderID; + partial void OnSalesOrderIDChanging(global::System.Int32 value); + partial void OnSalesOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte RevisionNumber + { + get + { + return _RevisionNumber; + } + set + { + OnRevisionNumberChanging(value); + _RevisionNumber = value; + OnRevisionNumberChanged(); + } + } + private global::System.Byte _RevisionNumber; + partial void OnRevisionNumberChanging(global::System.Byte value); + partial void OnRevisionNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime OrderDate + { + get + { + return _OrderDate; + } + set + { + OnOrderDateChanging(value); + _OrderDate = value; + OnOrderDateChanged(); + } + } + private global::System.DateTime _OrderDate; + partial void OnOrderDateChanging(global::System.DateTime value); + partial void OnOrderDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime DueDate + { + get + { + return _DueDate; + } + set + { + OnDueDateChanging(value); + _DueDate = value; + OnDueDateChanged(); + } + } + private global::System.DateTime _DueDate; + partial void OnDueDateChanging(global::System.DateTime value); + partial void OnDueDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ShipDate + { + get + { + return _ShipDate; + } + set + { + OnShipDateChanging(value); + _ShipDate = value; + OnShipDateChanged(); + } + } + private Nullable _ShipDate; + partial void OnShipDateChanging(Nullable value); + partial void OnShipDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte Status + { + get + { + return _Status; + } + set + { + OnStatusChanging(value); + _Status = value; + OnStatusChanged(); + } + } + private global::System.Byte _Status; + partial void OnStatusChanging(global::System.Byte value); + partial void OnStatusChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean OnlineOrderFlag + { + get + { + return _OnlineOrderFlag; + } + set + { + OnOnlineOrderFlagChanging(value); + _OnlineOrderFlag = value; + OnOnlineOrderFlagChanged(); + } + } + private global::System.Boolean _OnlineOrderFlag; + partial void OnOnlineOrderFlagChanging(global::System.Boolean value); + partial void OnOnlineOrderFlagChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String SalesOrderNumber + { + get + { + return _SalesOrderNumber; + } + set + { + OnSalesOrderNumberChanging(value); + _SalesOrderNumber = value; + OnSalesOrderNumberChanged(); + } + } + private global::System.String _SalesOrderNumber; + partial void OnSalesOrderNumberChanging(global::System.String value); + partial void OnSalesOrderNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String PurchaseOrderNumber + { + get + { + return _PurchaseOrderNumber; + } + set + { + OnPurchaseOrderNumberChanging(value); + _PurchaseOrderNumber = value; + OnPurchaseOrderNumberChanged(); + } + } + private global::System.String _PurchaseOrderNumber; + partial void OnPurchaseOrderNumberChanging(global::System.String value); + partial void OnPurchaseOrderNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String AccountNumber + { + get + { + return _AccountNumber; + } + set + { + OnAccountNumberChanging(value); + _AccountNumber = value; + OnAccountNumberChanged(); + } + } + private global::System.String _AccountNumber; + partial void OnAccountNumberChanging(global::System.String value); + partial void OnAccountNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CustomerID + { + get + { + return _CustomerID; + } + set + { + OnCustomerIDChanging(value); + _CustomerID = value; + OnCustomerIDChanged(); + } + } + private global::System.Int32 _CustomerID; + partial void OnCustomerIDChanging(global::System.Int32 value); + partial void OnCustomerIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactID + { + get + { + return _ContactID; + } + set + { + OnContactIDChanging(value); + _ContactID = value; + OnContactIDChanged(); + } + } + private global::System.Int32 _ContactID; + partial void OnContactIDChanging(global::System.Int32 value); + partial void OnContactIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable SalesPersonID + { + get + { + return _SalesPersonID; + } + set + { + OnSalesPersonIDChanging(value); + _SalesPersonID = value; + OnSalesPersonIDChanged(); + } + } + private Nullable _SalesPersonID; + partial void OnSalesPersonIDChanging(Nullable value); + partial void OnSalesPersonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable TerritoryID + { + get + { + return _TerritoryID; + } + set + { + OnTerritoryIDChanging(value); + _TerritoryID = value; + OnTerritoryIDChanged(); + } + } + private Nullable _TerritoryID; + partial void OnTerritoryIDChanging(Nullable value); + partial void OnTerritoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 BillToAddressID + { + get + { + return _BillToAddressID; + } + set + { + OnBillToAddressIDChanging(value); + _BillToAddressID = value; + OnBillToAddressIDChanged(); + } + } + private global::System.Int32 _BillToAddressID; + partial void OnBillToAddressIDChanging(global::System.Int32 value); + partial void OnBillToAddressIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ShipToAddressID + { + get + { + return _ShipToAddressID; + } + set + { + OnShipToAddressIDChanging(value); + _ShipToAddressID = value; + OnShipToAddressIDChanged(); + } + } + private global::System.Int32 _ShipToAddressID; + partial void OnShipToAddressIDChanging(global::System.Int32 value); + partial void OnShipToAddressIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ShipMethodID + { + get + { + return _ShipMethodID; + } + set + { + OnShipMethodIDChanging(value); + _ShipMethodID = value; + OnShipMethodIDChanged(); + } + } + private global::System.Int32 _ShipMethodID; + partial void OnShipMethodIDChanging(global::System.Int32 value); + partial void OnShipMethodIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable CreditCardID + { + get + { + return _CreditCardID; + } + set + { + OnCreditCardIDChanging(value); + _CreditCardID = value; + OnCreditCardIDChanged(); + } + } + private Nullable _CreditCardID; + partial void OnCreditCardIDChanging(Nullable value); + partial void OnCreditCardIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CreditCardApprovalCode + { + get + { + return _CreditCardApprovalCode; + } + set + { + OnCreditCardApprovalCodeChanging(value); + _CreditCardApprovalCode = value; + OnCreditCardApprovalCodeChanged(); + } + } + private global::System.String _CreditCardApprovalCode; + partial void OnCreditCardApprovalCodeChanging(global::System.String value); + partial void OnCreditCardApprovalCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable CurrencyRateID + { + get + { + return _CurrencyRateID; + } + set + { + OnCurrencyRateIDChanging(value); + _CurrencyRateID = value; + OnCurrencyRateIDChanged(); + } + } + private Nullable _CurrencyRateID; + partial void OnCurrencyRateIDChanging(Nullable value); + partial void OnCurrencyRateIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal SubTotal + { + get + { + return _SubTotal; + } + set + { + OnSubTotalChanging(value); + _SubTotal = value; + OnSubTotalChanged(); + } + } + private global::System.Decimal _SubTotal; + partial void OnSubTotalChanging(global::System.Decimal value); + partial void OnSubTotalChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal TaxAmt + { + get + { + return _TaxAmt; + } + set + { + OnTaxAmtChanging(value); + _TaxAmt = value; + OnTaxAmtChanged(); + } + } + private global::System.Decimal _TaxAmt; + partial void OnTaxAmtChanging(global::System.Decimal value); + partial void OnTaxAmtChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal Freight + { + get + { + return _Freight; + } + set + { + OnFreightChanging(value); + _Freight = value; + OnFreightChanged(); + } + } + private global::System.Decimal _Freight; + partial void OnFreightChanging(global::System.Decimal value); + partial void OnFreightChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal TotalDue + { + get + { + return _TotalDue; + } + set + { + OnTotalDueChanging(value); + _TotalDue = value; + OnTotalDueChanged(); + } + } + private global::System.Decimal _TotalDue; + partial void OnTotalDueChanging(global::System.Decimal value); + partial void OnTotalDueChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Comment + { + get + { + return _Comment; + } + set + { + OnCommentChanging(value); + _Comment = value; + OnCommentChanged(); + } + } + private global::System.String _Comment; + partial void OnCommentChanging(global::System.String value); + partial void OnCommentChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Address Address + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference
AddressReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Address Address1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference
Address1Reference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Contact Contact + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ShipMethod ShipMethod + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ShipMethodReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public CreditCard CreditCard + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CreditCardReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public CurrencyRate CurrencyRate + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CurrencyRateReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Customer Customer + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CustomerReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderDetails + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesPerson SalesPerson + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesPersonReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesTerritory SalesTerritory + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesTerritoryReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaderSalesReasons + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeaderSalesReason"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeaderSalesReason", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesOrderHeaderSalesReason + { + #region Factory Method + + /// + /// Create a new SalesOrderHeaderSalesReason object. + /// + /// Initial value of the SalesOrderID property. + /// Initial value of the SalesReasonID property. + /// Initial value of the ModifiedDate property. + public static SalesOrderHeaderSalesReason CreateSalesOrderHeaderSalesReason(global::System.Int32 salesOrderID, global::System.Int32 salesReasonID, global::System.DateTime modifiedDate) + { + SalesOrderHeaderSalesReason salesOrderHeaderSalesReason = new SalesOrderHeaderSalesReason(); + salesOrderHeaderSalesReason.SalesOrderID = salesOrderID; + salesOrderHeaderSalesReason.SalesReasonID = salesReasonID; + salesOrderHeaderSalesReason.ModifiedDate = modifiedDate; + return salesOrderHeaderSalesReason; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesOrderID + { + get + { + return _SalesOrderID; + } + set + { + if (_SalesOrderID != value) + { + OnSalesOrderIDChanging(value); + _SalesOrderID = value; + OnSalesOrderIDChanged(); + } + } + } + private global::System.Int32 _SalesOrderID; + partial void OnSalesOrderIDChanging(global::System.Int32 value); + partial void OnSalesOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesReasonID + { + get + { + return _SalesReasonID; + } + set + { + if (_SalesReasonID != value) + { + OnSalesReasonIDChanging(value); + _SalesReasonID = value; + OnSalesReasonIDChanged(); + } + } + } + private global::System.Int32 _SalesReasonID; + partial void OnSalesReasonIDChanging(global::System.Int32 value); + partial void OnSalesReasonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesOrderHeader SalesOrderHeader + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesOrderHeaderReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesReason SalesReason + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesReasonReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesPerson + { + #region Factory Method + + /// + /// Create a new SalesPerson object. + /// + /// Initial value of the SalesPersonID property. + /// Initial value of the Bonus property. + /// Initial value of the CommissionPct property. + /// Initial value of the SalesYTD property. + /// Initial value of the SalesLastYear property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SalesPerson CreateSalesPerson(global::System.Int32 salesPersonID, global::System.Decimal bonus, global::System.Decimal commissionPct, global::System.Decimal salesYTD, global::System.Decimal salesLastYear, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SalesPerson salesPerson = new SalesPerson(); + salesPerson.SalesPersonID = salesPersonID; + salesPerson.Bonus = bonus; + salesPerson.CommissionPct = commissionPct; + salesPerson.SalesYTD = salesYTD; + salesPerson.SalesLastYear = salesLastYear; + salesPerson.rowguid = rowguid; + salesPerson.ModifiedDate = modifiedDate; + return salesPerson; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesPersonID + { + get + { + return _SalesPersonID; + } + set + { + if (_SalesPersonID != value) + { + OnSalesPersonIDChanging(value); + _SalesPersonID = value; + OnSalesPersonIDChanged(); + } + } + } + private global::System.Int32 _SalesPersonID; + partial void OnSalesPersonIDChanging(global::System.Int32 value); + partial void OnSalesPersonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable TerritoryID + { + get + { + return _TerritoryID; + } + set + { + OnTerritoryIDChanging(value); + _TerritoryID = value; + OnTerritoryIDChanged(); + } + } + private Nullable _TerritoryID; + partial void OnTerritoryIDChanging(Nullable value); + partial void OnTerritoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable SalesQuota + { + get + { + return _SalesQuota; + } + set + { + OnSalesQuotaChanging(value); + _SalesQuota = value; + OnSalesQuotaChanged(); + } + } + private Nullable _SalesQuota; + partial void OnSalesQuotaChanging(Nullable value); + partial void OnSalesQuotaChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal Bonus + { + get + { + return _Bonus; + } + set + { + OnBonusChanging(value); + _Bonus = value; + OnBonusChanged(); + } + } + private global::System.Decimal _Bonus; + partial void OnBonusChanging(global::System.Decimal value); + partial void OnBonusChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal CommissionPct + { + get + { + return _CommissionPct; + } + set + { + OnCommissionPctChanging(value); + _CommissionPct = value; + OnCommissionPctChanged(); + } + } + private global::System.Decimal _CommissionPct; + partial void OnCommissionPctChanging(global::System.Decimal value); + partial void OnCommissionPctChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal SalesYTD + { + get + { + return _SalesYTD; + } + set + { + OnSalesYTDChanging(value); + _SalesYTD = value; + OnSalesYTDChanged(); + } + } + private global::System.Decimal _SalesYTD; + partial void OnSalesYTDChanging(global::System.Decimal value); + partial void OnSalesYTDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal SalesLastYear + { + get + { + return _SalesLastYear; + } + set + { + OnSalesLastYearChanging(value); + _SalesLastYear = value; + OnSalesLastYearChanged(); + } + } + private global::System.Decimal _SalesLastYear; + partial void OnSalesLastYearChanging(global::System.Decimal value); + partial void OnSalesLastYearChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Employee Employee + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference EmployeeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesTerritory SalesTerritory + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesTerritoryReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesPersonQuotaHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPersonQuotaHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPersonQuotaHistory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesTerritoryHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesTerritoryHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesTerritoryHistory", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Stores + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "Store"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "Store", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesPersonQuotaHistory + { + #region Factory Method + + /// + /// Create a new SalesPersonQuotaHistory object. + /// + /// Initial value of the SalesPersonID property. + /// Initial value of the QuotaDate property. + /// Initial value of the SalesQuota property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SalesPersonQuotaHistory CreateSalesPersonQuotaHistory(global::System.Int32 salesPersonID, global::System.DateTime quotaDate, global::System.Decimal salesQuota, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SalesPersonQuotaHistory salesPersonQuotaHistory = new SalesPersonQuotaHistory(); + salesPersonQuotaHistory.SalesPersonID = salesPersonID; + salesPersonQuotaHistory.QuotaDate = quotaDate; + salesPersonQuotaHistory.SalesQuota = salesQuota; + salesPersonQuotaHistory.rowguid = rowguid; + salesPersonQuotaHistory.ModifiedDate = modifiedDate; + return salesPersonQuotaHistory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesPersonID + { + get + { + return _SalesPersonID; + } + set + { + if (_SalesPersonID != value) + { + OnSalesPersonIDChanging(value); + _SalesPersonID = value; + OnSalesPersonIDChanged(); + } + } + } + private global::System.Int32 _SalesPersonID; + partial void OnSalesPersonIDChanging(global::System.Int32 value); + partial void OnSalesPersonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime QuotaDate + { + get + { + return _QuotaDate; + } + set + { + if (_QuotaDate != value) + { + OnQuotaDateChanging(value); + _QuotaDate = value; + OnQuotaDateChanged(); + } + } + } + private global::System.DateTime _QuotaDate; + partial void OnQuotaDateChanging(global::System.DateTime value); + partial void OnQuotaDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal SalesQuota + { + get + { + return _SalesQuota; + } + set + { + OnSalesQuotaChanging(value); + _SalesQuota = value; + OnSalesQuotaChanged(); + } + } + private global::System.Decimal _SalesQuota; + partial void OnSalesQuotaChanging(global::System.Decimal value); + partial void OnSalesQuotaChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesPerson SalesPerson + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesPersonReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesReason + { + #region Factory Method + + /// + /// Create a new SalesReason object. + /// + /// Initial value of the SalesReasonID property. + /// Initial value of the Name property. + /// Initial value of the ReasonType property. + /// Initial value of the ModifiedDate property. + public static SalesReason CreateSalesReason(global::System.Int32 salesReasonID, global::System.String name, global::System.String reasonType, global::System.DateTime modifiedDate) + { + SalesReason salesReason = new SalesReason(); + salesReason.SalesReasonID = salesReasonID; + salesReason.Name = name; + salesReason.ReasonType = reasonType; + salesReason.ModifiedDate = modifiedDate; + return salesReason; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesReasonID + { + get + { + return _SalesReasonID; + } + set + { + if (_SalesReasonID != value) + { + OnSalesReasonIDChanging(value); + _SalesReasonID = value; + OnSalesReasonIDChanged(); + } + } + } + private global::System.Int32 _SalesReasonID; + partial void OnSalesReasonIDChanging(global::System.Int32 value); + partial void OnSalesReasonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ReasonType + { + get + { + return _ReasonType; + } + set + { + OnReasonTypeChanging(value); + _ReasonType = value; + OnReasonTypeChanged(); + } + } + private global::System.String _ReasonType; + partial void OnReasonTypeChanging(global::System.String value); + partial void OnReasonTypeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaderSalesReasons + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesOrderHeaderSalesReason"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesOrderHeaderSalesReason", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesTaxRate + { + #region Factory Method + + /// + /// Create a new SalesTaxRate object. + /// + /// Initial value of the SalesTaxRateID property. + /// Initial value of the StateProvinceID property. + /// Initial value of the TaxType property. + /// Initial value of the TaxRate property. + /// Initial value of the Name property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SalesTaxRate CreateSalesTaxRate(global::System.Int32 salesTaxRateID, global::System.Int32 stateProvinceID, global::System.Byte taxType, global::System.Decimal taxRate, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SalesTaxRate salesTaxRate = new SalesTaxRate(); + salesTaxRate.SalesTaxRateID = salesTaxRateID; + salesTaxRate.StateProvinceID = stateProvinceID; + salesTaxRate.TaxType = taxType; + salesTaxRate.TaxRate = taxRate; + salesTaxRate.Name = name; + salesTaxRate.rowguid = rowguid; + salesTaxRate.ModifiedDate = modifiedDate; + return salesTaxRate; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesTaxRateID + { + get + { + return _SalesTaxRateID; + } + set + { + if (_SalesTaxRateID != value) + { + OnSalesTaxRateIDChanging(value); + _SalesTaxRateID = value; + OnSalesTaxRateIDChanged(); + } + } + } + private global::System.Int32 _SalesTaxRateID; + partial void OnSalesTaxRateIDChanging(global::System.Int32 value); + partial void OnSalesTaxRateIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 StateProvinceID + { + get + { + return _StateProvinceID; + } + set + { + OnStateProvinceIDChanging(value); + _StateProvinceID = value; + OnStateProvinceIDChanged(); + } + } + private global::System.Int32 _StateProvinceID; + partial void OnStateProvinceIDChanging(global::System.Int32 value); + partial void OnStateProvinceIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte TaxType + { + get + { + return _TaxType; + } + set + { + OnTaxTypeChanging(value); + _TaxType = value; + OnTaxTypeChanged(); + } + } + private global::System.Byte _TaxType; + partial void OnTaxTypeChanging(global::System.Byte value); + partial void OnTaxTypeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal TaxRate + { + get + { + return _TaxRate; + } + set + { + OnTaxRateChanging(value); + _TaxRate = value; + OnTaxRateChanged(); + } + } + private global::System.Decimal _TaxRate; + partial void OnTaxRateChanging(global::System.Decimal value); + partial void OnTaxRateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public StateProvince StateProvince + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference StateProvinceReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesTerritory + { + #region Factory Method + + /// + /// Create a new SalesTerritory object. + /// + /// Initial value of the TerritoryID property. + /// Initial value of the Name property. + /// Initial value of the CountryRegionCode property. + /// Initial value of the Group property. + /// Initial value of the SalesYTD property. + /// Initial value of the SalesLastYear property. + /// Initial value of the CostYTD property. + /// Initial value of the CostLastYear property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SalesTerritory CreateSalesTerritory(global::System.Int32 territoryID, global::System.String name, global::System.String countryRegionCode, global::System.String group, global::System.Decimal salesYTD, global::System.Decimal salesLastYear, global::System.Decimal costYTD, global::System.Decimal costLastYear, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SalesTerritory salesTerritory = new SalesTerritory(); + salesTerritory.TerritoryID = territoryID; + salesTerritory.Name = name; + salesTerritory.CountryRegionCode = countryRegionCode; + salesTerritory.Group = group; + salesTerritory.SalesYTD = salesYTD; + salesTerritory.SalesLastYear = salesLastYear; + salesTerritory.CostYTD = costYTD; + salesTerritory.CostLastYear = costLastYear; + salesTerritory.rowguid = rowguid; + salesTerritory.ModifiedDate = modifiedDate; + return salesTerritory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 TerritoryID + { + get + { + return _TerritoryID; + } + set + { + if (_TerritoryID != value) + { + OnTerritoryIDChanging(value); + _TerritoryID = value; + OnTerritoryIDChanged(); + } + } + } + private global::System.Int32 _TerritoryID; + partial void OnTerritoryIDChanging(global::System.Int32 value); + partial void OnTerritoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CountryRegionCode + { + get + { + return _CountryRegionCode; + } + set + { + OnCountryRegionCodeChanging(value); + _CountryRegionCode = value; + OnCountryRegionCodeChanged(); + } + } + private global::System.String _CountryRegionCode; + partial void OnCountryRegionCodeChanging(global::System.String value); + partial void OnCountryRegionCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Group + { + get + { + return _Group; + } + set + { + OnGroupChanging(value); + _Group = value; + OnGroupChanged(); + } + } + private global::System.String _Group; + partial void OnGroupChanging(global::System.String value); + partial void OnGroupChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal SalesYTD + { + get + { + return _SalesYTD; + } + set + { + OnSalesYTDChanging(value); + _SalesYTD = value; + OnSalesYTDChanged(); + } + } + private global::System.Decimal _SalesYTD; + partial void OnSalesYTDChanging(global::System.Decimal value); + partial void OnSalesYTDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal SalesLastYear + { + get + { + return _SalesLastYear; + } + set + { + OnSalesLastYearChanging(value); + _SalesLastYear = value; + OnSalesLastYearChanged(); + } + } + private global::System.Decimal _SalesLastYear; + partial void OnSalesLastYearChanging(global::System.Decimal value); + partial void OnSalesLastYearChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal CostYTD + { + get + { + return _CostYTD; + } + set + { + OnCostYTDChanging(value); + _CostYTD = value; + OnCostYTDChanged(); + } + } + private global::System.Decimal _CostYTD; + partial void OnCostYTDChanging(global::System.Decimal value); + partial void OnCostYTDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal CostLastYear + { + get + { + return _CostLastYear; + } + set + { + OnCostLastYearChanging(value); + _CostLastYear = value; + OnCostLastYearChanged(); + } + } + private global::System.Decimal _CostLastYear; + partial void OnCostLastYearChanging(global::System.Decimal value); + partial void OnCostLastYearChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection StateProvinces + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "StateProvince"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "StateProvince", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Customers + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "Customer"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "Customer", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesPersons + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesPerson"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesPerson", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesTerritoryHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritoryHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritoryHistory", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SalesTerritoryHistory + { + #region Factory Method + + /// + /// Create a new SalesTerritoryHistory object. + /// + /// Initial value of the SalesPersonID property. + /// Initial value of the TerritoryID property. + /// Initial value of the StartDate property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SalesTerritoryHistory CreateSalesTerritoryHistory(global::System.Int32 salesPersonID, global::System.Int32 territoryID, global::System.DateTime startDate, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SalesTerritoryHistory salesTerritoryHistory = new SalesTerritoryHistory(); + salesTerritoryHistory.SalesPersonID = salesPersonID; + salesTerritoryHistory.TerritoryID = territoryID; + salesTerritoryHistory.StartDate = startDate; + salesTerritoryHistory.rowguid = rowguid; + salesTerritoryHistory.ModifiedDate = modifiedDate; + return salesTerritoryHistory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SalesPersonID + { + get + { + return _SalesPersonID; + } + set + { + if (_SalesPersonID != value) + { + OnSalesPersonIDChanging(value); + _SalesPersonID = value; + OnSalesPersonIDChanged(); + } + } + } + private global::System.Int32 _SalesPersonID; + partial void OnSalesPersonIDChanging(global::System.Int32 value); + partial void OnSalesPersonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 TerritoryID + { + get + { + return _TerritoryID; + } + set + { + if (_TerritoryID != value) + { + OnTerritoryIDChanging(value); + _TerritoryID = value; + OnTerritoryIDChanged(); + } + } + } + private global::System.Int32 _TerritoryID; + partial void OnTerritoryIDChanging(global::System.Int32 value); + partial void OnTerritoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartDate + { + get + { + return _StartDate; + } + set + { + if (_StartDate != value) + { + OnStartDateChanging(value); + _StartDate = value; + OnStartDateChanged(); + } + } + } + private global::System.DateTime _StartDate; + partial void OnStartDateChanging(global::System.DateTime value); + partial void OnStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable EndDate + { + get + { + return _EndDate; + } + set + { + OnEndDateChanging(value); + _EndDate = value; + OnEndDateChanged(); + } + } + private Nullable _EndDate; + partial void OnEndDateChanging(Nullable value); + partial void OnEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesPerson SalesPerson + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesPersonReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesTerritory SalesTerritory + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesTerritoryReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ScrapReason + { + #region Factory Method + + /// + /// Create a new ScrapReason object. + /// + /// Initial value of the ScrapReasonID property. + /// Initial value of the Name property. + /// Initial value of the ModifiedDate property. + public static ScrapReason CreateScrapReason(global::System.Int16 scrapReasonID, global::System.String name, global::System.DateTime modifiedDate) + { + ScrapReason scrapReason = new ScrapReason(); + scrapReason.ScrapReasonID = scrapReasonID; + scrapReason.Name = name; + scrapReason.ModifiedDate = modifiedDate; + return scrapReason; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 ScrapReasonID + { + get + { + return _ScrapReasonID; + } + set + { + if (_ScrapReasonID != value) + { + OnScrapReasonIDChanging(value); + _ScrapReasonID = value; + OnScrapReasonIDChanged(); + } + } + } + private global::System.Int16 _ScrapReasonID; + partial void OnScrapReasonIDChanging(global::System.Int16 value); + partial void OnScrapReasonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection WorkOrders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "WorkOrder"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "WorkOrder", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Shift + { + #region Factory Method + + /// + /// Create a new Shift object. + /// + /// Initial value of the ShiftID property. + /// Initial value of the Name property. + /// Initial value of the StartTime property. + /// Initial value of the EndTime property. + /// Initial value of the ModifiedDate property. + public static Shift CreateShift(global::System.Byte shiftID, global::System.String name, global::System.DateTime startTime, global::System.DateTime endTime, global::System.DateTime modifiedDate) + { + Shift shift = new Shift(); + shift.ShiftID = shiftID; + shift.Name = name; + shift.StartTime = startTime; + shift.EndTime = endTime; + shift.ModifiedDate = modifiedDate; + return shift; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte ShiftID + { + get + { + return _ShiftID; + } + set + { + if (_ShiftID != value) + { + OnShiftIDChanging(value); + _ShiftID = value; + OnShiftIDChanged(); + } + } + } + private global::System.Byte _ShiftID; + partial void OnShiftIDChanging(global::System.Byte value); + partial void OnShiftIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartTime + { + get + { + return _StartTime; + } + set + { + OnStartTimeChanging(value); + _StartTime = value; + OnStartTimeChanged(); + } + } + private global::System.DateTime _StartTime; + partial void OnStartTimeChanging(global::System.DateTime value); + partial void OnStartTimeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime EndTime + { + get + { + return _EndTime; + } + set + { + OnEndTimeChanging(value); + _EndTime = value; + OnEndTimeChanged(); + } + } + private global::System.DateTime _EndTime; + partial void OnEndTimeChanging(global::System.DateTime value); + partial void OnEndTimeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection EmployeeDepartmentHistories + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "EmployeeDepartmentHistory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "EmployeeDepartmentHistory", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ShipMethod + { + #region Factory Method + + /// + /// Create a new ShipMethod object. + /// + /// Initial value of the ShipMethodID property. + /// Initial value of the Name property. + /// Initial value of the ShipBase property. + /// Initial value of the ShipRate property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static ShipMethod CreateShipMethod(global::System.Int32 shipMethodID, global::System.String name, global::System.Decimal shipBase, global::System.Decimal shipRate, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + ShipMethod shipMethod = new ShipMethod(); + shipMethod.ShipMethodID = shipMethodID; + shipMethod.Name = name; + shipMethod.ShipBase = shipBase; + shipMethod.ShipRate = shipRate; + shipMethod.rowguid = rowguid; + shipMethod.ModifiedDate = modifiedDate; + return shipMethod; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ShipMethodID + { + get + { + return _ShipMethodID; + } + set + { + if (_ShipMethodID != value) + { + OnShipMethodIDChanging(value); + _ShipMethodID = value; + OnShipMethodIDChanged(); + } + } + } + private global::System.Int32 _ShipMethodID; + partial void OnShipMethodIDChanging(global::System.Int32 value); + partial void OnShipMethodIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal ShipBase + { + get + { + return _ShipBase; + } + set + { + OnShipBaseChanging(value); + _ShipBase = value; + OnShipBaseChanged(); + } + } + private global::System.Decimal _ShipBase; + partial void OnShipBaseChanging(global::System.Decimal value); + partial void OnShipBaseChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal ShipRate + { + get + { + return _ShipRate; + } + set + { + OnShipRateChanging(value); + _ShipRate = value; + OnShipRateChanged(); + } + } + private global::System.Decimal _ShipRate; + partial void OnShipRateChanging(global::System.Decimal value); + partial void OnShipRateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection PurchaseOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "PurchaseOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "PurchaseOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "SalesOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "SalesOrderHeader", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class ShoppingCartItem + { + #region Factory Method + + /// + /// Create a new ShoppingCartItem object. + /// + /// Initial value of the ShoppingCartItemID property. + /// Initial value of the ShoppingCartID property. + /// Initial value of the Quantity property. + /// Initial value of the ProductID property. + /// Initial value of the DateCreated property. + /// Initial value of the ModifiedDate property. + public static ShoppingCartItem CreateShoppingCartItem(global::System.Int32 shoppingCartItemID, global::System.String shoppingCartID, global::System.Int32 quantity, global::System.Int32 productID, global::System.DateTime dateCreated, global::System.DateTime modifiedDate) + { + ShoppingCartItem shoppingCartItem = new ShoppingCartItem(); + shoppingCartItem.ShoppingCartItemID = shoppingCartItemID; + shoppingCartItem.ShoppingCartID = shoppingCartID; + shoppingCartItem.Quantity = quantity; + shoppingCartItem.ProductID = productID; + shoppingCartItem.DateCreated = dateCreated; + shoppingCartItem.ModifiedDate = modifiedDate; + return shoppingCartItem; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ShoppingCartItemID + { + get + { + return _ShoppingCartItemID; + } + set + { + if (_ShoppingCartItemID != value) + { + OnShoppingCartItemIDChanging(value); + _ShoppingCartItemID = value; + OnShoppingCartItemIDChanged(); + } + } + } + private global::System.Int32 _ShoppingCartItemID; + partial void OnShoppingCartItemIDChanging(global::System.Int32 value); + partial void OnShoppingCartItemIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String ShoppingCartID + { + get + { + return _ShoppingCartID; + } + set + { + OnShoppingCartIDChanging(value); + _ShoppingCartID = value; + OnShoppingCartIDChanged(); + } + } + private global::System.String _ShoppingCartID; + partial void OnShoppingCartIDChanging(global::System.String value); + partial void OnShoppingCartIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 Quantity + { + get + { + return _Quantity; + } + set + { + OnQuantityChanging(value); + _Quantity = value; + OnQuantityChanged(); + } + } + private global::System.Int32 _Quantity; + partial void OnQuantityChanging(global::System.Int32 value); + partial void OnQuantityChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime DateCreated + { + get + { + return _DateCreated; + } + set + { + OnDateCreatedChanging(value); + _DateCreated = value; + OnDateCreatedChanged(); + } + } + private global::System.DateTime _DateCreated; + partial void OnDateCreatedChanging(global::System.DateTime value); + partial void OnDateCreatedChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SpecialOffer + { + #region Factory Method + + /// + /// Create a new SpecialOffer object. + /// + /// Initial value of the SpecialOfferID property. + /// Initial value of the Description property. + /// Initial value of the DiscountPct property. + /// Initial value of the Type property. + /// Initial value of the Category property. + /// Initial value of the StartDate property. + /// Initial value of the EndDate property. + /// Initial value of the MinQty property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SpecialOffer CreateSpecialOffer(global::System.Int32 specialOfferID, global::System.String description, global::System.Decimal discountPct, global::System.String type, global::System.String category, global::System.DateTime startDate, global::System.DateTime endDate, global::System.Int32 minQty, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SpecialOffer specialOffer = new SpecialOffer(); + specialOffer.SpecialOfferID = specialOfferID; + specialOffer.Description = description; + specialOffer.DiscountPct = discountPct; + specialOffer.Type = type; + specialOffer.Category = category; + specialOffer.StartDate = startDate; + specialOffer.EndDate = endDate; + specialOffer.MinQty = minQty; + specialOffer.rowguid = rowguid; + specialOffer.ModifiedDate = modifiedDate; + return specialOffer; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SpecialOfferID + { + get + { + return _SpecialOfferID; + } + set + { + if (_SpecialOfferID != value) + { + OnSpecialOfferIDChanging(value); + _SpecialOfferID = value; + OnSpecialOfferIDChanged(); + } + } + } + private global::System.Int32 _SpecialOfferID; + partial void OnSpecialOfferIDChanging(global::System.Int32 value); + partial void OnSpecialOfferIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Description + { + get + { + return _Description; + } + set + { + OnDescriptionChanging(value); + _Description = value; + OnDescriptionChanged(); + } + } + private global::System.String _Description; + partial void OnDescriptionChanging(global::System.String value); + partial void OnDescriptionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal DiscountPct + { + get + { + return _DiscountPct; + } + set + { + OnDiscountPctChanging(value); + _DiscountPct = value; + OnDiscountPctChanged(); + } + } + private global::System.Decimal _DiscountPct; + partial void OnDiscountPctChanging(global::System.Decimal value); + partial void OnDiscountPctChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Type + { + get + { + return _Type; + } + set + { + OnTypeChanging(value); + _Type = value; + OnTypeChanged(); + } + } + private global::System.String _Type; + partial void OnTypeChanging(global::System.String value); + partial void OnTypeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Category + { + get + { + return _Category; + } + set + { + OnCategoryChanging(value); + _Category = value; + OnCategoryChanged(); + } + } + private global::System.String _Category; + partial void OnCategoryChanging(global::System.String value); + partial void OnCategoryChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartDate + { + get + { + return _StartDate; + } + set + { + OnStartDateChanging(value); + _StartDate = value; + OnStartDateChanged(); + } + } + private global::System.DateTime _StartDate; + partial void OnStartDateChanging(global::System.DateTime value); + partial void OnStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime EndDate + { + get + { + return _EndDate; + } + set + { + OnEndDateChanging(value); + _EndDate = value; + OnEndDateChanged(); + } + } + private global::System.DateTime _EndDate; + partial void OnEndDateChanging(global::System.DateTime value); + partial void OnEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 MinQty + { + get + { + return _MinQty; + } + set + { + OnMinQtyChanging(value); + _MinQty = value; + OnMinQtyChanged(); + } + } + private global::System.Int32 _MinQty; + partial void OnMinQtyChanging(global::System.Int32 value); + partial void OnMinQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable MaxQty + { + get + { + return _MaxQty; + } + set + { + OnMaxQtyChanging(value); + _MaxQty = value; + OnMaxQtyChanged(); + } + } + private Nullable _MaxQty; + partial void OnMaxQtyChanging(Nullable value); + partial void OnMaxQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SpecialOfferProducts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOfferProduct"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOfferProduct", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class SpecialOfferProduct + { + #region Factory Method + + /// + /// Create a new SpecialOfferProduct object. + /// + /// Initial value of the SpecialOfferID property. + /// Initial value of the ProductID property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static SpecialOfferProduct CreateSpecialOfferProduct(global::System.Int32 specialOfferID, global::System.Int32 productID, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + SpecialOfferProduct specialOfferProduct = new SpecialOfferProduct(); + specialOfferProduct.SpecialOfferID = specialOfferID; + specialOfferProduct.ProductID = productID; + specialOfferProduct.rowguid = rowguid; + specialOfferProduct.ModifiedDate = modifiedDate; + return specialOfferProduct; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 SpecialOfferID + { + get + { + return _SpecialOfferID; + } + set + { + if (_SpecialOfferID != value) + { + OnSpecialOfferIDChanging(value); + _SpecialOfferID = value; + OnSpecialOfferIDChanged(); + } + } + } + private global::System.Int32 _SpecialOfferID; + partial void OnSpecialOfferIDChanging(global::System.Int32 value); + partial void OnSpecialOfferIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesOrderDetails + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SalesOrderDetail"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SalesOrderDetail", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SpecialOffer SpecialOffer + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SpecialOfferReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class StateProvince + { + #region Factory Method + + /// + /// Create a new StateProvince object. + /// + /// Initial value of the StateProvinceID property. + /// Initial value of the StateProvinceCode property. + /// Initial value of the CountryRegionCode property. + /// Initial value of the IsOnlyStateProvinceFlag property. + /// Initial value of the Name property. + /// Initial value of the TerritoryID property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static StateProvince CreateStateProvince(global::System.Int32 stateProvinceID, global::System.String stateProvinceCode, global::System.String countryRegionCode, global::System.Boolean isOnlyStateProvinceFlag, global::System.String name, global::System.Int32 territoryID, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + StateProvince stateProvince = new StateProvince(); + stateProvince.StateProvinceID = stateProvinceID; + stateProvince.StateProvinceCode = stateProvinceCode; + stateProvince.CountryRegionCode = countryRegionCode; + stateProvince.IsOnlyStateProvinceFlag = isOnlyStateProvinceFlag; + stateProvince.Name = name; + stateProvince.TerritoryID = territoryID; + stateProvince.rowguid = rowguid; + stateProvince.ModifiedDate = modifiedDate; + return stateProvince; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 StateProvinceID + { + get + { + return _StateProvinceID; + } + set + { + if (_StateProvinceID != value) + { + OnStateProvinceIDChanging(value); + _StateProvinceID = value; + OnStateProvinceIDChanged(); + } + } + } + private global::System.Int32 _StateProvinceID; + partial void OnStateProvinceIDChanging(global::System.Int32 value); + partial void OnStateProvinceIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String StateProvinceCode + { + get + { + return _StateProvinceCode; + } + set + { + OnStateProvinceCodeChanging(value); + _StateProvinceCode = value; + OnStateProvinceCodeChanged(); + } + } + private global::System.String _StateProvinceCode; + partial void OnStateProvinceCodeChanging(global::System.String value); + partial void OnStateProvinceCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String CountryRegionCode + { + get + { + return _CountryRegionCode; + } + set + { + OnCountryRegionCodeChanging(value); + _CountryRegionCode = value; + OnCountryRegionCodeChanged(); + } + } + private global::System.String _CountryRegionCode; + partial void OnCountryRegionCodeChanging(global::System.String value); + partial void OnCountryRegionCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean IsOnlyStateProvinceFlag + { + get + { + return _IsOnlyStateProvinceFlag; + } + set + { + OnIsOnlyStateProvinceFlagChanging(value); + _IsOnlyStateProvinceFlag = value; + OnIsOnlyStateProvinceFlagChanged(); + } + } + private global::System.Boolean _IsOnlyStateProvinceFlag; + partial void OnIsOnlyStateProvinceFlagChanging(global::System.Boolean value); + partial void OnIsOnlyStateProvinceFlagChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 TerritoryID + { + get + { + return _TerritoryID; + } + set + { + OnTerritoryIDChanging(value); + _TerritoryID = value; + OnTerritoryIDChanged(); + } + } + private global::System.Int32 _TerritoryID; + partial void OnTerritoryIDChanging(global::System.Int32 value); + partial void OnTerritoryIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection
Addresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection
("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "Address"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection
("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "Address", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public CountryRegion CountryRegion + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CountryRegionReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection SalesTaxRates + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "SalesTaxRate"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "SalesTaxRate", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesTerritory SalesTerritory + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesTerritoryReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Store + { + #region Factory Method + + /// + /// Create a new Store object. + /// + /// Initial value of the CustomerID property. + /// Initial value of the Name property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static Store CreateStore(global::System.Int32 customerID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + Store store = new Store(); + store.CustomerID = customerID; + store.Name = name; + store.rowguid = rowguid; + store.ModifiedDate = modifiedDate; + return store; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CustomerID + { + get + { + return _CustomerID; + } + set + { + if (_CustomerID != value) + { + OnCustomerIDChanging(value); + _CustomerID = value; + OnCustomerIDChanged(); + } + } + } + private global::System.Int32 _CustomerID; + partial void OnCustomerIDChanging(global::System.Int32 value); + partial void OnCustomerIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable SalesPersonID + { + get + { + return _SalesPersonID; + } + set + { + OnSalesPersonIDChanging(value); + _SalesPersonID = value; + OnSalesPersonIDChanged(); + } + } + private Nullable _SalesPersonID; + partial void OnSalesPersonIDChanging(Nullable value); + partial void OnSalesPersonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Demographics + { + get + { + return _Demographics; + } + set + { + OnDemographicsChanging(value); + _Demographics = value; + OnDemographicsChanged(); + } + } + private global::System.String _Demographics; + partial void OnDemographicsChanging(global::System.String value); + partial void OnDemographicsChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Customer Customer + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference CustomerReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public SalesPerson SalesPerson + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference SalesPersonReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection StoreContacts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "StoreContact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "StoreContact", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class StoreContact + { + #region Factory Method + + /// + /// Create a new StoreContact object. + /// + /// Initial value of the CustomerID property. + /// Initial value of the ContactID property. + /// Initial value of the ContactTypeID property. + /// Initial value of the rowguid property. + /// Initial value of the ModifiedDate property. + public static StoreContact CreateStoreContact(global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 contactTypeID, global::System.Guid rowguid, global::System.DateTime modifiedDate) + { + StoreContact storeContact = new StoreContact(); + storeContact.CustomerID = customerID; + storeContact.ContactID = contactID; + storeContact.ContactTypeID = contactTypeID; + storeContact.rowguid = rowguid; + storeContact.ModifiedDate = modifiedDate; + return storeContact; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 CustomerID + { + get + { + return _CustomerID; + } + set + { + if (_CustomerID != value) + { + OnCustomerIDChanging(value); + _CustomerID = value; + OnCustomerIDChanged(); + } + } + } + private global::System.Int32 _CustomerID; + partial void OnCustomerIDChanging(global::System.Int32 value); + partial void OnCustomerIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactID + { + get + { + return _ContactID; + } + set + { + if (_ContactID != value) + { + OnContactIDChanging(value); + _ContactID = value; + OnContactIDChanged(); + } + } + } + private global::System.Int32 _ContactID; + partial void OnContactIDChanging(global::System.Int32 value); + partial void OnContactIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactTypeID + { + get + { + return _ContactTypeID; + } + set + { + OnContactTypeIDChanging(value); + _ContactTypeID = value; + OnContactTypeIDChanged(); + } + } + private global::System.Int32 _ContactTypeID; + partial void OnContactTypeIDChanging(global::System.Int32 value); + partial void OnContactTypeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Guid rowguid + { + get + { + return _rowguid; + } + set + { + OnrowguidChanging(value); + _rowguid = value; + OnrowguidChanged(); + } + } + private global::System.Guid _rowguid; + partial void OnrowguidChanging(global::System.Guid value); + partial void OnrowguidChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Contact Contact + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ContactType ContactType + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactTypeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Store Store + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference StoreReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class sysdiagram + { + #region Factory Method + + /// + /// Create a new sysdiagram object. + /// + /// Initial value of the name property. + /// Initial value of the principal_id property. + /// Initial value of the diagram_id property. + public static sysdiagram Createsysdiagram(global::System.String name, global::System.Int32 principal_id, global::System.Int32 diagram_id) + { + sysdiagram sysdiagram = new sysdiagram(); + sysdiagram.name = name; + sysdiagram.principal_id = principal_id; + sysdiagram.diagram_id = diagram_id; + return sysdiagram; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String name + { + get + { + return _name; + } + set + { + OnnameChanging(value); + _name = value; + OnnameChanged(); + } + } + private global::System.String _name; + partial void OnnameChanging(global::System.String value); + partial void OnnameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 principal_id + { + get + { + return _principal_id; + } + set + { + Onprincipal_idChanging(value); + _principal_id = value; + Onprincipal_idChanged(); + } + } + private global::System.Int32 _principal_id; + partial void Onprincipal_idChanging(global::System.Int32 value); + partial void Onprincipal_idChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 diagram_id + { + get + { + return _diagram_id; + } + set + { + if (_diagram_id != value) + { + Ondiagram_idChanging(value); + _diagram_id = value; + Ondiagram_idChanged(); + } + } + } + private global::System.Int32 _diagram_id; + partial void Ondiagram_idChanging(global::System.Int32 value); + partial void Ondiagram_idChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable version + { + get + { + return _version; + } + set + { + OnversionChanging(value); + _version = value; + OnversionChanged(); + } + } + private Nullable _version; + partial void OnversionChanging(Nullable value); + partial void OnversionChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte[] definition + { + get + { + return value; + } + set + { + OndefinitionChanging(value); + _definition = value; + OndefinitionChanged(); + } + } + private global::System.Byte[] _definition; + partial void OndefinitionChanging(global::System.Byte[] value); + partial void OndefinitionChanged(); + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class TransactionHistory + { + #region Factory Method + + /// + /// Create a new TransactionHistory object. + /// + /// Initial value of the TransactionID property. + /// Initial value of the ProductID property. + /// Initial value of the ReferenceOrderID property. + /// Initial value of the ReferenceOrderLineID property. + /// Initial value of the TransactionDate property. + /// Initial value of the TransactionType property. + /// Initial value of the Quantity property. + /// Initial value of the ActualCost property. + /// Initial value of the ModifiedDate property. + public static TransactionHistory CreateTransactionHistory(global::System.Int32 transactionID, global::System.Int32 productID, global::System.Int32 referenceOrderID, global::System.Int32 referenceOrderLineID, global::System.DateTime transactionDate, global::System.String transactionType, global::System.Int32 quantity, global::System.Decimal actualCost, global::System.DateTime modifiedDate) + { + TransactionHistory transactionHistory = new TransactionHistory(); + transactionHistory.TransactionID = transactionID; + transactionHistory.ProductID = productID; + transactionHistory.ReferenceOrderID = referenceOrderID; + transactionHistory.ReferenceOrderLineID = referenceOrderLineID; + transactionHistory.TransactionDate = transactionDate; + transactionHistory.TransactionType = transactionType; + transactionHistory.Quantity = quantity; + transactionHistory.ActualCost = actualCost; + transactionHistory.ModifiedDate = modifiedDate; + return transactionHistory; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 TransactionID + { + get + { + return _TransactionID; + } + set + { + if (_TransactionID != value) + { + OnTransactionIDChanging(value); + _TransactionID = value; + OnTransactionIDChanged(); + } + } + } + private global::System.Int32 _TransactionID; + partial void OnTransactionIDChanging(global::System.Int32 value); + partial void OnTransactionIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ReferenceOrderID + { + get + { + return _ReferenceOrderID; + } + set + { + OnReferenceOrderIDChanging(value); + _ReferenceOrderID = value; + OnReferenceOrderIDChanged(); + } + } + private global::System.Int32 _ReferenceOrderID; + partial void OnReferenceOrderIDChanging(global::System.Int32 value); + partial void OnReferenceOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ReferenceOrderLineID + { + get + { + return _ReferenceOrderLineID; + } + set + { + OnReferenceOrderLineIDChanging(value); + _ReferenceOrderLineID = value; + OnReferenceOrderLineIDChanged(); + } + } + private global::System.Int32 _ReferenceOrderLineID; + partial void OnReferenceOrderLineIDChanging(global::System.Int32 value); + partial void OnReferenceOrderLineIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime TransactionDate + { + get + { + return _TransactionDate; + } + set + { + OnTransactionDateChanging(value); + _TransactionDate = value; + OnTransactionDateChanged(); + } + } + private global::System.DateTime _TransactionDate; + partial void OnTransactionDateChanging(global::System.DateTime value); + partial void OnTransactionDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String TransactionType + { + get + { + return _TransactionType; + } + set + { + OnTransactionTypeChanging(value); + _TransactionType = value; + OnTransactionTypeChanged(); + } + } + private global::System.String _TransactionType; + partial void OnTransactionTypeChanging(global::System.String value); + partial void OnTransactionTypeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 Quantity + { + get + { + return _Quantity; + } + set + { + OnQuantityChanging(value); + _Quantity = value; + OnQuantityChanged(); + } + } + private global::System.Int32 _Quantity; + partial void OnQuantityChanging(global::System.Int32 value); + partial void OnQuantityChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal ActualCost + { + get + { + return _ActualCost; + } + set + { + OnActualCostChanging(value); + _ActualCost = value; + OnActualCostChanged(); + } + } + private global::System.Decimal _ActualCost; + partial void OnActualCostChanging(global::System.Decimal value); + partial void OnActualCostChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class TransactionHistoryArchive + { + #region Factory Method + + /// + /// Create a new TransactionHistoryArchive object. + /// + /// Initial value of the TransactionID property. + /// Initial value of the ProductID property. + /// Initial value of the ReferenceOrderID property. + /// Initial value of the ReferenceOrderLineID property. + /// Initial value of the TransactionDate property. + /// Initial value of the TransactionType property. + /// Initial value of the Quantity property. + /// Initial value of the ActualCost property. + /// Initial value of the ModifiedDate property. + public static TransactionHistoryArchive CreateTransactionHistoryArchive(global::System.Int32 transactionID, global::System.Int32 productID, global::System.Int32 referenceOrderID, global::System.Int32 referenceOrderLineID, global::System.DateTime transactionDate, global::System.String transactionType, global::System.Int32 quantity, global::System.Decimal actualCost, global::System.DateTime modifiedDate) + { + TransactionHistoryArchive transactionHistoryArchive = new TransactionHistoryArchive(); + transactionHistoryArchive.TransactionID = transactionID; + transactionHistoryArchive.ProductID = productID; + transactionHistoryArchive.ReferenceOrderID = referenceOrderID; + transactionHistoryArchive.ReferenceOrderLineID = referenceOrderLineID; + transactionHistoryArchive.TransactionDate = transactionDate; + transactionHistoryArchive.TransactionType = transactionType; + transactionHistoryArchive.Quantity = quantity; + transactionHistoryArchive.ActualCost = actualCost; + transactionHistoryArchive.ModifiedDate = modifiedDate; + return transactionHistoryArchive; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 TransactionID + { + get + { + return _TransactionID; + } + set + { + if (_TransactionID != value) + { + OnTransactionIDChanging(value); + _TransactionID = value; + OnTransactionIDChanged(); + } + } + } + private global::System.Int32 _TransactionID; + partial void OnTransactionIDChanging(global::System.Int32 value); + partial void OnTransactionIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ReferenceOrderID + { + get + { + return _ReferenceOrderID; + } + set + { + OnReferenceOrderIDChanging(value); + _ReferenceOrderID = value; + OnReferenceOrderIDChanged(); + } + } + private global::System.Int32 _ReferenceOrderID; + partial void OnReferenceOrderIDChanging(global::System.Int32 value); + partial void OnReferenceOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ReferenceOrderLineID + { + get + { + return _ReferenceOrderLineID; + } + set + { + OnReferenceOrderLineIDChanging(value); + _ReferenceOrderLineID = value; + OnReferenceOrderLineIDChanged(); + } + } + private global::System.Int32 _ReferenceOrderLineID; + partial void OnReferenceOrderLineIDChanging(global::System.Int32 value); + partial void OnReferenceOrderLineIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime TransactionDate + { + get + { + return _TransactionDate; + } + set + { + OnTransactionDateChanging(value); + _TransactionDate = value; + OnTransactionDateChanged(); + } + } + private global::System.DateTime _TransactionDate; + partial void OnTransactionDateChanging(global::System.DateTime value); + partial void OnTransactionDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String TransactionType + { + get + { + return _TransactionType; + } + set + { + OnTransactionTypeChanging(value); + _TransactionType = value; + OnTransactionTypeChanged(); + } + } + private global::System.String _TransactionType; + partial void OnTransactionTypeChanging(global::System.String value); + partial void OnTransactionTypeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 Quantity + { + get + { + return _Quantity; + } + set + { + OnQuantityChanging(value); + _Quantity = value; + OnQuantityChanged(); + } + } + private global::System.Int32 _Quantity; + partial void OnQuantityChanging(global::System.Int32 value); + partial void OnQuantityChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal ActualCost + { + get + { + return _ActualCost; + } + set + { + OnActualCostChanging(value); + _ActualCost = value; + OnActualCostChanged(); + } + } + private global::System.Decimal _ActualCost; + partial void OnActualCostChanging(global::System.Decimal value); + partial void OnActualCostChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class UnitMeasure + { + #region Factory Method + + /// + /// Create a new UnitMeasure object. + /// + /// Initial value of the UnitMeasureCode property. + /// Initial value of the Name property. + /// Initial value of the ModifiedDate property. + public static UnitMeasure CreateUnitMeasure(global::System.String unitMeasureCode, global::System.String name, global::System.DateTime modifiedDate) + { + UnitMeasure unitMeasure = new UnitMeasure(); + unitMeasure.UnitMeasureCode = unitMeasureCode; + unitMeasure.Name = name; + unitMeasure.ModifiedDate = modifiedDate; + return unitMeasure; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String UnitMeasureCode + { + get + { + return _UnitMeasureCode; + } + set + { + if (_UnitMeasureCode != value) + { + OnUnitMeasureCodeChanging(value); + _UnitMeasureCode = value; + OnUnitMeasureCodeChanged(); + } + } + } + private global::System.String _UnitMeasureCode; + partial void OnUnitMeasureCodeChanging(global::System.String value); + partial void OnUnitMeasureCodeChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection BillOfMaterials + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "BillOfMaterials"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "BillOfMaterials", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Products + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection Products1 + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductVendors + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "ProductVendor"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "ProductVendor", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class Vendor + { + #region Factory Method + + /// + /// Create a new Vendor object. + /// + /// Initial value of the VendorID property. + /// Initial value of the AccountNumber property. + /// Initial value of the Name property. + /// Initial value of the CreditRating property. + /// Initial value of the PreferredVendorStatus property. + /// Initial value of the ActiveFlag property. + /// Initial value of the ModifiedDate property. + public static Vendor CreateVendor(global::System.Int32 vendorID, global::System.String accountNumber, global::System.String name, global::System.Byte creditRating, global::System.Boolean preferredVendorStatus, global::System.Boolean activeFlag, global::System.DateTime modifiedDate) + { + Vendor vendor = new Vendor(); + vendor.VendorID = vendorID; + vendor.AccountNumber = accountNumber; + vendor.Name = name; + vendor.CreditRating = creditRating; + vendor.PreferredVendorStatus = preferredVendorStatus; + vendor.ActiveFlag = activeFlag; + vendor.ModifiedDate = modifiedDate; + return vendor; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 VendorID + { + get + { + return _VendorID; + } + set + { + if (_VendorID != value) + { + OnVendorIDChanging(value); + _VendorID = value; + OnVendorIDChanged(); + } + } + } + private global::System.Int32 _VendorID; + partial void OnVendorIDChanging(global::System.Int32 value); + partial void OnVendorIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String AccountNumber + { + get + { + return _AccountNumber; + } + set + { + OnAccountNumberChanging(value); + _AccountNumber = value; + OnAccountNumberChanged(); + } + } + private global::System.String _AccountNumber; + partial void OnAccountNumberChanging(global::System.String value); + partial void OnAccountNumberChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String Name + { + get + { + return _Name; + } + set + { + OnNameChanging(value); + _Name = value; + OnNameChanged(); + } + } + private global::System.String _Name; + partial void OnNameChanging(global::System.String value); + partial void OnNameChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Byte CreditRating + { + get + { + return _CreditRating; + } + set + { + OnCreditRatingChanging(value); + _CreditRating = value; + OnCreditRatingChanged(); + } + } + private global::System.Byte _CreditRating; + partial void OnCreditRatingChanging(global::System.Byte value); + partial void OnCreditRatingChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean PreferredVendorStatus + { + get + { + return _PreferredVendorStatus; + } + set + { + OnPreferredVendorStatusChanging(value); + _PreferredVendorStatus = value; + OnPreferredVendorStatusChanged(); + } + } + private global::System.Boolean _PreferredVendorStatus; + partial void OnPreferredVendorStatusChanging(global::System.Boolean value); + partial void OnPreferredVendorStatusChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Boolean ActiveFlag + { + get + { + return _ActiveFlag; + } + set + { + OnActiveFlagChanging(value); + _ActiveFlag = value; + OnActiveFlagChanged(); + } + } + private global::System.Boolean _ActiveFlag; + partial void OnActiveFlagChanging(global::System.Boolean value); + partial void OnActiveFlagChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.String PurchasingWebServiceURL + { + get + { + return _PurchasingWebServiceURL; + } + set + { + OnPurchasingWebServiceURLChanging(value); + _PurchasingWebServiceURL = value; + OnPurchasingWebServiceURLChanged(); + } + } + private global::System.String _PurchasingWebServiceURL; + partial void OnPurchasingWebServiceURLChanging(global::System.String value); + partial void OnPurchasingWebServiceURLChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection ProductVendors + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "ProductVendor"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "ProductVendor", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection PurchaseOrderHeaders + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "PurchaseOrderHeader"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "PurchaseOrderHeader", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection VendorAddresses + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "VendorAddress"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "VendorAddress", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection VendorContacts + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "VendorContact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "VendorContact", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class VendorAddress + { + #region Factory Method + + /// + /// Create a new VendorAddress object. + /// + /// Initial value of the VendorID property. + /// Initial value of the AddressID property. + /// Initial value of the AddressTypeID property. + /// Initial value of the ModifiedDate property. + public static VendorAddress CreateVendorAddress(global::System.Int32 vendorID, global::System.Int32 addressID, global::System.Int32 addressTypeID, global::System.DateTime modifiedDate) + { + VendorAddress vendorAddress = new VendorAddress(); + vendorAddress.VendorID = vendorID; + vendorAddress.AddressID = addressID; + vendorAddress.AddressTypeID = addressTypeID; + vendorAddress.ModifiedDate = modifiedDate; + return vendorAddress; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 VendorID + { + get + { + return _VendorID; + } + set + { + if (_VendorID != value) + { + OnVendorIDChanging(value); + _VendorID = value; + OnVendorIDChanged(); + } + } + } + private global::System.Int32 _VendorID; + partial void OnVendorIDChanging(global::System.Int32 value); + partial void OnVendorIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AddressID + { + get + { + return _AddressID; + } + set + { + if (_AddressID != value) + { + OnAddressIDChanging(value); + _AddressID = value; + OnAddressIDChanged(); + } + } + } + private global::System.Int32 _AddressID; + partial void OnAddressIDChanging(global::System.Int32 value); + partial void OnAddressIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 AddressTypeID + { + get + { + return _AddressTypeID; + } + set + { + OnAddressTypeIDChanging(value); + _AddressTypeID = value; + OnAddressTypeIDChanged(); + } + } + private global::System.Int32 _AddressTypeID; + partial void OnAddressTypeIDChanging(global::System.Int32 value); + partial void OnAddressTypeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Address Address + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference
AddressReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public AddressType AddressType + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference AddressTypeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Vendor Vendor + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference VendorReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class VendorContact + { + #region Factory Method + + /// + /// Create a new VendorContact object. + /// + /// Initial value of the VendorID property. + /// Initial value of the ContactID property. + /// Initial value of the ContactTypeID property. + /// Initial value of the ModifiedDate property. + public static VendorContact CreateVendorContact(global::System.Int32 vendorID, global::System.Int32 contactID, global::System.Int32 contactTypeID, global::System.DateTime modifiedDate) + { + VendorContact vendorContact = new VendorContact(); + vendorContact.VendorID = vendorID; + vendorContact.ContactID = contactID; + vendorContact.ContactTypeID = contactTypeID; + vendorContact.ModifiedDate = modifiedDate; + return vendorContact; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 VendorID + { + get + { + return _VendorID; + } + set + { + if (_VendorID != value) + { + OnVendorIDChanging(value); + _VendorID = value; + OnVendorIDChanged(); + } + } + } + private global::System.Int32 _VendorID; + partial void OnVendorIDChanging(global::System.Int32 value); + partial void OnVendorIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactID + { + get + { + return _ContactID; + } + set + { + if (_ContactID != value) + { + OnContactIDChanging(value); + _ContactID = value; + OnContactIDChanged(); + } + } + } + private global::System.Int32 _ContactID; + partial void OnContactIDChanging(global::System.Int32 value); + partial void OnContactIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ContactTypeID + { + get + { + return _ContactTypeID; + } + set + { + OnContactTypeIDChanging(value); + _ContactTypeID = value; + OnContactTypeIDChanged(); + } + } + private global::System.Int32 _ContactTypeID; + partial void OnContactTypeIDChanging(global::System.Int32 value); + partial void OnContactTypeIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Contact Contact + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ContactType ContactType + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ContactTypeReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Vendor Vendor + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference VendorReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class WorkOrder + { + #region Factory Method + + /// + /// Create a new WorkOrder object. + /// + /// Initial value of the WorkOrderID property. + /// Initial value of the ProductID property. + /// Initial value of the OrderQty property. + /// Initial value of the StockedQty property. + /// Initial value of the ScrappedQty property. + /// Initial value of the StartDate property. + /// Initial value of the DueDate property. + /// Initial value of the ModifiedDate property. + public static WorkOrder CreateWorkOrder(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int32 orderQty, global::System.Int32 stockedQty, global::System.Int16 scrappedQty, global::System.DateTime startDate, global::System.DateTime dueDate, global::System.DateTime modifiedDate) + { + WorkOrder workOrder = new WorkOrder(); + workOrder.WorkOrderID = workOrderID; + workOrder.ProductID = productID; + workOrder.OrderQty = orderQty; + workOrder.StockedQty = stockedQty; + workOrder.ScrappedQty = scrappedQty; + workOrder.StartDate = startDate; + workOrder.DueDate = dueDate; + workOrder.ModifiedDate = modifiedDate; + return workOrder; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 WorkOrderID + { + get + { + return _WorkOrderID; + } + set + { + if (_WorkOrderID != value) + { + OnWorkOrderIDChanging(value); + _WorkOrderID = value; + OnWorkOrderIDChanged(); + } + } + } + private global::System.Int32 _WorkOrderID; + partial void OnWorkOrderIDChanging(global::System.Int32 value); + partial void OnWorkOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 OrderQty + { + get + { + return _OrderQty; + } + set + { + OnOrderQtyChanging(value); + _OrderQty = value; + OnOrderQtyChanged(); + } + } + private global::System.Int32 _OrderQty; + partial void OnOrderQtyChanging(global::System.Int32 value); + partial void OnOrderQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 StockedQty + { + get + { + return _StockedQty; + } + set + { + OnStockedQtyChanging(value); + _StockedQty = value; + OnStockedQtyChanged(); + } + } + private global::System.Int32 _StockedQty; + partial void OnStockedQtyChanging(global::System.Int32 value); + partial void OnStockedQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 ScrappedQty + { + get + { + return _ScrappedQty; + } + set + { + OnScrappedQtyChanging(value); + _ScrappedQty = value; + OnScrappedQtyChanged(); + } + } + private global::System.Int16 _ScrappedQty; + partial void OnScrappedQtyChanging(global::System.Int16 value); + partial void OnScrappedQtyChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime StartDate + { + get + { + return _StartDate; + } + set + { + OnStartDateChanging(value); + _StartDate = value; + OnStartDateChanged(); + } + } + private global::System.DateTime _StartDate; + partial void OnStartDateChanging(global::System.DateTime value); + partial void OnStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable EndDate + { + get + { + return _EndDate; + } + set + { + OnEndDateChanging(value); + _EndDate = value; + OnEndDateChanged(); + } + } + private Nullable _EndDate; + partial void OnEndDateChanging(Nullable value); + partial void OnEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime DueDate + { + get + { + return _DueDate; + } + set + { + OnDueDateChanging(value); + _DueDate = value; + OnDueDateChanged(); + } + } + private global::System.DateTime _DueDate; + partial void OnDueDateChanging(global::System.DateTime value); + partial void OnDueDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ScrapReasonID + { + get + { + return _ScrapReasonID; + } + set + { + OnScrapReasonIDChanging(value); + _ScrapReasonID = value; + OnScrapReasonIDChanged(); + } + } + private Nullable _ScrapReasonID; + partial void OnScrapReasonIDChanging(Nullable value); + partial void OnScrapReasonIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Product Product + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ProductReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public ScrapReason ScrapReason + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference ScrapReasonReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public EntityCollection WorkOrderRoutings + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrderRouting"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrderRouting", value); + } + } + } + + #endregion + + } + + /// + /// No Metadata Documentation available. + /// + [Serializable()] + [DataContractAttribute(IsReference = true)] + public partial class WorkOrderRouting + { + #region Factory Method + + /// + /// Create a new WorkOrderRouting object. + /// + /// Initial value of the WorkOrderID property. + /// Initial value of the ProductID property. + /// Initial value of the OperationSequence property. + /// Initial value of the LocationID property. + /// Initial value of the ScheduledStartDate property. + /// Initial value of the ScheduledEndDate property. + /// Initial value of the PlannedCost property. + /// Initial value of the ModifiedDate property. + public static WorkOrderRouting CreateWorkOrderRouting(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int16 operationSequence, global::System.Int16 locationID, global::System.DateTime scheduledStartDate, global::System.DateTime scheduledEndDate, global::System.Decimal plannedCost, global::System.DateTime modifiedDate) + { + WorkOrderRouting workOrderRouting = new WorkOrderRouting(); + workOrderRouting.WorkOrderID = workOrderID; + workOrderRouting.ProductID = productID; + workOrderRouting.OperationSequence = operationSequence; + workOrderRouting.LocationID = locationID; + workOrderRouting.ScheduledStartDate = scheduledStartDate; + workOrderRouting.ScheduledEndDate = scheduledEndDate; + workOrderRouting.PlannedCost = plannedCost; + workOrderRouting.ModifiedDate = modifiedDate; + return workOrderRouting; + } + + #endregion + + #region Simple Properties + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 WorkOrderID + { + get + { + return _WorkOrderID; + } + set + { + if (_WorkOrderID != value) + { + OnWorkOrderIDChanging(value); + _WorkOrderID = value; + OnWorkOrderIDChanged(); + } + } + } + private global::System.Int32 _WorkOrderID; + partial void OnWorkOrderIDChanging(global::System.Int32 value); + partial void OnWorkOrderIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int32 ProductID + { + get + { + return _ProductID; + } + set + { + if (_ProductID != value) + { + OnProductIDChanging(value); + _ProductID = value; + OnProductIDChanged(); + } + } + } + private global::System.Int32 _ProductID; + partial void OnProductIDChanging(global::System.Int32 value); + partial void OnProductIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 OperationSequence + { + get + { + return _OperationSequence; + } + set + { + if (_OperationSequence != value) + { + OnOperationSequenceChanging(value); + _OperationSequence = value; + OnOperationSequenceChanged(); + } + } + } + private global::System.Int16 _OperationSequence; + partial void OnOperationSequenceChanging(global::System.Int16 value); + partial void OnOperationSequenceChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Int16 LocationID + { + get + { + return _LocationID; + } + set + { + OnLocationIDChanging(value); + _LocationID = value; + OnLocationIDChanged(); + } + } + private global::System.Int16 _LocationID; + partial void OnLocationIDChanging(global::System.Int16 value); + partial void OnLocationIDChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ScheduledStartDate + { + get + { + return _ScheduledStartDate; + } + set + { + OnScheduledStartDateChanging(value); + _ScheduledStartDate = value; + OnScheduledStartDateChanged(); + } + } + private global::System.DateTime _ScheduledStartDate; + partial void OnScheduledStartDateChanging(global::System.DateTime value); + partial void OnScheduledStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ScheduledEndDate + { + get + { + return _ScheduledEndDate; + } + set + { + OnScheduledEndDateChanging(value); + _ScheduledEndDate = value; + OnScheduledEndDateChanged(); + } + } + private global::System.DateTime _ScheduledEndDate; + partial void OnScheduledEndDateChanging(global::System.DateTime value); + partial void OnScheduledEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ActualStartDate + { + get + { + return _ActualStartDate; + } + set + { + OnActualStartDateChanging(value); + _ActualStartDate = value; + OnActualStartDateChanged(); + } + } + private Nullable _ActualStartDate; + partial void OnActualStartDateChanging(Nullable value); + partial void OnActualStartDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ActualEndDate + { + get + { + return _ActualEndDate; + } + set + { + OnActualEndDateChanging(value); + _ActualEndDate = value; + OnActualEndDateChanged(); + } + } + private Nullable _ActualEndDate; + partial void OnActualEndDateChanging(Nullable value); + partial void OnActualEndDateChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ActualResourceHrs + { + get + { + return _ActualResourceHrs; + } + set + { + OnActualResourceHrsChanging(value); + _ActualResourceHrs = value; + OnActualResourceHrsChanged(); + } + } + private Nullable _ActualResourceHrs; + partial void OnActualResourceHrsChanging(Nullable value); + partial void OnActualResourceHrsChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.Decimal PlannedCost + { + get + { + return _PlannedCost; + } + set + { + OnPlannedCostChanging(value); + _PlannedCost = value; + OnPlannedCostChanged(); + } + } + private global::System.Decimal _PlannedCost; + partial void OnPlannedCostChanging(global::System.Decimal value); + partial void OnPlannedCostChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public Nullable ActualCost + { + get + { + return _ActualCost; + } + set + { + OnActualCostChanging(value); + _ActualCost = value; + OnActualCostChanged(); + } + } + private Nullable _ActualCost; + partial void OnActualCostChanging(Nullable value); + partial void OnActualCostChanged(); + + /// + /// No Metadata Documentation available. + /// + [DataMemberAttribute()] + public global::System.DateTime ModifiedDate + { + get + { + return _ModifiedDate; + } + set + { + OnModifiedDateChanging(value); + _ModifiedDate = value; + OnModifiedDateChanged(); + } + } + private global::System.DateTime _ModifiedDate; + partial void OnModifiedDateChanging(global::System.DateTime value); + partial void OnModifiedDateChanged(); + + #endregion + + #region Navigation Properties + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public Location Location + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference LocationReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location", value); + } + } + } + + /// + /// No Metadata Documentation available. + /// + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + public WorkOrder WorkOrder + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder").Value; + } + set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder").Value = value; + } + } + /// + /// No Metadata Documentation available. + /// + [BrowsableAttribute(false)] + [DataMemberAttribute()] + public EntityReference WorkOrderReference + { + get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder"); + } + set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder", value); + } + } + } + + #endregion + + } + + #endregion + +} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt new file mode 100644 index 000000000..f37bd524e --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt @@ -0,0 +1,1298 @@ +<# +// You can use this text template to customize object layer code generation for +// applications that use the Entity Framework. The template generates code based on an .edmx file. +// Before using this template, note the following: +// +// *The name of the text template file will determine the name of the code file it generates. +// For example, if the text template is named TextTemplate.tt, the generated file will be named +// TextTemplate.vb or TextTemplate.cs. +// *The Custom Tool property of the targeted .edmx file must be empty. For more information, +// see .edmx File Properties (http://go.microsoft.com/fwlink/?LinkId=139299). +// *The SourceCsdlPath initialization below must be set to one of the following: +// 1) the path of the targeted .edmx or .csdl file +// 2) the path of the targeted .edmx or .csdl file relative to the template path +// +// For more detailed information about using this template, see +// How to: Customize Object Layer Code Generation (http://go.microsoft.com/fwlink/?LinkId=139297). +// For general information about text templates, see +// Generating Artifacts by Using Text Templates (http://go.microsoft.com/fwlink/?LinkId=139298) +#> +<#@ template language="C#" debug="false" hostspecific="true"#> +<#@ include file="EF.Utility.CS.ttinclude"#><#@ + output extension=".cs"#><# + +DefineMetadata(); + +UserSettings userSettings = + new UserSettings + { + SourceCsdlPath = @"AdventureWorks.edmx", + ReferenceCsdlPaths = new string[] {}, + FullyQualifySystemTypes = true, + CreateContextAddToMethods = true, + CamelCaseFields = false, + }; + +ApplyUserSettings(userSettings); +if(Errors.HasErrors) +{ + return String.Empty; +} + +MetadataLoader loader = new MetadataLoader(this); +MetadataTools ef = new MetadataTools(this); +CodeRegion region = new CodeRegion(this); +CodeGenerationTools code = new CodeGenerationTools(this){FullyQualifySystemTypes = userSettings.FullyQualifySystemTypes, CamelCaseFields = userSettings.CamelCaseFields}; + +ItemCollection = loader.CreateEdmItemCollection(SourceCsdlPath, ReferenceCsdlPaths.ToArray()); +ModelNamespace = loader.GetModelNamespace(SourceCsdlPath); +string namespaceName = GetNamespaceName(code); + namespaceName = "AdventureWorksModel"; + +UpdateObjectNamespaceMap(namespaceName); + +#> +//------------------------------------------------------------------------------ +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> +// +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> +// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> +// +//------------------------------------------------------------------------------ + +using System; +using System.ComponentModel; +using System.Data.Entity.Core.EntityClient; +using System.Data.Entity.Core.Objects; +using System.Data.Entity.Core.Objects.DataClasses; +using System.Linq; +using System.Runtime.Serialization; +using System.Xml.Serialization; + +[assembly: EdmSchemaAttribute()] +<# + //////// + //////// Write Relationship Attributes + //////// + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionRelationships")); + bool first = true; + foreach (AssociationType association in GetSourceSchemaTypes()) + { + if (first) + { + WriteLine(string.Empty); + first = false; + } +#> +[assembly: EdmRelationshipAttribute("<#=association.NamespaceName#>", "<#=association.Name#>", "<#=EndName(association, 0)#>", <#=EndMultiplicity(association, 0, code)#>, typeof(<#=EscapeEndTypeName(association, 0, code)#>), "<#=EndName(association, 1)#>", <#=EndMultiplicity(association, 1, code)#>, typeof(<#=EscapeEndTypeName(association, 1, code)#>)<#=code.StringBefore(", ", association.IsForeignKey ? "true" : null)#>)] +<# + } + region.End(); + + if (!String.IsNullOrEmpty(namespaceName)) + { +#> +namespace <#=namespaceName#> +{ +<# + PushIndent(CodeRegion.GetIndent(1)); + } + + //////// + //////// Write EntityContainer and ObjectContext classes. + //////// + + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionContexts")); + foreach (EntityContainer container in GetSourceSchemaTypes()) + { +#> + +/// +/// <#=SummaryComment(container)#> +/// <#=LongDescriptionCommentElement(container, region.CurrentIndentLevel)#> +<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : ObjectContext +{ + #region <#=CodeGenerationTools.GetResourceString("Template_RegionConstructors")#> + + /// + /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_ContextDefaultCtorComment"), container.Name, container.Name)#> + /// + public <#=code.Escape(container)#>() : base("name=<#=container.Name#>", "<#=container.Name#>") + { +<# + WriteLazyLoadingEnabled(container); +#> + OnContextCreated(); + } + + /// + /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_ContextCommonCtorComment"), container.Name)#> + /// + public <#=code.Escape(container)#>(string connectionString) : base(connectionString, "<#=container.Name#>") + { +<# + WriteLazyLoadingEnabled(container); +#> + OnContextCreated(); + } + + /// + /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_ContextCommonCtorComment"), container.Name)#> + /// + public <#=code.Escape(container)#>(EntityConnection connection) : base(connection, "<#=container.Name#>") + { +<# + WriteLazyLoadingEnabled(container); +#> + OnContextCreated(); + } + + #endregion + + #region <#=CodeGenerationTools.GetResourceString("Template_RegionPartialMethods")#> + + partial void OnContextCreated(); + + #endregion + +<# + //////// + //////// Write EntityContainer and ObjectContext ObjectSet properties. + //////// + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionObjectSetProperties")); + foreach (EntitySet set in container.BaseEntitySets.OfType()) + { + VerifyEntityTypeAndSetAccessibilityCompatability(set); +#> + + /// + /// <#=SummaryComment(set)#> + /// <#=LongDescriptionCommentElement(set, region.CurrentIndentLevel)#> + <#=code.SpaceAfter(NewModifier(set))#><#=Accessibility.ForReadOnlyProperty(set)#> ObjectSet<<#=MultiSchemaEscape(set.ElementType, code)#>> <#=code.Escape(set)#> + { + get + { + if ((<#=code.FieldName(set)#> == null)) + { + <#=code.FieldName(set)#> = base.CreateObjectSet<<#=MultiSchemaEscape(set.ElementType, code)#>>("<#=set.Name#>"); + } + return <#=code.FieldName(set)#>; + } + } + private ObjectSet<<#=MultiSchemaEscape(set.ElementType, code)#>> <#=code.FieldName(set)#>; +<# + } + region.End(); + + //////// + //////// Write EntityContainer and ObjectContext AddTo<EntitySet> methods. + //////// + //////// AddTo methods are no longer necessary since the EntitySet properties return + //////// an ObjectSet<T> object, which has already has an Add method. + //////// + //////// AddTo methods are generated here for backwards compatibility reasons only. + //////// Set the CreateContextAddToMethods property of the UserSettings object to false + //////// to turn off generation of the AddTo methods. + //////// + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionAddToMethods")); + IEnumerable addToMethods = CreateContextAddToMethods.Value ? container.BaseEntitySets.OfType() : Enumerable.Empty(); + foreach (EntitySet set in addToMethods) + { + string parameterName = code.Escape(FixParameterName(set.ElementType.Name, code)); +#> + + /// + /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_GenCommentAddToMethodCs"), set.Name)#> + /// + <#=Accessibility.ForType(set.ElementType)#> void AddTo<#=set.Name#>(<#=MultiSchemaEscape(set.ElementType, code)#> <#=parameterName#>) + { + base.AddObject("<#=set.Name#>", <#=parameterName#>); + } +<# + } + region.End(); + + //////// + //////// Write EntityContainer and ObjectContext Function Import methods. + //////// + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionFunctionImports")); + foreach (EdmFunction edmFunction in container.FunctionImports) + { + + IEnumerable parameters = FunctionImportParameter.Create(edmFunction.Parameters, code, ef); + + // Fixup namespaces for types in EF6 assemblies + foreach(var parameter in parameters.Where(p => p.FunctionParameterType == "global::System.Data.Spatial.DbGeography" || p.FunctionParameterType == "global::System.Data.Spatial.DbGeometry")) + { + parameter.FunctionParameterType = parameter.FunctionParameterType.Replace("global::System.Data.Spatial", "global::System.Data.Entity.Spatial"); + parameter.RawClrTypeName = parameter.RawClrTypeName.Replace("global::System.Data.Spatial", "global::System.Data.Entity.Spatial"); + }; + + string paramList = string.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); + TypeUsage returnType = edmFunction.ReturnParameters.Count == 0 ? null : ef.GetElementType(edmFunction.ReturnParameters[0].TypeUsage); + if (edmFunction.IsComposableAttribute) + { +#> + + /// + /// <#=SummaryComment(edmFunction)#> + /// <#=LongDescriptionCommentElement(edmFunction, region.CurrentIndentLevel)#><#=ParameterComments(parameters.Select(p => new Tuple(p.RawFunctionParameterName, SummaryComment(p.Source))), region.CurrentIndentLevel)#> + [EdmFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] + <#=code.SpaceAfter(NewModifier(edmFunction))#><#=Accessibility.ForMethod(edmFunction)#> <#="IQueryable<" + MultiSchemaEscape(returnType, code) + ">"#> <#=code.Escape(edmFunction)#>(<#=paramList#>) + { +<# + WriteFunctionParameters(parameters); +#> + return base.CreateQuery<<#=MultiSchemaEscape(returnType, code)#>>("[<#=edmFunction.NamespaceName#>].[<#=edmFunction.Name#>](<#=string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray())#>)"<#=code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))#>); + } +<# + } + else + { +#> + + /// + /// <#=SummaryComment(edmFunction)#> + /// <#=LongDescriptionCommentElement(edmFunction, region.CurrentIndentLevel)#><#=ParameterComments(parameters.Select(p => new Tuple(p.RawFunctionParameterName, SummaryComment(p.Source))), region.CurrentIndentLevel)#> + <#=code.SpaceAfter(NewModifier(edmFunction))#><#=Accessibility.ForMethod(edmFunction)#> <#=returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType, code) + ">"#> <#=code.Escape(edmFunction)#>(<#=paramList#>) + { +<# + WriteFunctionParameters(parameters); +#> + return base.ExecuteFunction<#=returnType == null ? "" : "<" + MultiSchemaEscape(returnType, code) + ">"#>("<#=edmFunction.Name#>"<#=code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))#>); + } +<# + if(returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { +#> + /// + /// <#=SummaryComment(edmFunction)#> + /// <#=LongDescriptionCommentElement(edmFunction, region.CurrentIndentLevel)#> + /// <#=ParameterComments(parameters.Select(p => new Tuple(p.RawFunctionParameterName, SummaryComment(p.Source))), region.CurrentIndentLevel)#> + <#=code.SpaceAfter(NewModifier(edmFunction))#><#=Accessibility.ForMethod(edmFunction)#> <#=returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType, code) + ">"#> <#=code.Escape(edmFunction)#>(<#=code.StringAfter(paramList, ", ")#>MergeOption mergeOption) + { +<# + WriteFunctionParameters(parameters); +#> + return base.<#=returnType == null ? "ExecuteFunction" : "ExecuteFunction<" + MultiSchemaEscape(returnType, code) + ">"#>("<#=edmFunction.Name#>", mergeOption<#=code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))#>); + } +<# + } + } + } + region.End(); +#> +} +<# + } + region.End(); + + //////// + //////// Write EntityType classes. + //////// + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionEntities")); + foreach (EntityType entity in GetSourceSchemaTypes().OrderBy(e => e.Name)) + { +#> + +/// +/// <#=SummaryComment(entity)#> +/// <#=LongDescriptionCommentElement(entity, region.CurrentIndentLevel)#> +[EdmEntityTypeAttribute(NamespaceName="<#=entity.NamespaceName#>", Name="<#=entity.Name#>")] +[Serializable()] +[DataContractAttribute(IsReference=true)] +<# + foreach (EntityType subType in ItemCollection.GetItems().Where(b => b.BaseType == entity)) + { +#> +[KnownTypeAttribute(typeof(<#=MultiSchemaEscape(subType, code)#>))] +<# + } +#> +<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#> : <#=BaseTypeName(entity, code)#> +{ +<# + if (!entity.Abstract) + { + WriteFactoryMethod(entity, code); + } + + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionSimpleProperties")); + foreach (EdmProperty property in entity.Properties.Where(p => p.DeclaringType == entity && p.TypeUsage.EdmType is SimpleType)) + { + VerifyGetterAndSetterAccessibilityCompatability(property); + WriteSimpleTypeProperty(property, code); + } + region.End(); + + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionComplexProperties")); + foreach (EdmProperty property in entity.Properties.Where(p => p.DeclaringType == entity && p.TypeUsage.EdmType is ComplexType)) + { + VerifyGetterAndSetterAccessibilityCompatability(property); + WriteComplexTypeProperty(property, code); + } + region.End(); + + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionNavigationProperties")); + foreach (NavigationProperty navProperty in entity.NavigationProperties.Where(n => n.DeclaringType == entity)) + { + VerifyGetterAndSetterAccessibilityCompatability(navProperty); +#> + + /// + /// <#=SummaryComment(navProperty)#> + /// <#=LongDescriptionCommentElement(navProperty, region.CurrentIndentLevel)#> + [XmlIgnoreAttribute()] + [SoapIgnoreAttribute()] + [DataMemberAttribute()] + [EdmRelationshipNavigationPropertyAttribute("<#=navProperty.RelationshipType.NamespaceName#>", "<#=navProperty.RelationshipType.Name#>", "<#=navProperty.ToEndMember.Name#>")] +<# + if (navProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) + { +#> + <#=code.SpaceAfter(NewModifier(navProperty))#><#=Accessibility.ForProperty(navProperty)#> EntityCollection<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>> <#=code.Escape(navProperty)#> + { + <#=code.SpaceAfter(Accessibility.ForGetter(navProperty))#>get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>"); + } + <#=code.SpaceAfter(Accessibility.ForSetter(navProperty))#>set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>", value); + } + } + } +<# + } + else + { +#> + <#=code.SpaceAfter(NewModifier(navProperty))#><#=Accessibility.ForProperty(navProperty)#> <#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#> <#=code.Escape(navProperty)#> + { + <#=code.SpaceAfter(Accessibility.ForGetter(navProperty))#>get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>").Value; + } + <#=code.SpaceAfter(Accessibility.ForSetter(navProperty))#>set + { + ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>").Value = value; + } + } +<# + string refPropertyName = navProperty.Name + "Reference"; + if (entity.Members.Any(m => m.Name == refPropertyName)) + { + // 6017 is the same error number that EntityClassGenerator uses. + Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6017", String.Format(CultureInfo.CurrentCulture, + CodeGenerationTools.GetResourceString("Template_ConflictingGeneratedNavPropName"), + navProperty.Name, entity.FullName, refPropertyName))); + } +#> + /// + /// <#=SummaryComment(navProperty)#> + /// <#=LongDescriptionCommentElement(navProperty, region.CurrentIndentLevel)#> + [BrowsableAttribute(false)] + [DataMemberAttribute()] + <#=Accessibility.ForProperty(navProperty)#> EntityReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>> <#=refPropertyName#> + { + <#=code.SpaceAfter(Accessibility.ForGetter(navProperty))#>get + { + return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>"); + } + <#=code.SpaceAfter(Accessibility.ForSetter(navProperty))#>set + { + if ((value != null)) + { + ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>", value); + } + } + } +<# + } + } + region.End(); +#> +} +<# + } + region.End(); + + //////// + //////// Write ComplexType classes. + //////// + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionComplexTypes")); + foreach (ComplexType complex in GetSourceSchemaTypes().OrderBy(c => c.Name)) + { +#> + +/// +/// <#=SummaryComment(complex)#> +/// <#=LongDescriptionCommentElement(complex, region.CurrentIndentLevel)#> +[EdmComplexTypeAttribute(NamespaceName="<#=complex.NamespaceName#>", Name="<#=complex.Name#>")] +[DataContractAttribute(IsReference=true)] +[Serializable()] +<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> : ComplexObject +{ +<# + WriteFactoryMethod(complex, code); + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionSimpleProperties")); + foreach (EdmProperty property in complex.Properties.Where(p => p.DeclaringType == complex && p.TypeUsage.EdmType is SimpleType)) + { + VerifyGetterAndSetterAccessibilityCompatability(property); + WriteSimpleTypeProperty(property, code); + } + region.End(); + + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionComplexProperties")); + foreach (EdmProperty property in complex.Properties.Where(p => p.DeclaringType == complex && p.TypeUsage.EdmType is ComplexType)) + { + VerifyGetterAndSetterAccessibilityCompatability(property); + WriteComplexTypeProperty(property, code); + } + region.End(); +#> +} +<# + } + region.End(); + + //////// + //////// Write enums. + //////// + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionEnumTypes")); + foreach (EnumType enumType in GetSourceSchemaTypes().OrderBy(c => c.Name)) + { +#> + +/// +/// <#=SummaryComment(enumType)#> +/// <#=LongDescriptionCommentElement(enumType, region.CurrentIndentLevel)#> +[EdmEnumTypeAttribute(NamespaceName="<#=enumType.NamespaceName#>", Name="<#=enumType.Name#>")] +[DataContractAttribute()] +<# + if (enumType.IsFlags) + { +#> +[FlagsAttribute()] +<# + } +#> +<#=Accessibility.ForType(enumType)#> enum <#=code.Escape(enumType)#> : <#=code.Escape(enumType.UnderlyingType.ClrEquivalentType, fullyQualifySystemTypes: false)#> +{ +<# + foreach (EnumMember member in enumType.Members) + { +#> + /// + /// <#=SummaryComment(member)#> + /// <#=LongDescriptionCommentElement(member, region.CurrentIndentLevel + 1)#> + [EnumMemberAttribute()] + <#=code.Escape(member)#> = <#=member.Value#>, + +<# + } + + // Remove the last comma and line break + if (enumType.Members.Any()) + { + this.GenerationEnvironment.Remove( + this.GenerationEnvironment.Length - (CurrentIndent.Length + 5), CurrentIndent.Length + 3); + } +#> +} +<# + } + region.End(); + + if (!String.IsNullOrEmpty(namespaceName)) + { + PopIndent(); +#> +} +<# + } + + if (!VerifyTypeUniqueness(GetSourceSchemaTypes() + .Where(i => i is StructuralType || i is EnumType || i is EntityContainer) + .Select(i => code.GetGlobalItemName(i)))) + { + return string.Empty; + } +#> +<#+ + + //////// + //////// Reusable Template Sections + //////// + + //////// + //////// Write Factory Method. + //////// + private void WriteFactoryMethod(StructuralType structuralType, CodeGenerationTools code) + { + CodeRegion region = new CodeRegion(this, 1); + + string methodName = "Create" + structuralType.Name; + UniqueIdentifierService uniqueIdentifier = new UniqueIdentifierService(); + string instanceName = code.Escape(uniqueIdentifier.AdjustIdentifier((code.CamelCase(structuralType.Name)))); + IEnumerable parameters = FactoryMethodParameter.CreateParameters(structuralType.Members.OfType().Where(p => IncludePropertyInFactoryMethod(structuralType, p)), uniqueIdentifier, MultiSchemaEscape, code); + + if (parameters.Count() == 0) + return; + + if (structuralType.Members.Any(m => m.Name == methodName)) + { + // 6029 is the same error number that EntityClassGenerator uses for this conflict. + Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6029", + String.Format(CultureInfo.CurrentCulture, + CodeGenerationTools.GetResourceString("Template_FactoryMethodNameConflict"), methodName, structuralType.FullName))); + } + + region.Begin(CodeGenerationTools.GetResourceString("Template_RegionFactoryMethod")); +#> + + /// + /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_FactoryMethodComment"), structuralType.Name)#> + /// <#=ParameterComments(parameters.Select(p => new Tuple(p.RawParameterName, p.ParameterComment)), region.CurrentIndentLevel)#> + public static <#=code.Escape(structuralType)#> <#=methodName#>(<#=string.Join(", ", parameters.Select(p => p.ParameterType + " " + p.ParameterName).ToArray())#>) + { + <#=code.Escape(structuralType)#> <#=instanceName#> = new <#=code.Escape(structuralType)#>(); +<#+ + foreach (FactoryMethodParameter parameter in parameters) + { + if (parameter.IsComplexType) + { + // ComplexType initialization. +#> + <#=instanceName#>.<#=code.Escape(parameter.Source)#> = StructuralObject.VerifyComplexObjectIsNotNull(<#=parameter.ParameterName#>, "<#=parameter.Source.Name#>"); +<#+ + } + else + { + // SimpleType initialization. +#> + <#=instanceName#>.<#=code.Escape(parameter.Source)#> = <#=parameter.ParameterName#>; +<#+ + } + } +#> + return <#=instanceName#>; + } +<#+ + region.End(); + } + + + //////// + //////// Write SimpleType Properties. + //////// + private void WriteSimpleTypeProperty(EdmProperty simpleProperty, CodeGenerationTools code) + { + MetadataTools ef = new MetadataTools(this); +#> + + /// + /// <#=SummaryComment(simpleProperty)#> + /// <#=LongDescriptionCommentElement(simpleProperty, 1)#> + [EdmScalarPropertyAttribute(EntityKeyProperty=<#=code.CreateLiteral(ef.IsKey(simpleProperty))#>, IsNullable=<#=code.CreateLiteral(ef.IsNullable(simpleProperty))#>)] + [DataMemberAttribute()] + <#=code.SpaceAfter(NewModifier(simpleProperty))#><#=Accessibility.ForProperty(simpleProperty)#> <#=MultiSchemaEscape(simpleProperty.TypeUsage, code)#> <#=code.Escape(simpleProperty)#> + { + <#=code.SpaceAfter(Accessibility.ForGetter(simpleProperty))#>get + { +<#+ if (ef.ClrType(simpleProperty.TypeUsage) == typeof(byte[])) + { +#> + return StructuralObject.GetValidValue(<#=code.FieldName(simpleProperty)#>); +<#+ + } + else + { +#> + return <#=code.FieldName(simpleProperty)#>; +<#+ + } +#> + } + <#=code.SpaceAfter(Accessibility.ForSetter((simpleProperty)))#>set + { +<#+ + if (ef.IsKey(simpleProperty)) + { + if (ef.ClrType(simpleProperty.TypeUsage) == typeof(byte[])) + { +#> + if (!StructuralObject.BinaryEquals(<#=code.FieldName(simpleProperty)#>, value)) +<#+ + } + else + { +#> + if (<#=code.FieldName(simpleProperty)#> != value) +<#+ + } +#> + { +<#+ + PushIndent(CodeRegion.GetIndent(1)); + } +#> + <#=ChangingMethodName(simpleProperty)#>(value); + ReportPropertyChanging("<#=simpleProperty.Name#>"); + <#=code.FieldName(simpleProperty)#> = <#=CastToEnumType(simpleProperty.TypeUsage, code)#>StructuralObject.SetValidValue(<#=CastToUnderlyingType(simpleProperty.TypeUsage, code)#>value<#=OptionalNullableParameterForSetValidValue(simpleProperty, code)#>); + ReportPropertyChanged("<#=simpleProperty.Name#>"); + <#=ChangedMethodName(simpleProperty)#>(); +<#+ + if (ef.IsKey(simpleProperty)) + { + PopIndent(); +#> + } +<#+ + } +#> + } + } + private <#=MultiSchemaEscape(simpleProperty.TypeUsage, code)#> <#=code.FieldName(simpleProperty)#><#=code.StringBefore(" = ", code.CreateLiteral(simpleProperty.DefaultValue))#>; + partial void <#=ChangingMethodName(simpleProperty)#>(<#=MultiSchemaEscape(simpleProperty.TypeUsage, code)#> value); + partial void <#=ChangedMethodName(simpleProperty)#>(); +<#+ + } + + //////// + //////// Write ComplexType Properties. + //////// + private void WriteComplexTypeProperty(EdmProperty complexProperty, CodeGenerationTools code) + { +#> + + /// + /// <#=SummaryComment(complexProperty)#> + /// <#=LongDescriptionCommentElement(complexProperty, 1)#> + [EdmComplexPropertyAttribute()] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] + [XmlElement(IsNullable=true)] + [SoapElement(IsNullable=true)] + [DataMemberAttribute()] + <#=code.SpaceAfter(NewModifier(complexProperty))#><#=Accessibility.ForProperty(complexProperty)#> <#=MultiSchemaEscape(complexProperty.TypeUsage, code)#> <#=code.Escape(complexProperty)#> + { + <#=code.SpaceAfter(Accessibility.ForGetter(complexProperty))#>get + { + <#=code.FieldName(complexProperty)#> = GetValidValue(<#=code.FieldName(complexProperty)#>, "<#=complexProperty.Name#>", false, <#=InitializedTrackingField(complexProperty, code)#>); + <#=InitializedTrackingField(complexProperty, code)#> = true; + return <#=code.FieldName(complexProperty)#>; + } + <#=code.SpaceAfter(Accessibility.ForSetter(complexProperty))#>set + { + <#=ChangingMethodName(complexProperty)#>(value); + ReportPropertyChanging("<#=complexProperty.Name#>"); + <#=code.FieldName(complexProperty)#> = SetValidValue(<#=code.FieldName(complexProperty)#>, value); + <#=InitializedTrackingField(complexProperty, code)#> = true; + ReportPropertyChanged("<#=complexProperty.Name#>"); + <#=ChangedMethodName(complexProperty)#>(); + } + } + private <#=MultiSchemaEscape(complexProperty.TypeUsage, code)#> <#=code.FieldName(complexProperty)#>; + private bool <#=InitializedTrackingField(complexProperty, code)#>; + partial void <#=ChangingMethodName(complexProperty)#>(<#=MultiSchemaEscape(complexProperty.TypeUsage, code)#> value); + partial void <#=ChangedMethodName(complexProperty)#>(); +<#+ + } + + private void WriteFunctionParameters(IEnumerable parameters) + { + foreach (FunctionImportParameter parameter in parameters) + { + if (!parameter.NeedsLocalVariable) + { + continue; + } +#> + ObjectParameter <#=parameter.LocalVariableName#>; + if (<#=parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"#>) + { + <#=parameter.LocalVariableName#> = new ObjectParameter("<#=parameter.EsqlParameterName#>", <#=parameter.FunctionParameterName#>); + } + else + { + <#=parameter.LocalVariableName#> = new ObjectParameter("<#=parameter.EsqlParameterName#>", typeof(<#=parameter.RawClrTypeName#>)); + } + +<#+ + } + } + + private void WriteLazyLoadingEnabled(EntityContainer container) + { + string lazyLoadingAttributeValue = null; + string lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; + if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) + { + bool isLazyLoading = false; + if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading)) + { +#> + this.ContextOptions.LazyLoadingEnabled = <#=isLazyLoading.ToString().ToLowerInvariant()#>; +<#+ + } + } + } + +//////// +//////// Declare Template Public Properties. +//////// +public string SourceCsdlPath{ get; set; } +public string ModelNamespace{ get; set; } +public EdmItemCollection ItemCollection{ get; set; } +public IEnumerable ReferenceCsdlPaths{ get; set; } +public Nullable CreateContextAddToMethods{ get; set; } +public Dictionary EdmToObjectNamespaceMap +{ + get { return _edmToObjectNamespaceMap; } + set { _edmToObjectNamespaceMap = value; } +} +public Dictionary _edmToObjectNamespaceMap = new Dictionary(); +public Double SourceEdmVersion +{ + get + { + if (ItemCollection != null) + { + return ItemCollection.EdmVersion; + } + + return 0.0; + } +} + +private bool VerifyTypeUniqueness(IEnumerable types) +{ + HashSet hash = new HashSet(); + foreach (string type in types) + { + if (!hash.Add(type)) + { + // 6034 is the error number used by System.Data.Entity.Design EntityClassGenerator. + Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6034", + String.Format(CultureInfo.CurrentCulture, + CodeGenerationTools.GetResourceString("Template_DuplicateTopLevelType"), + type))); + return false; + } + } + return true; +} + +void ApplyUserSettings(UserSettings userSettings) +{ + // Setup template UserSettings. + if (SourceCsdlPath == null) + { +#if !PREPROCESSED_TEMPLATE + if(userSettings.SourceCsdlPath == "$" + "edmxInputFile" + "$") + { + Errors.Add(new System.CodeDom.Compiler.CompilerError(Host.TemplateFile, -1, -1, "", + CodeGenerationTools.GetResourceString("Template_ReplaceVsItemTemplateToken"))); + return; + } + + SourceCsdlPath = Host.ResolvePath(userSettings.SourceCsdlPath); +#else + SourceCsdlPath = userSettings.SourceCsdlPath; +#endif + } + + // normalize the path, remove ..\ from it + SourceCsdlPath = Path.GetFullPath(SourceCsdlPath); + + + if (ReferenceCsdlPaths == null) + { + ReferenceCsdlPaths = userSettings.ReferenceCsdlPaths; + } + + if (!CreateContextAddToMethods.HasValue) + { + CreateContextAddToMethods = userSettings.CreateContextAddToMethods; + } + + DefaultSummaryComment = CodeGenerationTools.GetResourceString("Template_CommentNoDocumentation"); +} + +class UserSettings +{ + public string SourceCsdlPath{ get; set; } + public string[] ReferenceCsdlPaths{ get; set; } + public bool FullyQualifySystemTypes{ get; set; } + public bool CreateContextAddToMethods{ get; set; } + public bool CamelCaseFields{ get; set; } +} + +string GetNamespaceName(CodeGenerationTools code) +{ + string namespaceName = code.VsNamespaceSuggestion(); + +#if PREPROCESSED_TEMPLATE + if (String.IsNullOrEmpty(namespaceName)) + { + namespaceName = GetObjectNamespace(ModelNamespace); + } +#endif + return namespaceName; +} + +string MultiSchemaEscape(TypeUsage usage, CodeGenerationTools code) +{ + MetadataTools ef = new MetadataTools(this); + if (usage.EdmType != null) + { + if(usage.EdmType.Name == "Geography") + { + return "System.Data.Entity.Spatial.DbGeography"; + } + else if(usage.EdmType.Name == "Geometry") + { + return "System.Data.Entity.Spatial.DbGeometry"; + } + else if (usage.EdmType is StructuralType) + { + return MultiSchemaEscape(usage.EdmType, code); + } + else if (usage.EdmType is EnumType) + { + string typeName = MultiSchemaEscape(usage.EdmType, code); + if (ef.IsNullable(usage)) + { + return String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName); + } + + return typeName; + } + } + + return code.Escape(usage); +} + +string MultiSchemaEscape(EdmType type, CodeGenerationTools code) +{ + if (type.NamespaceName != ModelNamespace) + { + return code.CreateFullName(code.EscapeNamespace(GetObjectNamespace(type.NamespaceName)), code.Escape(type)); + } + + return code.Escape(type); +} + +string NewModifier(NavigationProperty navigationProperty) +{ + Type baseType = typeof(EntityObject); + return NewModifier(baseType, navigationProperty.Name); +} + +string NewModifier(EdmFunction edmFunction) +{ + Type baseType = typeof(ObjectContext); + return NewModifier(baseType, edmFunction.Name); +} + +string NewModifier(EntitySet set) +{ + Type baseType = typeof(ObjectContext); + return NewModifier(baseType, set.Name); +} + +string NewModifier(EdmProperty property) +{ + Type baseType; + if (property.DeclaringType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { + baseType = typeof(EntityObject); + } + else + { + baseType = typeof(ComplexObject); + } + return NewModifier(baseType, property.Name); +} + +string NewModifier(Type type, string memberName) +{ + if (HasBaseMemberWithMatchingName(type, memberName)) + { + return "new"; + } + return string.Empty; +} + +static bool HasBaseMemberWithMatchingName(Type type, string memberName) +{ + BindingFlags bindingFlags = BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public + | BindingFlags.Instance | BindingFlags.Static; + return type.GetMembers(bindingFlags).Where(m => IsVisibleMember(m)).Any(m => m.Name == memberName); +} + +string CastToEnumType(TypeUsage typeUsage, CodeGenerationTools code) +{ + EnumType type = typeUsage.EdmType as EnumType; + if (type == null) + return string.Empty; + + return "(" + MultiSchemaEscape(typeUsage, code) + ")"; +} + +string CastToUnderlyingType(TypeUsage typeUsage, CodeGenerationTools code) +{ + MetadataTools ef = new MetadataTools(this); + EnumType type = typeUsage.EdmType as EnumType; + if (type == null) + { + return string.Empty; + } + + string clrType = code.Escape(type.UnderlyingType.ClrEquivalentType, fullyQualifySystemTypes: false); + + if (ef.IsNullable(typeUsage)) + { + clrType = String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", clrType); + } + + return "(" + clrType + ")"; +} + +string ChangingMethodName(EdmMember member) +{ + return string.Format(CultureInfo.InvariantCulture, "On{0}Changing", member.Name); +} + +string ChangedMethodName(EdmMember member) +{ + return string.Format(CultureInfo.InvariantCulture, "On{0}Changed", member.Name); +} + +string InitializedTrackingField(EdmProperty property, CodeGenerationTools code) +{ + string namePart = property.Name + "Initialized"; + if (code.CamelCaseFields) + { + namePart = code.CamelCase(namePart); + } + return "_" + namePart; +} + +string OptionalNullableParameterForSetValidValue(EdmMember member, CodeGenerationTools code) +{ + MetadataTools ef = new MetadataTools(this); + string list = string.Empty; + PrimitiveType type = member.TypeUsage.EdmType as PrimitiveType; + if (type != null && type.ClrEquivalentType.IsClass) + { + MetadataProperty storeGeneratedPatternProperty = null; + bool isNullable = ef.IsNullable(member.TypeUsage) || + (member.MetadataProperties.TryGetValue(MetadataConstants.EDM_ANNOTATION_09_02 + ":StoreGeneratedPattern", false, out storeGeneratedPatternProperty) && + Object.Equals(storeGeneratedPatternProperty.Value, "Computed")); + list += ", " + code.CreateLiteral(isNullable); + } + return list; +} + +static bool IsVisibleMember(MemberInfo memberInfo) +{ + if (memberInfo is EventInfo) + { + EventInfo ei = (EventInfo)memberInfo; + MethodInfo add = ei.GetAddMethod(); + MethodInfo remove = ei.GetRemoveMethod(); + return IsVisibleMethod(add) || IsVisibleMethod(remove); + } + else if (memberInfo is FieldInfo) + { + FieldInfo fi = (FieldInfo)memberInfo; + return !fi.IsPrivate && !fi.IsAssembly; + } + else if (memberInfo is MethodBase) + { + MethodBase mb = (MethodBase)memberInfo; + if (mb.IsSpecialName) + return false; + return IsVisibleMethod(mb); + } + else if (memberInfo is PropertyInfo) + { + PropertyInfo pi = (PropertyInfo)memberInfo; + MethodInfo get = pi.GetGetMethod(); + MethodInfo set = pi.GetSetMethod(); + return IsVisibleMethod(get) || IsVisibleMethod(set); + } + + return false; +} + +static bool IsVisibleMethod(MethodBase methodBase) +{ + if (methodBase == null) + return false; + + return !methodBase.IsPrivate && !methodBase.IsAssembly; +} + +IEnumerable GetSourceSchemaTypes() where T : GlobalItem +{ + if (Path.GetExtension(SourceCsdlPath) != ".edmx") + { + return ItemCollection.GetItems().Where(e => e.MetadataProperties.Any(mp => mp.Name == "SchemaSource" && (string)mp.Value == SourceCsdlPath)); + } + else + { + return ItemCollection.GetItems(); + } +} + +string EndName(AssociationType association, int index) +{ + return association.AssociationEndMembers[index].Name; +} + +string EndMultiplicity(AssociationType association, int index, CodeGenerationTools code) +{ + return "System.Data.Entity.Core.Metadata.Edm.RelationshipMultiplicity." + association.AssociationEndMembers[index].RelationshipMultiplicity.ToString(); +} + +string EscapeEndTypeName(AssociationType association, int index, CodeGenerationTools code) +{ + EntityType entity = association.AssociationEndMembers[index].GetEntityType(); + return code.CreateFullName(code.EscapeNamespace(GetObjectNamespace(entity.NamespaceName)), code.Escape(entity)); +} + +string GetObjectNamespace(string csdlNamespaceName) +{ + string objectNamespace; + if (EdmToObjectNamespaceMap.TryGetValue(csdlNamespaceName, out objectNamespace)) + { + return objectNamespace; + } + + return csdlNamespaceName; +} + +void UpdateObjectNamespaceMap(string objectNamespace) +{ + if(objectNamespace != ModelNamespace && !EdmToObjectNamespaceMap.ContainsKey(ModelNamespace)) + { + EdmToObjectNamespaceMap.Add(ModelNamespace, objectNamespace); + } +} + +static string FixParameterName(string name, CodeGenerationTools code) +{ + // Change any property that is 'id' (case insensitive) to 'ID' + // since 'iD' is a violation of FxCop rules. + if (StringComparer.OrdinalIgnoreCase.Equals(name, "id")) + { + // Return all lower case since it is an abbreviation, not an acronym. + return "id"; + } + return code.CamelCase(name); +} + +string BaseTypeName(EntityType entity, CodeGenerationTools code) +{ + return entity.BaseType == null ? "EntityObject" : MultiSchemaEscape(entity.BaseType, code); +} + +bool IncludePropertyInFactoryMethod(StructuralType factoryType, EdmProperty edmProperty) +{ + if (edmProperty.Nullable) + { + return false; + } + + if (edmProperty.DefaultValue != null) + { + return false; + } + + if ((Accessibility.ForReadOnlyProperty(edmProperty) != "public" && Accessibility.ForWriteOnlyProperty(edmProperty) != "public") || + (factoryType != edmProperty.DeclaringType && Accessibility.ForWriteOnlyProperty(edmProperty) == "private") + ) + { + // There is no public part to the property. + return false; + } + + return true; +} + +class FactoryMethodParameter +{ + public EdmProperty Source; + public string RawParameterName; + public string ParameterName; + public string ParameterType; + public string ParameterComment; + public bool IsComplexType; + + public static IEnumerable CreateParameters(IEnumerable properties, UniqueIdentifierService unique, Func multiSchemaEscape, CodeGenerationTools code) + { + List parameters = new List(); + foreach (EdmProperty property in properties) + { + FactoryMethodParameter parameter = new FactoryMethodParameter(); + parameter.Source = property; + parameter.IsComplexType = property.TypeUsage.EdmType is ComplexType; + parameter.RawParameterName = unique.AdjustIdentifier(FixParameterName(property.Name, code)); + parameter.ParameterName = code.Escape(parameter.RawParameterName); + parameter.ParameterType = multiSchemaEscape(property.TypeUsage, code); + parameter.ParameterComment = String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CommentFactoryMethodParam"), property.Name); + parameters.Add(parameter); + } + + return parameters; + } +} + +string DefaultSummaryComment{ get; set; } + +string SummaryComment(MetadataItem item) +{ + if (item.Documentation != null && item.Documentation.Summary != null) + { + return PrefixLinesOfMultilineComment(XMLCOMMENT_START + " ", XmlEntityize(item.Documentation.Summary)); + } + + if (DefaultSummaryComment != null) + { + return DefaultSummaryComment; + } + + return string.Empty; +} + +string LongDescriptionCommentElement(MetadataItem item, int indentLevel) +{ + if (item.Documentation != null && !String.IsNullOrEmpty(item.Documentation.LongDescription)) + { + string comment = Environment.NewLine; + string lineStart = CodeRegion.GetIndent(indentLevel) + XMLCOMMENT_START + " "; + comment += lineStart + "" + Environment.NewLine; + comment += lineStart + PrefixLinesOfMultilineComment(lineStart, XmlEntityize(item.Documentation.LongDescription)) + Environment.NewLine; + comment += lineStart + ""; + return comment; + } + return string.Empty; +} + +string PrefixLinesOfMultilineComment(string prefix, string comment) +{ + return comment.Replace(Environment.NewLine, Environment.NewLine + prefix); +} + +string ParameterComments(IEnumerable> parameters, int indentLevel) +{ + System.Text.StringBuilder builder = new System.Text.StringBuilder(); + foreach (Tuple parameter in parameters) + { + builder.AppendLine(); + builder.Append(CodeRegion.GetIndent(indentLevel)); + builder.Append(XMLCOMMENT_START); + builder.Append(String.Format(CultureInfo.InvariantCulture, " {1}", parameter.Item1, parameter.Item2)); + } + return builder.ToString(); +} + +string XmlEntityize(string text) +{ + if (string.IsNullOrEmpty(text)) + { + return string.Empty; + } + + text = text.Replace("&","&"); + text = text.Replace("<","<").Replace(">",">"); + string id = Guid.NewGuid().ToString(); + text = text.Replace(Environment.NewLine, id); + text = text.Replace("\r", " ").Replace("\n"," "); + text = text.Replace(id, Environment.NewLine); + return text.Replace("\'","'").Replace("\"","""); +} + +const string XMLCOMMENT_START = "///"; +IEnumerable GetProperties(StructuralType type) +{ + if (type.BuiltInTypeKind == BuiltInTypeKind.EntityType) + { + return ((EntityType)type).Properties; + } + else + { + return ((ComplexType)type).Properties; + } +} + +protected void VerifyGetterAndSetterAccessibilityCompatability(EdmMember member) +{ + string rawGetterAccessibility = Accessibility.ForReadOnlyProperty(member); + string rawSetterAccessibility = Accessibility.ForWriteOnlyProperty(member); + + if ((rawGetterAccessibility == "internal" && rawSetterAccessibility == "protected") || + (rawGetterAccessibility == "protected" && rawSetterAccessibility == "internal")) + + { + Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6033", String.Format(CultureInfo.CurrentCulture, + CodeGenerationTools.GetResourceString("GeneratedPropertyAccessibilityConflict"), + member.Name, rawGetterAccessibility, rawSetterAccessibility))); + } +} + +private void VerifyEntityTypeAndSetAccessibilityCompatability(EntitySet set) +{ + string typeAccess = Accessibility.ForType(set.ElementType); + string setAccess = Accessibility.ForReadOnlyProperty(set); + + if(typeAccess == "internal" && (setAccess == "public" || setAccess == "protected")) + { + Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6036", String.Format(CultureInfo.CurrentCulture, + CodeGenerationTools.GetResourceString("EntityTypeAndSetAccessibilityConflict"), + set.ElementType.Name, typeAccess, set.Name, setAccess))); + } +} + +private void DefineMetadata() +{ + TemplateMetadata[MetadataConstants.TT_TEMPLATE_NAME] = "CSharpCodeGen"; + TemplateMetadata[MetadataConstants.TT_TEMPLATE_VERSION] = "5.0"; + TemplateMetadata[MetadataConstants.TT_MINIMUM_ENTITY_FRAMEWORK_VERSION] = "4.0"; +} + +sealed class UniqueIdentifierService +{ + private readonly HashSet _knownIdentifiers; + + public UniqueIdentifierService() + { + _knownIdentifiers = new HashSet(StringComparer.Ordinal); + } + + /// + /// Makes the supplied identifier unique within the scope by adding + /// a suffix (1, 2, 3, ...), and returns the unique identifier. + /// + public string AdjustIdentifier(string identifier) + { + // find a unique name by adding suffix as necessary + var numberOfConflicts = 0; + var adjustedIdentifier = identifier; + + while (!_knownIdentifiers.Add(adjustedIdentifier)) + { + ++numberOfConflicts; + adjustedIdentifier = identifier + numberOfConflicts.ToString(CultureInfo.InvariantCulture); + } + + return adjustedIdentifier; + } +} + +#> diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs new file mode 100644 index 000000000..04dd8f5a5 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Data; +using System.Data.Entity; +using System.Data.Entity.Core.Objects; +using System.Linq; +using System.Runtime.Serialization; +using System.ServiceModel; +using OpenRiaServices.EntityFrameworkCore; +using OpenRiaServices.Server; +using NorthwindEFCorePOCOModel; +using TestDomainServices.Testing; +using System.Data.Entity.Core.EntityClient; +using System.Configuration; + +namespace TestDomainServices.EFCore +{ + /// + /// Test DomainService that targets an EF POCO model. + /// + [EnableClientAccess] + public class EFCoreNorthwindPOCO : LinqToEntitiesDomainServiceEFCore + { + #region Product methods + public Product GetProductById(int id) + { + return this.GetProducts().SingleOrDefault(p => p.ProductID == id); + } + + public IQueryable GetProducts() + { + throw new NotImplementedException(); + } + + public void InsertProduct(Product product) + { + throw new NotImplementedException(); + //if (GetEntityState(product) != EntityState.Detached) + //{ + // ObjectContext.ObjectStateManager.ChangeObjectState(product, EntityState.Added); + //} + //else + //{ + // ObjectContext.Products.AddObject(product); + //} + } + + public void UpdateProduct(Product current) + { + throw new NotImplementedException(); + //ObjectContext.Products.AttachAsModified(current, this.ChangeSet.GetOriginal(current)); + } + + public void DeleteProduct(Product product) + { + throw new NotImplementedException(); + //if (GetEntityState(product) == EntityState.Detached) + //{ + // ObjectContext.Products.Attach(product); + //} + //ObjectContext.Products.DeleteObject(product); + } + #endregion + + public IQueryable GetCategories() + { + throw new NotImplementedException(); + //return ObjectContext.Categories; + } + + private EntityState GetEntityState(object entity) + { + throw new NotImplementedException(); + //ObjectStateEntry stateEntry = null; + //if (!this.ObjectContext.ObjectStateManager.TryGetObjectStateEntry(entity, out stateEntry)) + //{ + // return EntityState.Detached; + //} + //return stateEntry.State; + } + } + + /// + /// Derived provider that overrides Context creation to use the current + /// active connection. + /// + [EnableClientAccess] + [ServiceContract(Name = "Northwind")] + public class NorthwindPOCO_CUD : EFCoreNorthwindPOCO + { + // TODo + // protected override NorthwindEntities CreateObjectContext() + // { + // NorthwindEntities context = null; + + // string connection = DBImager.GetNewDatabaseConnectionString("Northwind"); + // if (!string.IsNullOrEmpty(connection)) + // { + // // if there is an active connection in scope use it + // var builder = new EntityConnectionStringBuilder(); + // builder.ConnectionString = ConfigurationManager.ConnectionStrings[NorthwindEntities.ConnectionStringName].ConnectionString; + // builder.ProviderConnectionString = connection; + // context = new NorthwindEntities(builder.ConnectionString); + // } + // else + // { + // context = base.CreateObjectContext(); + // } + + // return context; + // } + } +} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index 8414152f0..bb1626d49 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -25,6 +25,7 @@ + @@ -66,6 +67,11 @@ Code Always + + AdventureWorks - Copy.tt + True + True + True True @@ -76,6 +82,11 @@ True AdventureWorks.dbml + + AdventureWorks.edmx + True + True + True True @@ -281,11 +292,6 @@ PreserveNewest - - True - True - AdventureWorks.edmx - True True @@ -485,6 +491,7 @@ AdventureWorks.cs AdventureWorks.edmx + MSLinqToSQLGenerator Northwind.designer.cs @@ -575,4 +582,16 @@ + + + + + + TextTemplatingFileGenerator + AdventureWorks - Copy.cs + + + + + \ No newline at end of file From d2a933d0348924dcf776134153266d6391815918 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 1 Nov 2021 10:28:26 +0100 Subject: [PATCH 11/99] Schaffolded AdventureWorksDB context model --- .../SchaffoldedDBContext/Address.cs | 21 + .../SchaffoldedDBContext/AddressType.cs | 17 + .../AdventureWorksContext.cs | 1650 +++++++++++++++++ .../SchaffoldedDBContext/AwbuildVersion.cs | 17 + .../SchaffoldedDBContext/BillOfMaterials.cs | 22 + .../SchaffoldedDBContext/Contact.cs | 28 + .../SchaffoldedDBContext/ContactCreditCard.cs | 16 + .../SchaffoldedDBContext/ContactType.cs | 16 + .../SchaffoldedDBContext/CountryRegion.cs | 16 + .../CountryRegionCurrency.cs | 16 + .../SchaffoldedDBContext/CreditCard.cs | 19 + .../SchaffoldedDBContext/Culture.cs | 16 + .../SchaffoldedDBContext/Currency.cs | 16 + .../SchaffoldedDBContext/CurrencyRate.cs | 20 + .../SchaffoldedDBContext/Customer.cs | 19 + .../SchaffoldedDBContext/CustomerAddress.cs | 18 + .../SchaffoldedDBContext/DatabaseLog.cs | 21 + .../SchaffoldedDBContext/Department.cs | 17 + .../SchaffoldedDBContext/Document.cs | 23 + .../SchaffoldedDBContext/Employee.cs | 29 + .../SchaffoldedDBContext/EmployeeAddress.cs | 17 + .../EmployeeDepartmentHistory.cs | 19 + .../EmployeePayHistory.cs | 18 + .../SchaffoldedDBContext/ErrorLog.cs | 22 + .../SchaffoldedDBContext/Illustration.cs | 16 + .../SchaffoldedDBContext/Individual.cs | 17 + .../SchaffoldedDBContext/JobCandidate.cs | 17 + .../SchaffoldedDBContext/Location.cs | 18 + .../SchaffoldedDBContext/Product.cs | 38 + .../SchaffoldedDBContext/ProductCategory.cs | 17 + .../ProductCostHistory.cs | 18 + .../ProductDescription.cs | 17 + .../SchaffoldedDBContext/ProductDocument.cs | 16 + .../SchaffoldedDBContext/ProductInventory.cs | 20 + .../ProductListPriceHistory.cs | 18 + .../SchaffoldedDBContext/ProductModel.cs | 19 + .../ProductModelIllustration.cs | 16 + .../ProductModelProductDescriptionCulture.cs | 17 + .../SchaffoldedDBContext/ProductPhoto.cs | 19 + .../ProductProductPhoto.cs | 17 + .../SchaffoldedDBContext/ProductReview.cs | 21 + .../ProductSubcategory.cs | 18 + .../SchaffoldedDBContext/ProductVendor.cs | 24 + .../PurchaseOrderDetail.cs | 24 + .../PurchaseOrderHeader.cs | 26 + .../SchaffoldedDBContext/SalesOrderDetail.cs | 24 + .../SchaffoldedDBContext/SalesOrderHeader.cs | 40 + .../SalesOrderHeaderSalesReason.cs | 16 + .../SchaffoldedDBContext/SalesPerson.cs | 22 + .../SalesPersonQuotaHistory.cs | 18 + .../SchaffoldedDBContext/SalesReason.cs | 17 + .../SchaffoldedDBContext/SalesTaxRate.cs | 20 + .../SchaffoldedDBContext/SalesTerritory.cs | 23 + .../SalesTerritoryHistory.cs | 19 + .../SchaffoldedDBContext/ScrapReason.cs | 16 + .../SchaffoldedDBContext/Shift.cs | 18 + .../SchaffoldedDBContext/ShipMethod.cs | 19 + .../SchaffoldedDBContext/ShoppingCartItem.cs | 19 + .../SchaffoldedDBContext/SpecialOffer.cs | 24 + .../SpecialOfferProduct.cs | 17 + .../SchaffoldedDBContext/StateProvince.cs | 21 + .../SchaffoldedDBContext/Store.cs | 19 + .../SchaffoldedDBContext/StoreContact.cs | 18 + .../TransactionHistory.cs | 22 + .../TransactionHistoryArchive.cs | 22 + .../SchaffoldedDBContext/UnitMeasure.cs | 16 + .../SchaffoldedDBContext/Vendor.cs | 21 + .../SchaffoldedDBContext/VendorAddress.cs | 17 + .../SchaffoldedDBContext/VendorContact.cs | 17 + .../SchaffoldedDBContext/WorkOrder.cs | 23 + .../SchaffoldedDBContext/WorkOrderRouting.cs | 25 + 71 files changed, 3039 insertions(+) create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs new file mode 100644 index 000000000..7c79789d3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Address + { + public int AddressId { get; set; } + public string AddressLine1 { get; set; } + public string AddressLine2 { get; set; } + public string City { get; set; } + public int StateProvinceId { get; set; } + public string PostalCode { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs new file mode 100644 index 000000000..260f79d1f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class AddressType + { + public int AddressTypeId { get; set; } + public string Name { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs new file mode 100644 index 000000000..2ead7d0fe --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs @@ -0,0 +1,1650 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class AdventureWorksContext : DbContext + { + public AdventureWorksContext() + { + } + + public AdventureWorksContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet
Address { get; set; } + public virtual DbSet AddressType { get; set; } + public virtual DbSet AwbuildVersion { get; set; } + public virtual DbSet BillOfMaterials { get; set; } + public virtual DbSet Contact { get; set; } + public virtual DbSet ContactCreditCard { get; set; } + public virtual DbSet ContactType { get; set; } + public virtual DbSet CountryRegion { get; set; } + public virtual DbSet CountryRegionCurrency { get; set; } + public virtual DbSet CreditCard { get; set; } + public virtual DbSet Culture { get; set; } + public virtual DbSet Currency { get; set; } + public virtual DbSet CurrencyRate { get; set; } + public virtual DbSet Customer { get; set; } + public virtual DbSet CustomerAddress { get; set; } + public virtual DbSet DatabaseLog { get; set; } + public virtual DbSet Department { get; set; } + public virtual DbSet Document { get; set; } + public virtual DbSet Employee { get; set; } + public virtual DbSet EmployeeAddress { get; set; } + public virtual DbSet EmployeeDepartmentHistory { get; set; } + public virtual DbSet EmployeePayHistory { get; set; } + public virtual DbSet ErrorLog { get; set; } + public virtual DbSet Illustration { get; set; } + public virtual DbSet Individual { get; set; } + public virtual DbSet JobCandidate { get; set; } + public virtual DbSet Location { get; set; } + public virtual DbSet Product { get; set; } + public virtual DbSet ProductCategory { get; set; } + public virtual DbSet ProductCostHistory { get; set; } + public virtual DbSet ProductDescription { get; set; } + public virtual DbSet ProductDocument { get; set; } + public virtual DbSet ProductInventory { get; set; } + public virtual DbSet ProductListPriceHistory { get; set; } + public virtual DbSet ProductModel { get; set; } + public virtual DbSet ProductModelIllustration { get; set; } + public virtual DbSet ProductModelProductDescriptionCulture { get; set; } + public virtual DbSet ProductPhoto { get; set; } + public virtual DbSet ProductProductPhoto { get; set; } + public virtual DbSet ProductReview { get; set; } + public virtual DbSet ProductSubcategory { get; set; } + public virtual DbSet ProductVendor { get; set; } + public virtual DbSet PurchaseOrderDetail { get; set; } + public virtual DbSet PurchaseOrderHeader { get; set; } + public virtual DbSet SalesOrderDetail { get; set; } + public virtual DbSet SalesOrderHeader { get; set; } + public virtual DbSet SalesOrderHeaderSalesReason { get; set; } + public virtual DbSet SalesPerson { get; set; } + public virtual DbSet SalesPersonQuotaHistory { get; set; } + public virtual DbSet SalesReason { get; set; } + public virtual DbSet SalesTaxRate { get; set; } + public virtual DbSet SalesTerritory { get; set; } + public virtual DbSet SalesTerritoryHistory { get; set; } + public virtual DbSet ScrapReason { get; set; } + public virtual DbSet Shift { get; set; } + public virtual DbSet ShipMethod { get; set; } + public virtual DbSet ShoppingCartItem { get; set; } + public virtual DbSet SpecialOffer { get; set; } + public virtual DbSet SpecialOfferProduct { get; set; } + public virtual DbSet StateProvince { get; set; } + public virtual DbSet Store { get; set; } + public virtual DbSet StoreContact { get; set; } + public virtual DbSet TransactionHistory { get; set; } + public virtual DbSet TransactionHistoryArchive { get; set; } + public virtual DbSet UnitMeasure { get; set; } + public virtual DbSet Vendor { get; set; } + public virtual DbSet VendorAddress { get; set; } + public virtual DbSet VendorContact { get; set; } + public virtual DbSet WorkOrder { get; set; } + public virtual DbSet WorkOrderRouting { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + { +#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. + optionsBuilder.UseSqlServer("server=.\\SQLEXPRESS;initial catalog=AdventureWorks;Integrated Security=SSPI; MultipleActiveResultSets=true"); + } + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity
(entity => + { + entity.HasNoKey(); + + entity.ToTable("Address", "Person"); + + entity.Property(e => e.AddressId).HasColumnName("AddressID"); + + entity.Property(e => e.AddressLine1) + .IsRequired() + .HasMaxLength(60); + + entity.Property(e => e.AddressLine2).HasMaxLength(60); + + entity.Property(e => e.City) + .IsRequired() + .HasMaxLength(30); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.PostalCode) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.StateProvinceId).HasColumnName("StateProvinceID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("AddressType", "Person"); + + entity.Property(e => e.AddressTypeId).HasColumnName("AddressTypeID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("AWBuildVersion"); + + entity.Property(e => e.DatabaseVersion) + .IsRequired() + .HasColumnName("Database Version") + .HasMaxLength(25); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.SystemInformationId).HasColumnName("SystemInformationID"); + + entity.Property(e => e.VersionDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("BillOfMaterials", "Production"); + + entity.Property(e => e.BillOfMaterialsId).HasColumnName("BillOfMaterialsID"); + + entity.Property(e => e.Bomlevel).HasColumnName("BOMLevel"); + + entity.Property(e => e.ComponentId).HasColumnName("ComponentID"); + + entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.PerAssemblyQty).HasColumnType("decimal(8, 2)"); + + entity.Property(e => e.ProductAssemblyId).HasColumnName("ProductAssemblyID"); + + entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.UnitMeasureCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Contact", "Person"); + + entity.Property(e => e.AdditionalContactInfo).HasColumnType("xml"); + + entity.Property(e => e.ContactId).HasColumnName("ContactID"); + + entity.Property(e => e.EmailAddress).HasMaxLength(50); + + entity.Property(e => e.FirstName) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.LastName) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.MiddleName).HasMaxLength(50); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.PasswordHash) + .IsRequired() + .HasMaxLength(128) + .IsUnicode(false); + + entity.Property(e => e.PasswordSalt) + .IsRequired() + .HasMaxLength(10) + .IsUnicode(false); + + entity.Property(e => e.Phone).HasMaxLength(25); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.Suffix).HasMaxLength(10); + + entity.Property(e => e.Title).HasMaxLength(8); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ContactCreditCard", "Sales"); + + entity.Property(e => e.ContactId).HasColumnName("ContactID"); + + entity.Property(e => e.CreditCardId).HasColumnName("CreditCardID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ContactType", "Person"); + + entity.Property(e => e.ContactTypeId).HasColumnName("ContactTypeID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("CountryRegion", "Person"); + + entity.Property(e => e.CountryRegionCode) + .IsRequired() + .HasMaxLength(3); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("CountryRegionCurrency", "Sales"); + + entity.Property(e => e.CountryRegionCode) + .IsRequired() + .HasMaxLength(3); + + entity.Property(e => e.CurrencyCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("CreditCard", "Sales"); + + entity.Property(e => e.CardNumber) + .IsRequired() + .HasMaxLength(25); + + entity.Property(e => e.CardType) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.CreditCardId).HasColumnName("CreditCardID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Culture", "Production"); + + entity.Property(e => e.CultureId) + .IsRequired() + .HasColumnName("CultureID") + .HasMaxLength(6) + .IsFixedLength(); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Currency", "Sales"); + + entity.Property(e => e.CurrencyCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("CurrencyRate", "Sales"); + + entity.Property(e => e.AverageRate).HasColumnType("money"); + + entity.Property(e => e.CurrencyRateDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.CurrencyRateId).HasColumnName("CurrencyRateID"); + + entity.Property(e => e.EndOfDayRate).HasColumnType("money"); + + entity.Property(e => e.FromCurrencyCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ToCurrencyCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Customer", "Sales"); + + entity.Property(e => e.AccountNumber) + .IsRequired() + .HasMaxLength(10) + .IsUnicode(false); + + entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); + + entity.Property(e => e.CustomerType) + .IsRequired() + .HasMaxLength(1) + .IsFixedLength(); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("CustomerAddress", "Sales"); + + entity.Property(e => e.AddressId).HasColumnName("AddressID"); + + entity.Property(e => e.AddressTypeId).HasColumnName("AddressTypeID"); + + entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.DatabaseLogId).HasColumnName("DatabaseLogID"); + + entity.Property(e => e.DatabaseUser) + .IsRequired() + .HasMaxLength(128); + + entity.Property(e => e.Event) + .IsRequired() + .HasMaxLength(128); + + entity.Property(e => e.Object).HasMaxLength(128); + + entity.Property(e => e.PostTime).HasColumnType("smalldatetime"); + + entity.Property(e => e.Schema).HasMaxLength(128); + + entity.Property(e => e.Tsql) + .IsRequired() + .HasColumnName("TSQL"); + + entity.Property(e => e.XmlEvent) + .IsRequired() + .HasColumnType("xml"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Department", "HumanResources"); + + entity.Property(e => e.DepartmentId).HasColumnName("DepartmentID"); + + entity.Property(e => e.GroupName) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Document", "Production"); + + entity.Property(e => e.Document1).HasColumnName("Document"); + + entity.Property(e => e.DocumentId).HasColumnName("DocumentID"); + + entity.Property(e => e.FileExtension) + .IsRequired() + .HasMaxLength(8); + + entity.Property(e => e.FileName) + .IsRequired() + .HasMaxLength(400); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Revision) + .IsRequired() + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.Title) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Employee", "HumanResources"); + + entity.Property(e => e.BirthDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ContactId).HasColumnName("ContactID"); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.Gender) + .IsRequired() + .HasMaxLength(1) + .IsFixedLength(); + + entity.Property(e => e.HireDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.LoginId) + .IsRequired() + .HasColumnName("LoginID") + .HasMaxLength(256); + + entity.Property(e => e.ManagerId).HasColumnName("ManagerID"); + + entity.Property(e => e.MaritalStatus) + .IsRequired() + .HasMaxLength(1) + .IsFixedLength(); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.NationalIdnumber) + .IsRequired() + .HasColumnName("NationalIDNumber") + .HasMaxLength(15); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.Title) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("EmployeeAddress", "HumanResources"); + + entity.Property(e => e.AddressId).HasColumnName("AddressID"); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("EmployeeDepartmentHistory", "HumanResources"); + + entity.Property(e => e.DepartmentId).HasColumnName("DepartmentID"); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ShiftId).HasColumnName("ShiftID"); + + entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("EmployeePayHistory", "HumanResources"); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rate).HasColumnType("money"); + + entity.Property(e => e.RateChangeDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.ErrorLogId).HasColumnName("ErrorLogID"); + + entity.Property(e => e.ErrorMessage) + .IsRequired() + .HasMaxLength(4000); + + entity.Property(e => e.ErrorProcedure).HasMaxLength(126); + + entity.Property(e => e.ErrorTime).HasColumnType("smalldatetime"); + + entity.Property(e => e.UserName) + .IsRequired() + .HasMaxLength(128); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Illustration", "Production"); + + entity.Property(e => e.Diagram).HasColumnType("xml"); + + entity.Property(e => e.IllustrationId).HasColumnName("IllustrationID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Individual", "Sales"); + + entity.Property(e => e.ContactId).HasColumnName("ContactID"); + + entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); + + entity.Property(e => e.Demographics).HasColumnType("xml"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("JobCandidate", "HumanResources"); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.JobCandidateId).HasColumnName("JobCandidateID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Resume).HasColumnType("xml"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Location", "Production"); + + entity.Property(e => e.Availability).HasColumnType("decimal(8, 2)"); + + entity.Property(e => e.CostRate).HasColumnType("money"); + + entity.Property(e => e.LocationId).HasColumnName("LocationID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Product", "Production"); + + entity.Property(e => e.Class) + .HasMaxLength(2) + .IsFixedLength(); + + entity.Property(e => e.Color).HasMaxLength(15); + + entity.Property(e => e.DiscontinuedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ListPrice).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ProductLine) + .HasMaxLength(2) + .IsFixedLength(); + + entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); + + entity.Property(e => e.ProductNumber) + .IsRequired() + .HasMaxLength(25); + + entity.Property(e => e.ProductSubcategoryId).HasColumnName("ProductSubcategoryID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SellEndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.SellStartDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Size).HasMaxLength(5); + + entity.Property(e => e.SizeUnitMeasureCode) + .HasMaxLength(3) + .IsFixedLength(); + + entity.Property(e => e.StandardCost).HasColumnType("money"); + + entity.Property(e => e.Style) + .HasMaxLength(2) + .IsFixedLength(); + + entity.Property(e => e.Weight).HasColumnType("decimal(8, 2)"); + + entity.Property(e => e.WeightUnitMeasureCode) + .HasMaxLength(3) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductCategory", "Production"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ProductCategoryId).HasColumnName("ProductCategoryID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductCostHistory", "Production"); + + entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.StandardCost).HasColumnType("money"); + + entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductDescription", "Production"); + + entity.Property(e => e.Description) + .IsRequired() + .HasMaxLength(400); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductDescriptionId).HasColumnName("ProductDescriptionID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductDocument", "Production"); + + entity.Property(e => e.DocumentId).HasColumnName("DocumentID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductInventory", "Production"); + + entity.Property(e => e.LocationId).HasColumnName("LocationID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.Shelf) + .IsRequired() + .HasMaxLength(10); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductListPriceHistory", "Production"); + + entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ListPrice).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductModel", "Production"); + + entity.Property(e => e.CatalogDescription).HasColumnType("xml"); + + entity.Property(e => e.Instructions).HasColumnType("xml"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductModelIllustration", "Production"); + + entity.Property(e => e.IllustrationId).HasColumnName("IllustrationID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductModelProductDescriptionCulture", "Production"); + + entity.Property(e => e.CultureId) + .IsRequired() + .HasColumnName("CultureID") + .HasMaxLength(6) + .IsFixedLength(); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductDescriptionId).HasColumnName("ProductDescriptionID"); + + entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductPhoto", "Production"); + + entity.Property(e => e.LargePhotoFileName).HasMaxLength(50); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductPhotoId).HasColumnName("ProductPhotoID"); + + entity.Property(e => e.ThumbnailPhotoFileName).HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductProductPhoto", "Production"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ProductPhotoId).HasColumnName("ProductPhotoID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductReview", "Production"); + + entity.Property(e => e.Comments).HasMaxLength(3850); + + entity.Property(e => e.EmailAddress) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ProductReviewId).HasColumnName("ProductReviewID"); + + entity.Property(e => e.ReviewDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ReviewerName) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductSubcategory", "Production"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ProductCategoryId).HasColumnName("ProductCategoryID"); + + entity.Property(e => e.ProductSubcategoryId).HasColumnName("ProductSubcategoryID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ProductVendor", "Purchasing"); + + entity.Property(e => e.LastReceiptCost).HasColumnType("money"); + + entity.Property(e => e.LastReceiptDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.StandardPrice).HasColumnType("money"); + + entity.Property(e => e.UnitMeasureCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + + entity.Property(e => e.VendorId).HasColumnName("VendorID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("PurchaseOrderDetail", "Purchasing"); + + entity.Property(e => e.DueDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.LineTotal).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.PurchaseOrderDetailId).HasColumnName("PurchaseOrderDetailID"); + + entity.Property(e => e.PurchaseOrderId).HasColumnName("PurchaseOrderID"); + + entity.Property(e => e.ReceivedQty).HasColumnType("decimal(8, 2)"); + + entity.Property(e => e.RejectedQty).HasColumnType("decimal(8, 2)"); + + entity.Property(e => e.StockedQty).HasColumnType("decimal(9, 2)"); + + entity.Property(e => e.UnitPrice).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("PurchaseOrderHeader", "Purchasing"); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.Freight).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.OrderDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.PurchaseOrderId).HasColumnName("PurchaseOrderID"); + + entity.Property(e => e.ShipDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ShipMethodId).HasColumnName("ShipMethodID"); + + entity.Property(e => e.SubTotal).HasColumnType("money"); + + entity.Property(e => e.TaxAmt).HasColumnType("money"); + + entity.Property(e => e.TotalDue).HasColumnType("money"); + + entity.Property(e => e.VendorId).HasColumnName("VendorID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesOrderDetail", "Sales"); + + entity.Property(e => e.CarrierTrackingNumber).HasMaxLength(25); + + entity.Property(e => e.LineTotal).HasColumnType("decimal(38, 6)"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesOrderDetailId).HasColumnName("SalesOrderDetailID"); + + entity.Property(e => e.SalesOrderId).HasColumnName("SalesOrderID"); + + entity.Property(e => e.SpecialOfferId).HasColumnName("SpecialOfferID"); + + entity.Property(e => e.UnitPrice).HasColumnType("money"); + + entity.Property(e => e.UnitPriceDiscount).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesOrderHeader", "Sales"); + + entity.Property(e => e.AccountNumber).HasMaxLength(15); + + entity.Property(e => e.BillToAddressId).HasColumnName("BillToAddressID"); + + entity.Property(e => e.Comment).HasMaxLength(128); + + entity.Property(e => e.ContactId).HasColumnName("ContactID"); + + entity.Property(e => e.CreditCardApprovalCode) + .HasMaxLength(15) + .IsUnicode(false); + + entity.Property(e => e.CreditCardId).HasColumnName("CreditCardID"); + + entity.Property(e => e.CurrencyRateId).HasColumnName("CurrencyRateID"); + + entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); + + entity.Property(e => e.DueDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Freight).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.OrderDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.PurchaseOrderNumber).HasMaxLength(25); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesOrderId).HasColumnName("SalesOrderID"); + + entity.Property(e => e.SalesOrderNumber) + .IsRequired() + .HasMaxLength(25); + + entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); + + entity.Property(e => e.ShipDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ShipMethodId).HasColumnName("ShipMethodID"); + + entity.Property(e => e.ShipToAddressId).HasColumnName("ShipToAddressID"); + + entity.Property(e => e.SubTotal).HasColumnType("money"); + + entity.Property(e => e.TaxAmt).HasColumnType("money"); + + entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); + + entity.Property(e => e.TotalDue).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesOrderHeaderSalesReason", "Sales"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.SalesOrderId).HasColumnName("SalesOrderID"); + + entity.Property(e => e.SalesReasonId).HasColumnName("SalesReasonID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesPerson", "Sales"); + + entity.Property(e => e.Bonus).HasColumnType("money"); + + entity.Property(e => e.CommissionPct).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesLastYear).HasColumnType("money"); + + entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); + + entity.Property(e => e.SalesQuota).HasColumnType("money"); + + entity.Property(e => e.SalesYtd) + .HasColumnName("SalesYTD") + .HasColumnType("money"); + + entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesPersonQuotaHistory", "Sales"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.QuotaDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); + + entity.Property(e => e.SalesQuota).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesReason", "Sales"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ReasonType) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.SalesReasonId).HasColumnName("SalesReasonID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesTaxRate", "Sales"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesTaxRateId).HasColumnName("SalesTaxRateID"); + + entity.Property(e => e.StateProvinceId).HasColumnName("StateProvinceID"); + + entity.Property(e => e.TaxRate).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesTerritory", "Sales"); + + entity.Property(e => e.CostLastYear).HasColumnType("money"); + + entity.Property(e => e.CostYtd) + .HasColumnName("CostYTD") + .HasColumnType("money"); + + entity.Property(e => e.CountryRegionCode) + .IsRequired() + .HasMaxLength(3); + + entity.Property(e => e.Group) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesLastYear).HasColumnType("money"); + + entity.Property(e => e.SalesYtd) + .HasColumnName("SalesYTD") + .HasColumnType("money"); + + entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SalesTerritoryHistory", "Sales"); + + entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); + + entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ScrapReason", "Production"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ScrapReasonId).HasColumnName("ScrapReasonID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Shift", "HumanResources"); + + entity.Property(e => e.EndTime).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.ShiftId).HasColumnName("ShiftID"); + + entity.Property(e => e.StartTime).HasColumnType("smalldatetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ShipMethod", "Purchasing"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.ShipBase).HasColumnType("money"); + + entity.Property(e => e.ShipMethodId).HasColumnName("ShipMethodID"); + + entity.Property(e => e.ShipRate).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("ShoppingCartItem", "Sales"); + + entity.Property(e => e.DateCreated).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ShoppingCartId) + .IsRequired() + .HasColumnName("ShoppingCartID") + .HasMaxLength(50); + + entity.Property(e => e.ShoppingCartItemId).HasColumnName("ShoppingCartItemID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SpecialOffer", "Sales"); + + entity.Property(e => e.Category) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Description) + .IsRequired() + .HasMaxLength(255); + + entity.Property(e => e.DiscountPct).HasColumnType("money"); + + entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SpecialOfferId).HasColumnName("SpecialOfferID"); + + entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Type) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("SpecialOfferProduct", "Sales"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SpecialOfferId).HasColumnName("SpecialOfferID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("StateProvince", "Person"); + + entity.Property(e => e.CountryRegionCode) + .IsRequired() + .HasMaxLength(3); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.StateProvinceCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + + entity.Property(e => e.StateProvinceId).HasColumnName("StateProvinceID"); + + entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Store", "Sales"); + + entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); + + entity.Property(e => e.Demographics).HasColumnType("xml"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + + entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("StoreContact", "Sales"); + + entity.Property(e => e.ContactId).HasColumnName("ContactID"); + + entity.Property(e => e.ContactTypeId).HasColumnName("ContactTypeID"); + + entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Rowguid).HasColumnName("rowguid"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TransactionHistory", "Production"); + + entity.Property(e => e.ActualCost).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ReferenceOrderId).HasColumnName("ReferenceOrderID"); + + entity.Property(e => e.ReferenceOrderLineId).HasColumnName("ReferenceOrderLineID"); + + entity.Property(e => e.TransactionDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.TransactionId).HasColumnName("TransactionID"); + + entity.Property(e => e.TransactionType) + .IsRequired() + .HasMaxLength(1) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("TransactionHistoryArchive", "Production"); + + entity.Property(e => e.ActualCost).HasColumnType("money"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ReferenceOrderId).HasColumnName("ReferenceOrderID"); + + entity.Property(e => e.ReferenceOrderLineId).HasColumnName("ReferenceOrderLineID"); + + entity.Property(e => e.TransactionDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.TransactionId).HasColumnName("TransactionID"); + + entity.Property(e => e.TransactionType) + .IsRequired() + .HasMaxLength(1) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("UnitMeasure", "Production"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.UnitMeasureCode) + .IsRequired() + .HasMaxLength(3) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("Vendor", "Purchasing"); + + entity.Property(e => e.AccountNumber) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.Name) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.PurchasingWebServiceUrl) + .HasColumnName("PurchasingWebServiceURL") + .HasMaxLength(1024); + + entity.Property(e => e.VendorId).HasColumnName("VendorID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("VendorAddress", "Purchasing"); + + entity.Property(e => e.AddressId).HasColumnName("AddressID"); + + entity.Property(e => e.AddressTypeId).HasColumnName("AddressTypeID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.VendorId).HasColumnName("VendorID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("VendorContact", "Purchasing"); + + entity.Property(e => e.ContactId).HasColumnName("ContactID"); + + entity.Property(e => e.ContactTypeId).HasColumnName("ContactTypeID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.VendorId).HasColumnName("VendorID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("WorkOrder", "Production"); + + entity.Property(e => e.DueDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ScrapReasonId).HasColumnName("ScrapReasonID"); + + entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.WorkOrderId).HasColumnName("WorkOrderID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToTable("WorkOrderRouting", "Production"); + + entity.Property(e => e.ActualCost).HasColumnType("money"); + + entity.Property(e => e.ActualEndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ActualResourceHrs).HasColumnType("decimal(9, 4)"); + + entity.Property(e => e.ActualStartDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.LocationId).HasColumnName("LocationID"); + + entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.PlannedCost).HasColumnType("money"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ScheduledEndDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.ScheduledStartDate).HasColumnType("smalldatetime"); + + entity.Property(e => e.WorkOrderId).HasColumnName("WorkOrderID"); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs new file mode 100644 index 000000000..1c304eda0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class AwbuildVersion + { + public byte SystemInformationId { get; set; } + public string DatabaseVersion { get; set; } + public DateTime VersionDate { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs new file mode 100644 index 000000000..cb5b488bd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class BillOfMaterials + { + public int BillOfMaterialsId { get; set; } + public int? ProductAssemblyId { get; set; } + public int ComponentId { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public string UnitMeasureCode { get; set; } + public short Bomlevel { get; set; } + public decimal PerAssemblyQty { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs new file mode 100644 index 000000000..4c4cb642b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Contact + { + public int ContactId { get; set; } + public bool NameStyle { get; set; } + public string Title { get; set; } + public string FirstName { get; set; } + public string MiddleName { get; set; } + public string LastName { get; set; } + public string Suffix { get; set; } + public string EmailAddress { get; set; } + public int EmailPromotion { get; set; } + public string Phone { get; set; } + public string PasswordHash { get; set; } + public string PasswordSalt { get; set; } + public string AdditionalContactInfo { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs new file mode 100644 index 000000000..3049656ca --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ContactCreditCard + { + public int ContactId { get; set; } + public int CreditCardId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs new file mode 100644 index 000000000..6b2999c99 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ContactType + { + public int ContactTypeId { get; set; } + public string Name { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs new file mode 100644 index 000000000..70594938b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class CountryRegion + { + public string CountryRegionCode { get; set; } + public string Name { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs new file mode 100644 index 000000000..0c3ba99b0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class CountryRegionCurrency + { + public string CountryRegionCode { get; set; } + public string CurrencyCode { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs new file mode 100644 index 000000000..be7e81ef9 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class CreditCard + { + public int CreditCardId { get; set; } + public string CardType { get; set; } + public string CardNumber { get; set; } + public byte ExpMonth { get; set; } + public short ExpYear { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs new file mode 100644 index 000000000..395eedafd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Culture + { + public string CultureId { get; set; } + public string Name { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs new file mode 100644 index 000000000..751aeb353 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Currency + { + public string CurrencyCode { get; set; } + public string Name { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs new file mode 100644 index 000000000..6f040e3cd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class CurrencyRate + { + public int CurrencyRateId { get; set; } + public DateTime CurrencyRateDate { get; set; } + public string FromCurrencyCode { get; set; } + public string ToCurrencyCode { get; set; } + public decimal AverageRate { get; set; } + public decimal EndOfDayRate { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs new file mode 100644 index 000000000..1629c56e9 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Customer + { + public int CustomerId { get; set; } + public int? TerritoryId { get; set; } + public string AccountNumber { get; set; } + public string CustomerType { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs new file mode 100644 index 000000000..a01000ea6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class CustomerAddress + { + public int CustomerId { get; set; } + public int AddressId { get; set; } + public int AddressTypeId { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs new file mode 100644 index 000000000..d734532fd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class DatabaseLog + { + public int DatabaseLogId { get; set; } + public DateTime PostTime { get; set; } + public string DatabaseUser { get; set; } + public string Event { get; set; } + public string Schema { get; set; } + public string Object { get; set; } + public string Tsql { get; set; } + public string XmlEvent { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs new file mode 100644 index 000000000..55b318a06 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Department + { + public short DepartmentId { get; set; } + public string Name { get; set; } + public string GroupName { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs new file mode 100644 index 000000000..1f5208bb8 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Document + { + public int DocumentId { get; set; } + public string Title { get; set; } + public string FileName { get; set; } + public string FileExtension { get; set; } + public string Revision { get; set; } + public int ChangeNumber { get; set; } + public byte Status { get; set; } + public string DocumentSummary { get; set; } + public byte[] Document1 { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs new file mode 100644 index 000000000..04a0120de --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Employee + { + public int EmployeeId { get; set; } + public string NationalIdnumber { get; set; } + public int ContactId { get; set; } + public string LoginId { get; set; } + public int? ManagerId { get; set; } + public string Title { get; set; } + public DateTime BirthDate { get; set; } + public string MaritalStatus { get; set; } + public string Gender { get; set; } + public DateTime HireDate { get; set; } + public bool SalariedFlag { get; set; } + public short VacationHours { get; set; } + public short SickLeaveHours { get; set; } + public bool CurrentFlag { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs new file mode 100644 index 000000000..b9356b549 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class EmployeeAddress + { + public int EmployeeId { get; set; } + public int AddressId { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs new file mode 100644 index 000000000..f3754a757 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class EmployeeDepartmentHistory + { + public int EmployeeId { get; set; } + public short DepartmentId { get; set; } + public byte ShiftId { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs new file mode 100644 index 000000000..ca40a7249 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class EmployeePayHistory + { + public int EmployeeId { get; set; } + public DateTime RateChangeDate { get; set; } + public decimal Rate { get; set; } + public byte PayFrequency { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs new file mode 100644 index 000000000..0fc388d19 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ErrorLog + { + public int ErrorLogId { get; set; } + public DateTime ErrorTime { get; set; } + public string UserName { get; set; } + public int ErrorNumber { get; set; } + public int? ErrorSeverity { get; set; } + public int? ErrorState { get; set; } + public string ErrorProcedure { get; set; } + public int? ErrorLine { get; set; } + public string ErrorMessage { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs new file mode 100644 index 000000000..a2de1c1f6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Illustration + { + public int IllustrationId { get; set; } + public string Diagram { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs new file mode 100644 index 000000000..be419348e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Individual + { + public int CustomerId { get; set; } + public int ContactId { get; set; } + public string Demographics { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs new file mode 100644 index 000000000..9469292ef --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class JobCandidate + { + public int JobCandidateId { get; set; } + public int? EmployeeId { get; set; } + public string Resume { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs new file mode 100644 index 000000000..c2f0f18ee --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Location + { + public short LocationId { get; set; } + public string Name { get; set; } + public decimal CostRate { get; set; } + public decimal Availability { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs new file mode 100644 index 000000000..dc001c182 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Product + { + public int ProductId { get; set; } + public string Name { get; set; } + public string ProductNumber { get; set; } + public bool MakeFlag { get; set; } + public bool FinishedGoodsFlag { get; set; } + public string Color { get; set; } + public short SafetyStockLevel { get; set; } + public short ReorderPoint { get; set; } + public decimal StandardCost { get; set; } + public decimal ListPrice { get; set; } + public string Size { get; set; } + public string SizeUnitMeasureCode { get; set; } + public string WeightUnitMeasureCode { get; set; } + public decimal? Weight { get; set; } + public int DaysToManufacture { get; set; } + public string ProductLine { get; set; } + public string Class { get; set; } + public string Style { get; set; } + public int? ProductSubcategoryId { get; set; } + public int? ProductModelId { get; set; } + public DateTime SellStartDate { get; set; } + public DateTime? SellEndDate { get; set; } + public DateTime? DiscontinuedDate { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs new file mode 100644 index 000000000..4825e9326 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductCategory + { + public int ProductCategoryId { get; set; } + public string Name { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs new file mode 100644 index 000000000..59144c070 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductCostHistory + { + public int ProductId { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public decimal StandardCost { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs new file mode 100644 index 000000000..b5a2ae54e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductDescription + { + public int ProductDescriptionId { get; set; } + public string Description { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs new file mode 100644 index 000000000..a1f29ce42 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductDocument + { + public int ProductId { get; set; } + public int DocumentId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs new file mode 100644 index 000000000..0742311f4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductInventory + { + public int ProductId { get; set; } + public short LocationId { get; set; } + public string Shelf { get; set; } + public byte Bin { get; set; } + public short Quantity { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs new file mode 100644 index 000000000..9f29ed85e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductListPriceHistory + { + public int ProductId { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public decimal ListPrice { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs new file mode 100644 index 000000000..120c18eac --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductModel + { + public int ProductModelId { get; set; } + public string Name { get; set; } + public string CatalogDescription { get; set; } + public string Instructions { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs new file mode 100644 index 000000000..25d7b74ba --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductModelIllustration + { + public int ProductModelId { get; set; } + public int IllustrationId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs new file mode 100644 index 000000000..a4a25d746 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductModelProductDescriptionCulture + { + public int ProductModelId { get; set; } + public int ProductDescriptionId { get; set; } + public string CultureId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs new file mode 100644 index 000000000..b987825e0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductPhoto + { + public int ProductPhotoId { get; set; } + public byte[] ThumbNailPhoto { get; set; } + public string ThumbnailPhotoFileName { get; set; } + public byte[] LargePhoto { get; set; } + public string LargePhotoFileName { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs new file mode 100644 index 000000000..bbb901830 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductProductPhoto + { + public int ProductId { get; set; } + public int ProductPhotoId { get; set; } + public bool Primary { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs new file mode 100644 index 000000000..68204a38e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductReview + { + public int ProductReviewId { get; set; } + public int ProductId { get; set; } + public string ReviewerName { get; set; } + public DateTime ReviewDate { get; set; } + public string EmailAddress { get; set; } + public int Rating { get; set; } + public string Comments { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs new file mode 100644 index 000000000..5dc09007f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductSubcategory + { + public int ProductSubcategoryId { get; set; } + public int ProductCategoryId { get; set; } + public string Name { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs new file mode 100644 index 000000000..0f474f998 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ProductVendor + { + public int ProductId { get; set; } + public int VendorId { get; set; } + public int AverageLeadTime { get; set; } + public decimal StandardPrice { get; set; } + public decimal? LastReceiptCost { get; set; } + public DateTime? LastReceiptDate { get; set; } + public int MinOrderQty { get; set; } + public int MaxOrderQty { get; set; } + public int? OnOrderQty { get; set; } + public string UnitMeasureCode { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs new file mode 100644 index 000000000..1b68f8755 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class PurchaseOrderDetail + { + public int PurchaseOrderId { get; set; } + public int PurchaseOrderDetailId { get; set; } + public DateTime DueDate { get; set; } + public short OrderQty { get; set; } + public int ProductId { get; set; } + public decimal UnitPrice { get; set; } + public decimal LineTotal { get; set; } + public decimal ReceivedQty { get; set; } + public decimal RejectedQty { get; set; } + public decimal StockedQty { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs new file mode 100644 index 000000000..bae5ccb70 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class PurchaseOrderHeader + { + public int PurchaseOrderId { get; set; } + public byte RevisionNumber { get; set; } + public byte Status { get; set; } + public int EmployeeId { get; set; } + public int VendorId { get; set; } + public int ShipMethodId { get; set; } + public DateTime OrderDate { get; set; } + public DateTime? ShipDate { get; set; } + public decimal SubTotal { get; set; } + public decimal TaxAmt { get; set; } + public decimal Freight { get; set; } + public decimal TotalDue { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs new file mode 100644 index 000000000..ad4f589b0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesOrderDetail + { + public int SalesOrderId { get; set; } + public int SalesOrderDetailId { get; set; } + public string CarrierTrackingNumber { get; set; } + public short OrderQty { get; set; } + public int ProductId { get; set; } + public int SpecialOfferId { get; set; } + public decimal UnitPrice { get; set; } + public decimal UnitPriceDiscount { get; set; } + public decimal LineTotal { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs new file mode 100644 index 000000000..061ecac26 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesOrderHeader + { + public int SalesOrderId { get; set; } + public byte RevisionNumber { get; set; } + public DateTime OrderDate { get; set; } + public DateTime DueDate { get; set; } + public DateTime? ShipDate { get; set; } + public byte Status { get; set; } + public bool OnlineOrderFlag { get; set; } + public string SalesOrderNumber { get; set; } + public string PurchaseOrderNumber { get; set; } + public string AccountNumber { get; set; } + public int CustomerId { get; set; } + public int ContactId { get; set; } + public int? SalesPersonId { get; set; } + public int? TerritoryId { get; set; } + public int BillToAddressId { get; set; } + public int ShipToAddressId { get; set; } + public int ShipMethodId { get; set; } + public int? CreditCardId { get; set; } + public string CreditCardApprovalCode { get; set; } + public int? CurrencyRateId { get; set; } + public decimal SubTotal { get; set; } + public decimal TaxAmt { get; set; } + public decimal Freight { get; set; } + public decimal TotalDue { get; set; } + public string Comment { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs new file mode 100644 index 000000000..5cccca30c --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesOrderHeaderSalesReason + { + public int SalesOrderId { get; set; } + public int SalesReasonId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs new file mode 100644 index 000000000..5b3abbb96 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesPerson + { + public int SalesPersonId { get; set; } + public int? TerritoryId { get; set; } + public decimal? SalesQuota { get; set; } + public decimal Bonus { get; set; } + public decimal CommissionPct { get; set; } + public decimal SalesYtd { get; set; } + public decimal SalesLastYear { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs new file mode 100644 index 000000000..a6f36e951 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesPersonQuotaHistory + { + public int SalesPersonId { get; set; } + public DateTime QuotaDate { get; set; } + public decimal SalesQuota { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs new file mode 100644 index 000000000..87d71b82e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesReason + { + public int SalesReasonId { get; set; } + public string Name { get; set; } + public string ReasonType { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs new file mode 100644 index 000000000..7bef868d3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesTaxRate + { + public int SalesTaxRateId { get; set; } + public int StateProvinceId { get; set; } + public byte TaxType { get; set; } + public decimal TaxRate { get; set; } + public string Name { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs new file mode 100644 index 000000000..3bc94c216 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesTerritory + { + public int TerritoryId { get; set; } + public string Name { get; set; } + public string CountryRegionCode { get; set; } + public string Group { get; set; } + public decimal SalesYtd { get; set; } + public decimal SalesLastYear { get; set; } + public decimal CostYtd { get; set; } + public decimal CostLastYear { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs new file mode 100644 index 000000000..ca422aaca --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SalesTerritoryHistory + { + public int SalesPersonId { get; set; } + public int TerritoryId { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs new file mode 100644 index 000000000..f9a07d12d --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ScrapReason + { + public short ScrapReasonId { get; set; } + public string Name { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs new file mode 100644 index 000000000..9ee9de0fb --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Shift + { + public byte ShiftId { get; set; } + public string Name { get; set; } + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs new file mode 100644 index 000000000..b7da1848b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ShipMethod + { + public int ShipMethodId { get; set; } + public string Name { get; set; } + public decimal ShipBase { get; set; } + public decimal ShipRate { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs new file mode 100644 index 000000000..ca955dd89 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class ShoppingCartItem + { + public int ShoppingCartItemId { get; set; } + public string ShoppingCartId { get; set; } + public int Quantity { get; set; } + public int ProductId { get; set; } + public DateTime DateCreated { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs new file mode 100644 index 000000000..52997f238 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SpecialOffer + { + public int SpecialOfferId { get; set; } + public string Description { get; set; } + public decimal DiscountPct { get; set; } + public string Type { get; set; } + public string Category { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public int MinQty { get; set; } + public int? MaxQty { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs new file mode 100644 index 000000000..eb45793ef --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class SpecialOfferProduct + { + public int SpecialOfferId { get; set; } + public int ProductId { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs new file mode 100644 index 000000000..971201581 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class StateProvince + { + public int StateProvinceId { get; set; } + public string StateProvinceCode { get; set; } + public string CountryRegionCode { get; set; } + public bool IsOnlyStateProvinceFlag { get; set; } + public string Name { get; set; } + public int TerritoryId { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs new file mode 100644 index 000000000..3fc31a422 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Store + { + public int CustomerId { get; set; } + public string Name { get; set; } + public int? SalesPersonId { get; set; } + public string Demographics { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs new file mode 100644 index 000000000..7aafbb8b1 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class StoreContact + { + public int CustomerId { get; set; } + public int ContactId { get; set; } + public int ContactTypeId { get; set; } + public Guid Rowguid { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs new file mode 100644 index 000000000..283839e5f --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class TransactionHistory + { + public int TransactionId { get; set; } + public int ProductId { get; set; } + public int ReferenceOrderId { get; set; } + public int ReferenceOrderLineId { get; set; } + public DateTime TransactionDate { get; set; } + public string TransactionType { get; set; } + public int Quantity { get; set; } + public decimal ActualCost { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs new file mode 100644 index 000000000..9e34fc616 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class TransactionHistoryArchive + { + public int TransactionId { get; set; } + public int ProductId { get; set; } + public int ReferenceOrderId { get; set; } + public int ReferenceOrderLineId { get; set; } + public DateTime TransactionDate { get; set; } + public string TransactionType { get; set; } + public int Quantity { get; set; } + public decimal ActualCost { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs new file mode 100644 index 000000000..0d39f4f21 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class UnitMeasure + { + public string UnitMeasureCode { get; set; } + public string Name { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs new file mode 100644 index 000000000..93ac45efa --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class Vendor + { + public int VendorId { get; set; } + public string AccountNumber { get; set; } + public string Name { get; set; } + public byte CreditRating { get; set; } + public bool PreferredVendorStatus { get; set; } + public bool ActiveFlag { get; set; } + public string PurchasingWebServiceUrl { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs new file mode 100644 index 000000000..8566384d6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class VendorAddress + { + public int VendorId { get; set; } + public int AddressId { get; set; } + public int AddressTypeId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs new file mode 100644 index 000000000..788a9633a --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class VendorContact + { + public int VendorId { get; set; } + public int ContactId { get; set; } + public int ContactTypeId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs new file mode 100644 index 000000000..2c7c45bcd --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class WorkOrder + { + public int WorkOrderId { get; set; } + public int ProductId { get; set; } + public int OrderQty { get; set; } + public int StockedQty { get; set; } + public short ScrappedQty { get; set; } + public DateTime StartDate { get; set; } + public DateTime? EndDate { get; set; } + public DateTime DueDate { get; set; } + public short? ScrapReasonId { get; set; } + public DateTime ModifiedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs new file mode 100644 index 000000000..d126686a3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels +{ + public partial class WorkOrderRouting + { + public int WorkOrderId { get; set; } + public int ProductId { get; set; } + public short OperationSequence { get; set; } + public short LocationId { get; set; } + public DateTime ScheduledStartDate { get; set; } + public DateTime ScheduledEndDate { get; set; } + public DateTime? ActualStartDate { get; set; } + public DateTime? ActualEndDate { get; set; } + public decimal? ActualResourceHrs { get; set; } + public decimal PlannedCost { get; set; } + public decimal? ActualCost { get; set; } + public DateTime ModifiedDate { get; set; } + } +} From 8a91c929acd527250e5ea564d067d57050fda55f Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 1 Nov 2021 10:38:59 +0100 Subject: [PATCH 12/99] Namespace rename --- .../AdventureWorks/SchaffoldedDBContext/Address.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/AddressType.cs | 2 +- .../SchaffoldedDBContext/AdventureWorksContext.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Contact.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ContactType.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/CountryRegion.cs | 2 +- .../SchaffoldedDBContext/CountryRegionCurrency.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/CreditCard.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Culture.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Currency.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Customer.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Department.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Document.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Employee.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs | 2 +- .../SchaffoldedDBContext/EmployeeDepartmentHistory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ErrorLog.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Illustration.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Individual.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/JobCandidate.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Location.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Product.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductCategory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductDescription.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductDocument.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductInventory.cs | 2 +- .../SchaffoldedDBContext/ProductListPriceHistory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductModel.cs | 2 +- .../SchaffoldedDBContext/ProductModelIllustration.cs | 2 +- .../ProductModelProductDescriptionCulture.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductReview.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ProductVendor.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs | 2 +- .../SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SalesPerson.cs | 2 +- .../SchaffoldedDBContext/SalesPersonQuotaHistory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SalesReason.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs | 2 +- .../SchaffoldedDBContext/SalesTerritoryHistory.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ScrapReason.cs | 2 +- .../DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ShipMethod.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/StateProvince.cs | 2 +- .../DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/StoreContact.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs | 2 +- .../SchaffoldedDBContext/TransactionHistoryArchive.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/Vendor.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/VendorAddress.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/VendorContact.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/WorkOrder.cs | 2 +- .../AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs | 2 +- 71 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs index 7c79789d3..c28036d8e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Address { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs index 260f79d1f..881901218 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class AddressType { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs index 2ead7d0fe..9413423c5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs @@ -6,7 +6,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class AdventureWorksContext : DbContext { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs index 1c304eda0..9cfc4ade7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class AwbuildVersion { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs index cb5b488bd..33c5845bd 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class BillOfMaterials { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs index 4c4cb642b..cd5266387 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Contact { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs index 3049656ca..6e72c1c7e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ContactCreditCard { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs index 6b2999c99..8bdef5e5a 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ContactType { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs index 70594938b..c7db43c15 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class CountryRegion { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs index 0c3ba99b0..f2b16a6f3 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class CountryRegionCurrency { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs index be7e81ef9..9568e479d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class CreditCard { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs index 395eedafd..fd7a54abe 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Culture { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs index 751aeb353..dd385f47d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Currency { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs index 6f040e3cd..fcb462acb 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class CurrencyRate { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs index 1629c56e9..e012d0f07 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Customer { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs index a01000ea6..eb85bfbf2 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class CustomerAddress { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs index d734532fd..cb135fbea 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class DatabaseLog { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs index 55b318a06..fea2fc559 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Department { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs index 1f5208bb8..c23b23e1a 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Document { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs index 04a0120de..65e74b7ed 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Employee { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs index b9356b549..093646ffc 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class EmployeeAddress { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs index f3754a757..7c2730d02 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class EmployeeDepartmentHistory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs index ca40a7249..18259bcfe 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class EmployeePayHistory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs index 0fc388d19..76001e731 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ErrorLog { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs index a2de1c1f6..80d5ad5ef 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Illustration { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs index be419348e..143cb7da7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Individual { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs index 9469292ef..34265cae5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class JobCandidate { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs index c2f0f18ee..59ae6c23c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Location { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs index dc001c182..e5c4ae392 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Product { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs index 4825e9326..540b65a6b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductCategory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs index 59144c070..e1e4940ca 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductCostHistory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs index b5a2ae54e..9060c00bd 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductDescription { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs index a1f29ce42..2cd941ab5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductDocument { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs index 0742311f4..15b63db30 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductInventory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs index 9f29ed85e..17b4d1502 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductListPriceHistory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs index 120c18eac..88c5db791 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductModel { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs index 25d7b74ba..6bcfae994 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductModelIllustration { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs index a4a25d746..9c27a78c7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductModelProductDescriptionCulture { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs index b987825e0..658c53192 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductPhoto { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs index bbb901830..b3a64c241 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductProductPhoto { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs index 68204a38e..ffa217f97 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductReview { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs index 5dc09007f..819598573 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductSubcategory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs index 0f474f998..acfaf08cc 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ProductVendor { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs index 1b68f8755..5ec016b66 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class PurchaseOrderDetail { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs index bae5ccb70..000474db6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class PurchaseOrderHeader { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs index ad4f589b0..ff1a8d87d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesOrderDetail { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs index 061ecac26..3359da3a9 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesOrderHeader { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs index 5cccca30c..b90d09600 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesOrderHeaderSalesReason { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs index 5b3abbb96..6c6ce70fc 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesPerson { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs index a6f36e951..71a86f8de 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesPersonQuotaHistory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs index 87d71b82e..2a8bba75c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesReason { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs index 7bef868d3..b9e75510c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesTaxRate { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs index 3bc94c216..59f2a597c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesTerritory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs index ca422aaca..f01dfbbb2 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SalesTerritoryHistory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs index f9a07d12d..0e1617233 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ScrapReason { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs index 9ee9de0fb..c4c2477b0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Shift { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs index b7da1848b..91fd29f29 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ShipMethod { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs index ca955dd89..e94927892 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class ShoppingCartItem { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs index 52997f238..fad2136e9 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SpecialOffer { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs index eb45793ef..b2b986468 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class SpecialOfferProduct { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs index 971201581..1494d60f8 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class StateProvince { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs index 3fc31a422..3caa50f84 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Store { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs index 7aafbb8b1..5dbe582ce 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class StoreContact { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs index 283839e5f..41240c021 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class TransactionHistory { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs index 9e34fc616..749261eec 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class TransactionHistoryArchive { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs index 0d39f4f21..f2f8f8397 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class UnitMeasure { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs index 93ac45efa..2de6e9879 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class Vendor { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs index 8566384d6..ff97a5ddc 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class VendorAddress { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs index 788a9633a..2077bb1b0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class VendorContact { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs index 2c7c45bcd..16cb85785 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class WorkOrder { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs index d126686a3..6ff2232d1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels +namespace DbContextModels.AdventureWorksEFCoreScaffolded { public partial class WorkOrderRouting { From 3ea3e3e3d93250fb74c2d4cca68f15a65cc182fa Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 1 Nov 2021 11:04:21 +0100 Subject: [PATCH 13/99] Scaffolded Northwind DB-context --- BackupDB.ps1 | 125 +++ .../AlphabeticalListOfProducts.cs | 24 + .../ScaffoldedDBContext/Categories.cs | 24 + .../CategorySalesFor1997.cs | 15 + .../ScaffoldedDBContext/CurrentProductList.cs | 15 + .../CustomerAndSuppliersByCity.cs | 17 + .../CustomerCustomerDemo.cs | 18 + .../CustomerDemographics.cs | 22 + .../ScaffoldedDBContext/Customers.cs | 33 + .../EmployeeTerritories.cs | 18 + .../ScaffoldedDBContext/Employees.cs | 43 + .../Northwind/ScaffoldedDBContext/Invoices.cs | 39 + .../ScaffoldedDBContext/NorthwindContext.cs | 840 ++++++++++++++++++ .../ScaffoldedDBContext/OrderDetails.cs | 21 + .../OrderDetailsExtended.cs | 20 + .../ScaffoldedDBContext/OrderSubtotals.cs | 15 + .../Northwind/ScaffoldedDBContext/Orders.cs | 37 + .../ScaffoldedDBContext/OrdersQry.cs | 33 + .../ProductSalesFor1997.cs | 16 + .../Northwind/ScaffoldedDBContext/Products.cs | 32 + .../ProductsAboveAveragePrice.cs | 15 + .../ScaffoldedDBContext/ProductsByCategory.cs | 18 + .../ScaffoldedDBContext/QuarterlyOrders.cs | 17 + .../Northwind/ScaffoldedDBContext/Region.cs | 22 + .../ScaffoldedDBContext/SalesByCategory.cs | 17 + .../SalesTotalsByAmount.cs | 17 + .../Northwind/ScaffoldedDBContext/Shippers.cs | 23 + .../SummaryOfSalesByQuarter.cs | 16 + .../SummaryOfSalesByYear.cs | 16 + .../ScaffoldedDBContext/Suppliers.cs | 32 + .../ScaffoldedDBContext/Territories.cs | 24 + .../Test/DomainServiceDescriptionTest.cs | 8 +- 32 files changed, 1625 insertions(+), 7 deletions(-) create mode 100644 BackupDB.ps1 create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerCustomerDemo.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerDemographics.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/EmployeeTerritories.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Employees.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs diff --git a/BackupDB.ps1 b/BackupDB.ps1 new file mode 100644 index 000000000..9868473f7 --- /dev/null +++ b/BackupDB.ps1 @@ -0,0 +1,125 @@ + +param($RepositoryRoot = "$PSScriptRoot", $SqlServer = "(localdb)\MSSQLLocalDB", [switch]$UseSqlCmd = $false) + +$DatabaseFolder = join-path $RepositoryRoot "src/Test/Databases" + +# Verify SqlServer or SQLPS module is installed +if (-not $UseSqlCmd) +{ + if ((-not (Get-Module SqlServer -ListAvailable)) -and (-not (Get-Module SQLPS))) + { + # This will install the nuget provider if not already installed + Get-PackageProvider -Name NuGet -Force + # Install-PackageProvider -Name NuGet -Force -Scope CurrentUser + # Installs SQL Module + Install-Module -Name SqlServer -AllowClobber -Force -Scope CurrentUser + } + + # Check if module is loaded and if not import it + if ((Get-Module SqlServer -ListAvailable) -and (-not (Get-Module SqlServer))) { + Import-Module SqlServer + } + elseif ((Get-Module SQLPS -ListAvailable) -and (-not (Get-Module SQLPS))) { + Import-Module SQLPS + } +} + +function Execute-SQL([string]$sql) +{ + if ($UseSqlCmd) + { + & sqlcmd -S $SqlServer -Q $sql + } + else + { + Invoke-Sqlcmd -ServerInstance $SqlServer -Query $sql + } +} + +# Remove old databases if any +function Remove-Database([string]$databaseName) +{ + $SqlCommand = +@" +USE master +GO +if exists (select * from sysdatabases where name='$databaseName') + drop database $databaseName +GO +"@; + Execute-SQL $SqlCommand +} + +function CreateDatabaseFromBackup([string]$databaseName, [string]$LogicalNameMDF, [string]$LogicalNameLDF) +{ + $DatabaseFileWithoutExt = join-path $DatabaseFolder $databaseName + + $BackupFile = $DatabaseFileWithoutExt + ".bak" + $DataFile = $DatabaseFileWithoutExt + ".mdf" + $LogFile = $DatabaseFileWithoutExt + ".ldf" + + + echo "Restoring a new backup of '$databaseName' from '$BackupFile' to '$DataFile'" + + Remove-Database $databaseName + + $SqlCommand = +@" +RESTORE DATABASE $databaseName +FROM DISK = '$BackupFile' +WITH MOVE '$($LogicalNameMDF)' TO '$DataFile', +MOVE '$($LogicalNameLDF)' TO '$LogFile' +GO + +DBCC SHRINKDATABASE('$databaseName'); +GO + +ALTER DATABASE [$databaseName] SET READ_ONLY; +go +"@; + Execute-SQL $SqlCommand +} + +function Take-Offline([string]$databaseName) +{ +$SqlCommand = +@" +Alter database [$databaseName] set single_user with ROLLBACK IMMEDIATE; +go +alter database [$databaseName] set offline; +"@; + Execute-SQL $SqlCommand +} + +function Take-Online([string]$databaseName) +{ +$SqlCommand = +@" +alter database [$databaseName] set online; +go +Alter database [$databaseName] set multi_user; +"@; + Execute-SQL $SqlCommand +} + +CreateDatabaseFromBackup "Northwind" "Northwind" "Northwind_log" +CreateDatabaseFromBackup "AdventureWorks" "AdventureWorks_Data" "AdventureWorks_Log" + +# Take northwind offline and copy to templates folder +echo "Copying northwind database to websites" + +Take-Offline "Northwind" +$mdf = (join-path $DatabaseFolder Northwind.mdf) +$ldf = (join-path $DatabaseFolder Northwind.ldf) +foreach($website in "src\Test\WebsiteFullTrust") +{ + $templateDir = Join-Path $RepositoryRoot "$website\App_Data\Templates\" + if (-not (Test-Path $templateDir)) + { + mkdir $templateDir -Force > $null + echo "Created $templateDir" + } + copy $mdf $templateDir -Force + copy $ldf $templateDir -Force +} +Take-Online "Northwind" diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs new file mode 100644 index 000000000..f859d045d --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class AlphabeticalListOfProducts + { + public int ProductId { get; set; } + public string ProductName { get; set; } + public int? SupplierId { get; set; } + public int? CategoryId { get; set; } + public string QuantityPerUnit { get; set; } + public decimal? UnitPrice { get; set; } + public short? UnitsInStock { get; set; } + public short? UnitsOnOrder { get; set; } + public short? ReorderLevel { get; set; } + public bool Discontinued { get; set; } + public string CategoryName { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs new file mode 100644 index 000000000..5853eb839 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Categories + { + public Categories() + { + Products = new HashSet(); + } + + public int CategoryId { get; set; } + public string CategoryName { get; set; } + public string Description { get; set; } + public byte[] Picture { get; set; } + + public virtual ICollection Products { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs new file mode 100644 index 000000000..bf367837e --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class CategorySalesFor1997 + { + public string CategoryName { get; set; } + public decimal? CategorySales { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs new file mode 100644 index 000000000..6fe696927 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class CurrentProductList + { + public int ProductId { get; set; } + public string ProductName { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs new file mode 100644 index 000000000..8bb9f88ba --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class CustomerAndSuppliersByCity + { + public string City { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string Relationship { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerCustomerDemo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerCustomerDemo.cs new file mode 100644 index 000000000..c57cd9e20 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerCustomerDemo.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class CustomerCustomerDemo + { + public string CustomerId { get; set; } + public string CustomerTypeId { get; set; } + + public virtual Customers Customer { get; set; } + public virtual CustomerDemographics CustomerType { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerDemographics.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerDemographics.cs new file mode 100644 index 000000000..d43cd63fb --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerDemographics.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class CustomerDemographics + { + public CustomerDemographics() + { + CustomerCustomerDemo = new HashSet(); + } + + public string CustomerTypeId { get; set; } + public string CustomerDesc { get; set; } + + public virtual ICollection CustomerCustomerDemo { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs new file mode 100644 index 000000000..70f3349ad --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Customers + { + public Customers() + { + CustomerCustomerDemo = new HashSet(); + Orders = new HashSet(); + } + + public string CustomerId { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string ContactTitle { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Phone { get; set; } + public string Fax { get; set; } + + public virtual ICollection CustomerCustomerDemo { get; set; } + public virtual ICollection Orders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/EmployeeTerritories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/EmployeeTerritories.cs new file mode 100644 index 000000000..ec46d8fa2 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/EmployeeTerritories.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class EmployeeTerritories + { + public int EmployeeId { get; set; } + public string TerritoryId { get; set; } + + public virtual Employees Employee { get; set; } + public virtual Territories Territory { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Employees.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Employees.cs new file mode 100644 index 000000000..ec7621bd0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Employees.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Employees + { + public Employees() + { + EmployeeTerritories = new HashSet(); + InverseReportsToNavigation = new HashSet(); + Orders = new HashSet(); + } + + public int EmployeeId { get; set; } + public string LastName { get; set; } + public string FirstName { get; set; } + public string Title { get; set; } + public string TitleOfCourtesy { get; set; } + public DateTime? BirthDate { get; set; } + public DateTime? HireDate { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string HomePhone { get; set; } + public string Extension { get; set; } + public byte[] Photo { get; set; } + public string Notes { get; set; } + public int? ReportsTo { get; set; } + public string PhotoPath { get; set; } + + public virtual Employees ReportsToNavigation { get; set; } + public virtual ICollection EmployeeTerritories { get; set; } + public virtual ICollection InverseReportsToNavigation { get; set; } + public virtual ICollection Orders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs new file mode 100644 index 000000000..b8ec9bd13 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Invoices + { + public string ShipName { get; set; } + public string ShipAddress { get; set; } + public string ShipCity { get; set; } + public string ShipRegion { get; set; } + public string ShipPostalCode { get; set; } + public string ShipCountry { get; set; } + public string CustomerId { get; set; } + public string CustomerName { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Salesperson { get; set; } + public int OrderId { get; set; } + public DateTime? OrderDate { get; set; } + public DateTime? RequiredDate { get; set; } + public DateTime? ShippedDate { get; set; } + public string ShipperName { get; set; } + public int ProductId { get; set; } + public string ProductName { get; set; } + public decimal UnitPrice { get; set; } + public short Quantity { get; set; } + public float Discount { get; set; } + public decimal? ExtendedPrice { get; set; } + public decimal? Freight { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs new file mode 100644 index 000000000..8bc826e92 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs @@ -0,0 +1,840 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class NorthwindContext : DbContext + { + public NorthwindContext() + { + } + + public NorthwindContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet AlphabeticalListOfProducts { get; set; } + public virtual DbSet Categories { get; set; } + public virtual DbSet CategorySalesFor1997 { get; set; } + public virtual DbSet CurrentProductList { get; set; } + public virtual DbSet CustomerAndSuppliersByCity { get; set; } + public virtual DbSet CustomerCustomerDemo { get; set; } + public virtual DbSet CustomerDemographics { get; set; } + public virtual DbSet Customers { get; set; } + public virtual DbSet EmployeeTerritories { get; set; } + public virtual DbSet Employees { get; set; } + public virtual DbSet Invoices { get; set; } + public virtual DbSet OrderDetails { get; set; } + public virtual DbSet OrderDetailsExtended { get; set; } + public virtual DbSet OrderSubtotals { get; set; } + public virtual DbSet Orders { get; set; } + public virtual DbSet OrdersQry { get; set; } + public virtual DbSet ProductSalesFor1997 { get; set; } + public virtual DbSet Products { get; set; } + public virtual DbSet ProductsAboveAveragePrice { get; set; } + public virtual DbSet ProductsByCategory { get; set; } + public virtual DbSet QuarterlyOrders { get; set; } + public virtual DbSet Region { get; set; } + public virtual DbSet SalesByCategory { get; set; } + public virtual DbSet SalesTotalsByAmount { get; set; } + public virtual DbSet Shippers { get; set; } + public virtual DbSet SummaryOfSalesByQuarter { get; set; } + public virtual DbSet SummaryOfSalesByYear { get; set; } + public virtual DbSet Suppliers { get; set; } + public virtual DbSet Territories { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + { +#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. + optionsBuilder.UseSqlServer("server=.\\SQLEXPRESS;initial catalog=Northwind;Integrated Security=SSPI; MultipleActiveResultSets=true"); + } + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Alphabetical list of products"); + + entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); + + entity.Property(e => e.CategoryName) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); + + entity.Property(e => e.SupplierId).HasColumnName("SupplierID"); + + entity.Property(e => e.UnitPrice).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId); + + entity.HasIndex(e => e.CategoryName) + .HasName("CategoryName"); + + entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); + + entity.Property(e => e.CategoryName) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.Description).HasColumnType("ntext"); + + entity.Property(e => e.Picture).HasColumnType("image"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Category Sales for 1997"); + + entity.Property(e => e.CategoryName) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.CategorySales).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Current Product List"); + + entity.Property(e => e.ProductId) + .HasColumnName("ProductID") + .ValueGeneratedOnAdd(); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Customer and Suppliers by City"); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ContactName).HasMaxLength(30); + + entity.Property(e => e.Relationship) + .IsRequired() + .HasMaxLength(9) + .IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.CustomerId, e.CustomerTypeId }) + .IsClustered(false); + + entity.Property(e => e.CustomerId) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.CustomerTypeId) + .HasColumnName("CustomerTypeID") + .HasMaxLength(10) + .IsFixedLength(); + + entity.HasOne(d => d.Customer) + .WithMany(p => p.CustomerCustomerDemo) + .HasForeignKey(d => d.CustomerId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CustomerCustomerDemo_Customers"); + + entity.HasOne(d => d.CustomerType) + .WithMany(p => p.CustomerCustomerDemo) + .HasForeignKey(d => d.CustomerTypeId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CustomerCustomerDemo"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CustomerTypeId) + .IsClustered(false); + + entity.Property(e => e.CustomerTypeId) + .HasColumnName("CustomerTypeID") + .HasMaxLength(10) + .IsFixedLength(); + + entity.Property(e => e.CustomerDesc).HasColumnType("ntext"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CustomerId); + + entity.HasIndex(e => e.City) + .HasName("City"); + + entity.HasIndex(e => e.CompanyName) + .HasName("CompanyName"); + + entity.HasIndex(e => e.PostalCode) + .HasName("PostalCode"); + + entity.HasIndex(e => e.Region) + .HasName("Region"); + + entity.Property(e => e.CustomerId) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ContactName).HasMaxLength(30); + + entity.Property(e => e.ContactTitle).HasMaxLength(30); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.Fax).HasMaxLength(24); + + entity.Property(e => e.Phone).HasMaxLength(24); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.Region).HasMaxLength(15); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.EmployeeId, e.TerritoryId }) + .IsClustered(false); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.TerritoryId) + .HasColumnName("TerritoryID") + .HasMaxLength(20); + + entity.HasOne(d => d.Employee) + .WithMany(p => p.EmployeeTerritories) + .HasForeignKey(d => d.EmployeeId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmployeeTerritories_Employees"); + + entity.HasOne(d => d.Territory) + .WithMany(p => p.EmployeeTerritories) + .HasForeignKey(d => d.TerritoryId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmployeeTerritories_Territories"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.EmployeeId); + + entity.HasIndex(e => e.LastName) + .HasName("LastName"); + + entity.HasIndex(e => e.PostalCode) + .HasName("PostalCode"); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.BirthDate).HasColumnType("datetime"); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.Extension).HasMaxLength(4); + + entity.Property(e => e.FirstName) + .IsRequired() + .HasMaxLength(10); + + entity.Property(e => e.HireDate).HasColumnType("datetime"); + + entity.Property(e => e.HomePhone).HasMaxLength(24); + + entity.Property(e => e.LastName) + .IsRequired() + .HasMaxLength(20); + + entity.Property(e => e.Notes).HasColumnType("ntext"); + + entity.Property(e => e.Photo).HasColumnType("image"); + + entity.Property(e => e.PhotoPath).HasMaxLength(255); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.Region).HasMaxLength(15); + + entity.Property(e => e.Title).HasMaxLength(30); + + entity.Property(e => e.TitleOfCourtesy).HasMaxLength(25); + + entity.HasOne(d => d.ReportsToNavigation) + .WithMany(p => p.InverseReportsToNavigation) + .HasForeignKey(d => d.ReportsTo) + .HasConstraintName("FK_Employees_Employees"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Invoices"); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.CustomerId) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.CustomerName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ExtendedPrice).HasColumnType("money"); + + entity.Property(e => e.Freight).HasColumnType("money"); + + entity.Property(e => e.OrderDate).HasColumnType("datetime"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.Region).HasMaxLength(15); + + entity.Property(e => e.RequiredDate).HasColumnType("datetime"); + + entity.Property(e => e.Salesperson) + .IsRequired() + .HasMaxLength(31); + + entity.Property(e => e.ShipAddress).HasMaxLength(60); + + entity.Property(e => e.ShipCity).HasMaxLength(15); + + entity.Property(e => e.ShipCountry).HasMaxLength(15); + + entity.Property(e => e.ShipName).HasMaxLength(40); + + entity.Property(e => e.ShipPostalCode).HasMaxLength(10); + + entity.Property(e => e.ShipRegion).HasMaxLength(15); + + entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + + entity.Property(e => e.ShipperName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.UnitPrice).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.OrderId, e.ProductId }) + .HasName("PK_Order_Details"); + + entity.ToTable("Order Details"); + + entity.HasIndex(e => e.OrderId) + .HasName("OrdersOrder_Details"); + + entity.HasIndex(e => e.ProductId) + .HasName("ProductsOrder_Details"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.Discount).HasDefaultValueSql("(0)"); + + entity.Property(e => e.Quantity).HasDefaultValueSql("(1)"); + + entity.Property(e => e.UnitPrice) + .HasColumnType("money") + .HasDefaultValueSql("(0)"); + + entity.HasOne(d => d.Order) + .WithMany(p => p.OrderDetails) + .HasForeignKey(d => d.OrderId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Order_Details_Orders"); + + entity.HasOne(d => d.Product) + .WithMany(p => p.OrderDetails) + .HasForeignKey(d => d.ProductId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Order_Details_Products"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Order Details Extended"); + + entity.Property(e => e.ExtendedPrice).HasColumnType("money"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.UnitPrice).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Order Subtotals"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.Subtotal).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.OrderId); + + entity.HasIndex(e => e.CustomerId) + .HasName("CustomersOrders"); + + entity.HasIndex(e => e.EmployeeId) + .HasName("EmployeesOrders"); + + entity.HasIndex(e => e.OrderDate) + .HasName("OrderDate"); + + entity.HasIndex(e => e.ShipPostalCode) + .HasName("ShipPostalCode"); + + entity.HasIndex(e => e.ShipVia) + .HasName("ShippersOrders"); + + entity.HasIndex(e => e.ShippedDate) + .HasName("ShippedDate"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.CustomerId) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.Freight) + .HasColumnType("money") + .HasDefaultValueSql("(0)"); + + entity.Property(e => e.OrderDate).HasColumnType("datetime"); + + entity.Property(e => e.RequiredDate).HasColumnType("datetime"); + + entity.Property(e => e.ShipAddress).HasMaxLength(60); + + entity.Property(e => e.ShipCity).HasMaxLength(15); + + entity.Property(e => e.ShipCountry).HasMaxLength(15); + + entity.Property(e => e.ShipName).HasMaxLength(40); + + entity.Property(e => e.ShipPostalCode).HasMaxLength(10); + + entity.Property(e => e.ShipRegion).HasMaxLength(15); + + entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + + entity.HasOne(d => d.Customer) + .WithMany(p => p.Orders) + .HasForeignKey(d => d.CustomerId) + .HasConstraintName("FK_Orders_Customers"); + + entity.HasOne(d => d.Employee) + .WithMany(p => p.Orders) + .HasForeignKey(d => d.EmployeeId) + .HasConstraintName("FK_Orders_Employees"); + + entity.HasOne(d => d.ShipViaNavigation) + .WithMany(p => p.Orders) + .HasForeignKey(d => d.ShipVia) + .HasConstraintName("FK_Orders_Shippers"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Orders Qry"); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.CustomerId) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); + + entity.Property(e => e.Freight).HasColumnType("money"); + + entity.Property(e => e.OrderDate).HasColumnType("datetime"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.Region).HasMaxLength(15); + + entity.Property(e => e.RequiredDate).HasColumnType("datetime"); + + entity.Property(e => e.ShipAddress).HasMaxLength(60); + + entity.Property(e => e.ShipCity).HasMaxLength(15); + + entity.Property(e => e.ShipCountry).HasMaxLength(15); + + entity.Property(e => e.ShipName).HasMaxLength(40); + + entity.Property(e => e.ShipPostalCode).HasMaxLength(10); + + entity.Property(e => e.ShipRegion).HasMaxLength(15); + + entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Product Sales for 1997"); + + entity.Property(e => e.CategoryName) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ProductSales).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ProductId); + + entity.HasIndex(e => e.CategoryId) + .HasName("CategoryID"); + + entity.HasIndex(e => e.ProductName) + .HasName("ProductName"); + + entity.HasIndex(e => e.SupplierId) + .HasName("SuppliersProducts"); + + entity.Property(e => e.ProductId).HasColumnName("ProductID"); + + entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); + + entity.Property(e => e.Discontinued) + .IsRequired() + .HasDefaultValueSql("(0)"); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); + + entity.Property(e => e.ReorderLevel).HasDefaultValueSql("(0)"); + + entity.Property(e => e.SupplierId).HasColumnName("SupplierID"); + + entity.Property(e => e.UnitPrice) + .HasColumnType("money") + .HasDefaultValueSql("(0)"); + + entity.Property(e => e.UnitsInStock).HasDefaultValueSql("(0)"); + + entity.Property(e => e.UnitsOnOrder).HasDefaultValueSql("(0)"); + + entity.HasOne(d => d.Category) + .WithMany(p => p.Products) + .HasForeignKey(d => d.CategoryId) + .HasConstraintName("FK_Products_Categories"); + + entity.HasOne(d => d.Supplier) + .WithMany(p => p.Products) + .HasForeignKey(d => d.SupplierId) + .HasConstraintName("FK_Products_Suppliers"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Products Above Average Price"); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.UnitPrice).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Products by Category"); + + entity.Property(e => e.CategoryName) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Quarterly Orders"); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.CompanyName).HasMaxLength(40); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.CustomerId) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RegionId) + .IsClustered(false); + + entity.Property(e => e.RegionId) + .HasColumnName("RegionID") + .ValueGeneratedNever(); + + entity.Property(e => e.RegionDescription) + .IsRequired() + .HasMaxLength(50) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Sales by Category"); + + entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); + + entity.Property(e => e.CategoryName) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ProductSales).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Sales Totals by Amount"); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.SaleAmount).HasColumnType("money"); + + entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShipperId); + + entity.Property(e => e.ShipperId).HasColumnName("ShipperID"); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.Phone).HasMaxLength(24); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Summary of Sales by Quarter"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + + entity.Property(e => e.Subtotal).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("Summary of Sales by Year"); + + entity.Property(e => e.OrderId).HasColumnName("OrderID"); + + entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + + entity.Property(e => e.Subtotal).HasColumnType("money"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SupplierId); + + entity.HasIndex(e => e.CompanyName) + .HasName("CompanyName"); + + entity.HasIndex(e => e.PostalCode) + .HasName("PostalCode"); + + entity.Property(e => e.SupplierId).HasColumnName("SupplierID"); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ContactName).HasMaxLength(30); + + entity.Property(e => e.ContactTitle).HasMaxLength(30); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.Fax).HasMaxLength(24); + + entity.Property(e => e.HomePage).HasColumnType("ntext"); + + entity.Property(e => e.Phone).HasMaxLength(24); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.Region).HasMaxLength(15); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TerritoryId) + .IsClustered(false); + + entity.Property(e => e.TerritoryId) + .HasColumnName("TerritoryID") + .HasMaxLength(20); + + entity.Property(e => e.RegionId).HasColumnName("RegionID"); + + entity.Property(e => e.TerritoryDescription) + .IsRequired() + .HasMaxLength(50) + .IsFixedLength(); + + entity.HasOne(d => d.Region) + .WithMany(p => p.Territories) + .HasForeignKey(d => d.RegionId) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Territories_Region"); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs new file mode 100644 index 000000000..3fce9a2cc --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class OrderDetails + { + public int OrderId { get; set; } + public int ProductId { get; set; } + public decimal UnitPrice { get; set; } + public short Quantity { get; set; } + public float Discount { get; set; } + + public virtual Orders Order { get; set; } + public virtual Products Product { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs new file mode 100644 index 000000000..4c3591643 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class OrderDetailsExtended + { + public int OrderId { get; set; } + public int ProductId { get; set; } + public string ProductName { get; set; } + public decimal UnitPrice { get; set; } + public short Quantity { get; set; } + public float Discount { get; set; } + public decimal? ExtendedPrice { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs new file mode 100644 index 000000000..30d8d65f5 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class OrderSubtotals + { + public int OrderId { get; set; } + public decimal? Subtotal { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs new file mode 100644 index 000000000..8ffbe7214 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Orders + { + public Orders() + { + OrderDetails = new HashSet(); + } + + public int OrderId { get; set; } + public string CustomerId { get; set; } + public int? EmployeeId { get; set; } + public DateTime? OrderDate { get; set; } + public DateTime? RequiredDate { get; set; } + public DateTime? ShippedDate { get; set; } + public int? ShipVia { get; set; } + public decimal? Freight { get; set; } + public string ShipName { get; set; } + public string ShipAddress { get; set; } + public string ShipCity { get; set; } + public string ShipRegion { get; set; } + public string ShipPostalCode { get; set; } + public string ShipCountry { get; set; } + + public virtual Customers Customer { get; set; } + public virtual Employees Employee { get; set; } + public virtual Shippers ShipViaNavigation { get; set; } + public virtual ICollection OrderDetails { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs new file mode 100644 index 000000000..f6e0db6bc --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class OrdersQry + { + public int OrderId { get; set; } + public string CustomerId { get; set; } + public int? EmployeeId { get; set; } + public DateTime? OrderDate { get; set; } + public DateTime? RequiredDate { get; set; } + public DateTime? ShippedDate { get; set; } + public int? ShipVia { get; set; } + public decimal? Freight { get; set; } + public string ShipName { get; set; } + public string ShipAddress { get; set; } + public string ShipCity { get; set; } + public string ShipRegion { get; set; } + public string ShipPostalCode { get; set; } + public string ShipCountry { get; set; } + public string CompanyName { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs new file mode 100644 index 000000000..87b13dde3 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class ProductSalesFor1997 + { + public string CategoryName { get; set; } + public string ProductName { get; set; } + public decimal? ProductSales { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs new file mode 100644 index 000000000..a6651907b --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Products + { + public Products() + { + OrderDetails = new HashSet(); + } + + public int ProductId { get; set; } + public string ProductName { get; set; } + public int? SupplierId { get; set; } + public int? CategoryId { get; set; } + public string QuantityPerUnit { get; set; } + public decimal? UnitPrice { get; set; } + public short? UnitsInStock { get; set; } + public short? UnitsOnOrder { get; set; } + public short? ReorderLevel { get; set; } + public bool? Discontinued { get; set; } + + public virtual Categories Category { get; set; } + public virtual Suppliers Supplier { get; set; } + public virtual ICollection OrderDetails { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs new file mode 100644 index 000000000..1056845b0 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class ProductsAboveAveragePrice + { + public string ProductName { get; set; } + public decimal? UnitPrice { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs new file mode 100644 index 000000000..cb68e96aa --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class ProductsByCategory + { + public string CategoryName { get; set; } + public string ProductName { get; set; } + public string QuantityPerUnit { get; set; } + public short? UnitsInStock { get; set; } + public bool Discontinued { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs new file mode 100644 index 000000000..ddb4dc4f8 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class QuarterlyOrders + { + public string CustomerId { get; set; } + public string CompanyName { get; set; } + public string City { get; set; } + public string Country { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs new file mode 100644 index 000000000..0dcc26b66 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Region + { + public Region() + { + Territories = new HashSet(); + } + + public int RegionId { get; set; } + public string RegionDescription { get; set; } + + public virtual ICollection Territories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs new file mode 100644 index 000000000..f520b3c01 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class SalesByCategory + { + public int CategoryId { get; set; } + public string CategoryName { get; set; } + public string ProductName { get; set; } + public decimal? ProductSales { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs new file mode 100644 index 000000000..425ad6305 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class SalesTotalsByAmount + { + public decimal? SaleAmount { get; set; } + public int OrderId { get; set; } + public string CompanyName { get; set; } + public DateTime? ShippedDate { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs new file mode 100644 index 000000000..bbb71f130 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Shippers + { + public Shippers() + { + Orders = new HashSet(); + } + + public int ShipperId { get; set; } + public string CompanyName { get; set; } + public string Phone { get; set; } + + public virtual ICollection Orders { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs new file mode 100644 index 000000000..619bfdc11 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class SummaryOfSalesByQuarter + { + public DateTime? ShippedDate { get; set; } + public int OrderId { get; set; } + public decimal? Subtotal { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs new file mode 100644 index 000000000..9ed3a1dab --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class SummaryOfSalesByYear + { + public DateTime? ShippedDate { get; set; } + public int OrderId { get; set; } + public decimal? Subtotal { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs new file mode 100644 index 000000000..a115dd4f4 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Suppliers + { + public Suppliers() + { + Products = new HashSet(); + } + + public int SupplierId { get; set; } + public string CompanyName { get; set; } + public string ContactName { get; set; } + public string ContactTitle { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string Region { get; set; } + public string PostalCode { get; set; } + public string Country { get; set; } + public string Phone { get; set; } + public string Fax { get; set; } + public string HomePage { get; set; } + + public virtual ICollection Products { get; set; } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs new file mode 100644 index 000000000..71acea158 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace DbContextModels.NorthwindEFCoreScaffolded +{ + public partial class Territories + { + public Territories() + { + EmployeeTerritories = new HashSet(); + } + + public string TerritoryId { get; set; } + public string TerritoryDescription { get; set; } + public int RegionId { get; set; } + + public virtual Region Region { get; set; } + public virtual ICollection EmployeeTerritories { get; set; } + } +} diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 316972532..4b2c833ee 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -358,16 +358,10 @@ public void EFTypeDescriptor_ExcludedEntityMembers() [TestMethod] public void EFCoreTypeDescriptor_ExcludedEntityMembers() { + // TODO: Not applicable to EF CORE so might be removed PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(EFCorePocoEntity_IEntityChangeTracker))["EntityState"]; Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); - // TODO: Do we really need to check this for adveture works? If we nee to fix the model in some way - // https://docs.microsoft.com/en-us/ef/efcore-and-ef6/porting/port-edmx - //pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModelEFCore.Customer))["EntityState"]; - //Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); - - //pd = TypeDescriptor.GetProperties(typeof(AdventureWorksModelEFCore.Customer))["SalesTerritoryReference"]; - //Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); } /// From 57ff61f0da5dd2d9d11fd98fe06c770630321773 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 8 Nov 2021 08:03:14 +0100 Subject: [PATCH 14/99] WIP --- .../Test/DomainServiceDescriptionTest.cs | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 4b2c833ee..a4f805b3a 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -391,35 +391,19 @@ public void DomainServiceDescription_EFPOCO() } /// - /// Verify that our EF custom type descriptors work for POCO models + /// Verify FindEntityType for EF Core /// [TestMethod] - public void DomainServiceDescription_EFCorePOCO() + public void DomainServiceDescription_EFCoreTestFindEntityType() { // First create a context manually and verify that POCO metadata is configured correctly - NorthwindEFCorePOCOModel.NorthwindEntities ctxt = new NorthwindEFCorePOCOModel.NorthwindEntities(); - IEntityType entityType = ctxt.Model.FindEntityType(nameof(NorthwindEFCorePOCOModel.Product)); + var ctxt = new DbContextModels.NorthwindEFCoreScaffolded.NorthwindContext(); + IEntityType entityType = ctxt.Model.FindEntityType(typeof(DbContextModels.NorthwindEFCoreScaffolded.Products).FullName); Assert.IsNotNull(entityType); - // - // TODO: Do we need to test this? ObjectContext is not used.. - // direct test verifying that our helper methods work for POCO metadata - // metadata do not work in EF Core use IEntityType fake = _context.Model.FindEntityType(basicModelType); - // See https://stackoverflow.com/questions/54122313/where-is-metadataworkspace-in-entity-framework-core - //entityType = (EntityType)ObjectContextUtilities.GetEdmType(ctxt., typeof(NorthwindPOCOModel.Product)); - //Assert.IsNotNull(entityType); - - // E2E DomainServiceDescription test, verifying that our custom TDs are registered - DomainServiceDescription desc = DomainServiceDescription.GetDescription(typeof(TestDomainServices.EFCore.EFCoreNorthwindPOCO)); - - PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(NorthwindEFCorePOCOModel.Product))["ProductID"]; - Assert.IsNotNull(pd.Attributes[typeof(KeyAttribute)]); - - pd = TypeDescriptor.GetProperties(typeof(NorthwindEFCorePOCOModel.Product))["Category"]; - AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(AssociationAttribute)]; - Assert.IsNotNull(assocAttrib); } + /// /// Verify that after deriving from an EF type TypeDescriptor continues to work as expected. /// From dfa99033155256c8e5b6ea70d6d5321ccb0d8bf0 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 19:29:17 +0100 Subject: [PATCH 15/99] Prepare EFcore project for netstandard, target EF6 instead of EF4 for metadata (To remove later) --- .../Framework/DbContextEFCoreExtensions.cs | 4 ++-- .../Framework/LinqToEntitiesDomainServiceEFCore.cs | 3 +-- ...oEntitiesDomainServiceEFCoreDescriptionProvider.cs | 2 +- .../LinqToEntitiesEFCoreTypeDescriptionContext.cs | 2 +- .../Framework/LinqToEntitiesEFCoreTypeDescriptor.cs | 6 +++--- .../Framework/MetadataWorkspaceUtilitiesEFCore.cs | 2 +- .../Framework/ObjectContextUtilitiesEFCore.cs | 2 +- .../OpenRiaServices.Server.EntityFrameworkCore.csproj | 11 ++++------- .../Framework/Properties/AssemblyInfo.cs | 1 - 9 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs index 07ee9009e..5fd230ed6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs @@ -14,7 +14,7 @@ public static class DbContextEFCoreExtensions /// with the specified original state. /// /// The entity Type - /// The to attach to. + /// The to attach to. /// The current entity. /// The original entity. /// The corresponding @@ -65,7 +65,7 @@ public static void AttachAsModified(this DbSet dbSet, T current, T origina /// can be used in cases where the entity has a Timestamp member. ///
/// The entity type - /// The to attach to + /// The to attach to /// The current entity /// The coresponding public static void AttachAsModified(this DbSet dbSet, T entity, DbContext dbContext) where T : class diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs index d15acfd05..4967ca313 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs @@ -1,8 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; +using System.Data.Entity.Core; using System.Linq; using System.Threading; using System.Threading.Tasks; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs index 0ad4f8a7d..e92e57563 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Data.Metadata.Edm; +using System.Data.Entity.Core.Metadata.Edm; #if RIACONTRIB using System.ServiceModel.DomainServices.Server; #endif diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index 614c02f68..c319a8bf4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Data.Mapping; -using System.Data.Metadata.Edm; +using System.Data.Entity.Core.Metadata.Edm; using System.Globalization; using System.Linq; using OpenRiaServices.Server; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs index 5cbff73ff..ed6d31c94 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs @@ -9,8 +9,8 @@ using Microsoft.EntityFrameworkCore; using System.Linq; using OpenRiaServices.Server; -using System.Data.Metadata.Edm; -using System.Data.Objects.DataClasses; +using System.Data.Entity.Core.Metadata.Edm; +using System.Data.Entity.Core.Objects.DataClasses; namespace OpenRiaServices.EntityFrameworkCore { @@ -182,7 +182,7 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor if (facet != null && facet.Value != null && facet.Value.GetType() == typeof(int)) { // need to test for Type int, since the value can also be of type - // System.Data.Metadata.Edm.EdmConstants.Unbounded + // System.Data.Entity.Core.Metadata.Edm.EdmConstants.Unbounded int maxLength = (int)facet.Value; attributes.Add(new StringLengthAttribute(maxLength)); } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs index 592aabcd9..5372bb875 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Reflection; using OpenRiaServices; -using System.Data.Metadata.Edm; +using System.Data.Entity.Core.Metadata.Edm; using Microsoft.EntityFrameworkCore; namespace System.Data.Mapping diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs index a73ba8a72..e30b35987 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs @@ -3,7 +3,7 @@ using System.ServiceModel.DomainServices.Server; #endif using System.Linq; -using System.Data.Metadata.Edm; +using System.Data.Entity.Core.Metadata.Edm; using Microsoft.EntityFrameworkCore.ChangeTracking; namespace OpenRiaServices.EntityFrameworkCore diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 2a52945f6..6c4d04487 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -1,17 +1,14 @@  + net472 - $(DefineConstants);SERVERFX;DBCONTEXT;net472; + $(DefineConstants);SERVERFX;DBCONTEXT; True - - - - - - + + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs index d337eb49b..b68538564 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Properties/AssemblyInfo.cs @@ -21,6 +21,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4291e253-9e86-4a66-a9a4-8e09139f86c9")] -[assembly: CLSCompliant(true)] [assembly: NeutralResourcesLanguageAttribute("en-US")] From 56ac2ce39aa719d0c2618476a50b1f67a9a94171 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 21:32:03 +0100 Subject: [PATCH 16/99] Recreate EFCoreModel and remove some of the efcore models --- .../Test/CodeFirstModel/ProductInfo.cs | 4 + .../AdventureWorks/AWBuildVersion.cs | 22 - .../DbContextModel/AdventureWorks/Address.cs | 49 +- .../AdventureWorks/AddressType.cs | 37 +- .../AdventureWorksDbCtx.Context.cs | 98 - .../AdventureWorksDbCtx.Context.tt | 194 - .../AdventureWorksDbCtx.Designer.cs | 10 - .../AdventureWorks/AdventureWorksDbCtx.cs | 9 - .../AdventureWorks/AdventureWorksDbCtx.edmx | 6405 ------ .../AdventureWorks/AdventureWorksDbCtx.tt | 280 - .../AdventureWorksPartialClasses.cs | 112 - .../AdventureWorks/AdventureworksContext.cs | 487 + .../AdventureWorks/BillOfMaterial.cs | 31 - .../AdventureWorks/BillOfMaterials.cs | 28 + .../DbContextModel/AdventureWorks/Contact.cs | 57 +- .../AdventureWorks/ContactCreditCard.cs | 27 +- .../AdventureWorks/ContactType.cs | 35 +- .../AdventureWorks/CountryRegion.cs | 37 +- .../AdventureWorks/CountryRegionCurrency.cs | 31 +- .../AdventureWorks/CreditCard.cs | 37 +- .../DbContextModel/AdventureWorks/Culture.cs | 35 +- .../DbContextModel/AdventureWorks/Currency.cs | 39 +- .../AdventureWorks/CurrencyRate.cs | 42 +- .../DbContextModel/AdventureWorks/Customer.cs | 44 +- .../AdventureWorks/CustomerAddress.cs | 30 +- .../AdventureWorks/DatabaseLog.cs | 26 - .../AdventureWorks/Department.cs | 35 +- .../DbContextModel/AdventureWorks/Document.cs | 40 +- .../DbContextModel/AdventureWorks/Employee.cs | 64 +- .../AdventureWorks/EmployeeAddress.cs | 29 +- .../EmployeeDepartmentHistory.cs | 34 +- .../AdventureWorks/EmployeePayHistory.cs | 30 +- .../DbContextModel/AdventureWorks/ErrorLog.cs | 27 - .../AdventureWorks/Illustration.cs | 32 +- .../AdventureWorks/Individual.cs | 28 +- .../AdventureWorks/JobCandidate.cs | 29 +- .../DbContextModel/AdventureWorks/Location.cs | 37 +- .../DbContextModel/AdventureWorks/Product.cs | 92 +- .../AdventureWorks/ProductCategory.cs | 35 +- .../AdventureWorks/ProductCostHistory.cs | 33 +- .../AdventureWorks/ProductDescription.cs | 35 +- .../AdventureWorks/ProductDocument.cs | 27 +- .../AdventureWorks/ProductInventory.cs | 31 +- .../AdventureWorks/ProductListPriceHistory.cs | 33 +- .../AdventureWorks/ProductModel.cs | 41 +- .../ProductModelIllustration.cs | 27 +- .../ProductModelProductDescriptionCulture.cs | 30 +- .../AdventureWorks/ProductPhoto.cs | 33 +- .../AdventureWorks/ProductProductPhoto.cs | 27 +- .../AdventureWorks/ProductReview.cs | 34 +- .../AdventureWorks/ProductSubcategory.cs | 36 +- .../AdventureWorks/ProductVendor.cs | 39 +- .../AdventureWorks/PurchaseOrder.cs | 41 - .../AdventureWorks/PurchaseOrderDetail.cs | 35 +- .../AdventureWorks/PurchaseOrderHeader.cs | 33 + .../AdventureWorks/SalesOrderDetail.cs | 33 +- .../AdventureWorks/SalesOrderHeader.cs | 71 +- .../SalesOrderHeaderSalesReason.cs | 27 +- .../AdventureWorks/SalesPerson.cs | 50 +- .../AdventureWorks/SalesPersonQuotaHistory.cs | 32 +- .../AdventureWorks/SalesReason.cs | 35 +- .../AdventureWorks/SalesTaxRate.cs | 31 +- .../AdventureWorks/SalesTerritory.cs | 51 +- .../AdventureWorks/SalesTerritoryHistory.cs | 35 +- .../SchaffoldedDBContext/Address.cs | 21 - .../SchaffoldedDBContext/AddressType.cs | 17 - .../AdventureWorksContext.cs | 1650 -- .../SchaffoldedDBContext/AwbuildVersion.cs | 17 - .../SchaffoldedDBContext/BillOfMaterials.cs | 22 - .../SchaffoldedDBContext/Contact.cs | 28 - .../SchaffoldedDBContext/ContactCreditCard.cs | 16 - .../SchaffoldedDBContext/ContactType.cs | 16 - .../SchaffoldedDBContext/CountryRegion.cs | 16 - .../CountryRegionCurrency.cs | 16 - .../SchaffoldedDBContext/CreditCard.cs | 19 - .../SchaffoldedDBContext/Culture.cs | 16 - .../SchaffoldedDBContext/Currency.cs | 16 - .../SchaffoldedDBContext/CurrencyRate.cs | 20 - .../SchaffoldedDBContext/Customer.cs | 19 - .../SchaffoldedDBContext/CustomerAddress.cs | 18 - .../SchaffoldedDBContext/DatabaseLog.cs | 21 - .../SchaffoldedDBContext/Department.cs | 17 - .../SchaffoldedDBContext/Document.cs | 23 - .../SchaffoldedDBContext/Employee.cs | 29 - .../SchaffoldedDBContext/EmployeeAddress.cs | 17 - .../EmployeeDepartmentHistory.cs | 19 - .../EmployeePayHistory.cs | 18 - .../SchaffoldedDBContext/ErrorLog.cs | 22 - .../SchaffoldedDBContext/Illustration.cs | 16 - .../SchaffoldedDBContext/Individual.cs | 17 - .../SchaffoldedDBContext/JobCandidate.cs | 17 - .../SchaffoldedDBContext/Location.cs | 18 - .../SchaffoldedDBContext/Product.cs | 38 - .../SchaffoldedDBContext/ProductCategory.cs | 17 - .../ProductCostHistory.cs | 18 - .../ProductDescription.cs | 17 - .../SchaffoldedDBContext/ProductDocument.cs | 16 - .../SchaffoldedDBContext/ProductInventory.cs | 20 - .../ProductListPriceHistory.cs | 18 - .../SchaffoldedDBContext/ProductModel.cs | 19 - .../ProductModelIllustration.cs | 16 - .../ProductModelProductDescriptionCulture.cs | 17 - .../SchaffoldedDBContext/ProductPhoto.cs | 19 - .../ProductProductPhoto.cs | 17 - .../SchaffoldedDBContext/ProductReview.cs | 21 - .../ProductSubcategory.cs | 18 - .../SchaffoldedDBContext/ProductVendor.cs | 24 - .../PurchaseOrderDetail.cs | 24 - .../PurchaseOrderHeader.cs | 26 - .../SchaffoldedDBContext/SalesOrderDetail.cs | 24 - .../SchaffoldedDBContext/SalesOrderHeader.cs | 40 - .../SalesOrderHeaderSalesReason.cs | 16 - .../SchaffoldedDBContext/SalesPerson.cs | 22 - .../SalesPersonQuotaHistory.cs | 18 - .../SchaffoldedDBContext/SalesReason.cs | 17 - .../SchaffoldedDBContext/SalesTaxRate.cs | 20 - .../SchaffoldedDBContext/SalesTerritory.cs | 23 - .../SalesTerritoryHistory.cs | 19 - .../SchaffoldedDBContext/ScrapReason.cs | 16 - .../SchaffoldedDBContext/Shift.cs | 18 - .../SchaffoldedDBContext/ShipMethod.cs | 19 - .../SchaffoldedDBContext/ShoppingCartItem.cs | 19 - .../SchaffoldedDBContext/SpecialOffer.cs | 24 - .../SpecialOfferProduct.cs | 17 - .../SchaffoldedDBContext/StateProvince.cs | 21 - .../SchaffoldedDBContext/Store.cs | 19 - .../SchaffoldedDBContext/StoreContact.cs | 18 - .../TransactionHistory.cs | 22 - .../TransactionHistoryArchive.cs | 22 - .../SchaffoldedDBContext/UnitMeasure.cs | 16 - .../SchaffoldedDBContext/Vendor.cs | 21 - .../SchaffoldedDBContext/VendorAddress.cs | 17 - .../SchaffoldedDBContext/VendorContact.cs | 17 - .../SchaffoldedDBContext/WorkOrder.cs | 23 - .../SchaffoldedDBContext/WorkOrderRouting.cs | 25 - .../AdventureWorks/ScrapReason.cs | 33 +- .../DbContextModel/AdventureWorks/Shift.cs | 39 +- .../AdventureWorks/ShipMethod.cs | 39 +- .../AdventureWorks/ShoppingCartItem.cs | 31 +- .../AdventureWorks/SpecialOffer.cs | 48 +- .../AdventureWorks/SpecialOfferProduct.cs | 35 +- .../AdventureWorks/StateProvince.cs | 43 +- .../DbContextModel/AdventureWorks/Store.cs | 40 +- .../AdventureWorks/StoreContact.cs | 30 +- .../AdventureWorks/TransactionHistory.cs | 32 +- .../TransactionHistoryArchive.cs | 30 +- .../AdventureWorks/UnitMeasure.cs | 41 +- .../DbContextModel/AdventureWorks/Vendor.cs | 42 +- .../AdventureWorks/VendorAddress.cs | 28 +- .../AdventureWorks/VendorContact.cs | 28 +- .../AdventureWorks/WorkOrder.cs | 44 +- .../AdventureWorks/WorkOrderRouting.cs | 46 +- .../AdventureWorks/sysdiagram.cs | 23 - .../Test/DbContextModel/App.config | 13 - .../EFCoreDbContextModels.csproj | 335 - .../Test/DbContextModel/EFCoreModels.csproj | 22 + .../Test/DbContextModel/Northwind/Category.cs | 25 +- .../Test/DbContextModel/Northwind/Customer.cs | 29 +- .../CustomerCustomerDemo.cs | 8 +- .../Northwind/CustomerDemographic.cs | 27 - .../CustomerDemographics.cs | 4 +- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 488 + .../Test/DbContextModel/Northwind/Employee.cs | 48 - .../EmployeeTerritories.cs | 8 +- .../{ScaffoldedDBContext => }/Employees.cs | 8 +- .../Northwind/NorthwindDbCtx.Designer.cs | 10 - .../Northwind/NorthwindDbCtx.edmx | 934 - .../Northwind/NorthwindEntities.Context.cs | 45 - .../Northwind/NorthwindEntities.Context.tt | 194 - .../Northwind/NorthwindEntities.cs | 9 - .../Northwind/NorthwindEntities.tt | 280 - .../Northwind/NorthwindPartialClasses.cs | 15 +- .../Test/DbContextModel/Northwind/Order.cs | 43 +- .../DbContextModel/Northwind/Order_Detail.cs | 21 +- .../Test/DbContextModel/Northwind/Product.cs | 39 +- .../Test/DbContextModel/Northwind/Region.cs | 25 +- .../AlphabeticalListOfProducts.cs | 24 - .../ScaffoldedDBContext/Categories.cs | 24 - .../CategorySalesFor1997.cs | 15 - .../ScaffoldedDBContext/CurrentProductList.cs | 15 - .../CustomerAndSuppliersByCity.cs | 17 - .../ScaffoldedDBContext/Customers.cs | 33 - .../Northwind/ScaffoldedDBContext/Invoices.cs | 39 - .../ScaffoldedDBContext/NorthwindContext.cs | 840 - .../ScaffoldedDBContext/OrderDetails.cs | 21 - .../OrderDetailsExtended.cs | 20 - .../ScaffoldedDBContext/OrderSubtotals.cs | 15 - .../Northwind/ScaffoldedDBContext/Orders.cs | 37 - .../ScaffoldedDBContext/OrdersQry.cs | 33 - .../ProductSalesFor1997.cs | 16 - .../Northwind/ScaffoldedDBContext/Products.cs | 32 - .../ProductsAboveAveragePrice.cs | 15 - .../ScaffoldedDBContext/ProductsByCategory.cs | 18 - .../ScaffoldedDBContext/QuarterlyOrders.cs | 17 - .../Northwind/ScaffoldedDBContext/Region.cs | 22 - .../ScaffoldedDBContext/SalesByCategory.cs | 17 - .../SalesTotalsByAmount.cs | 17 - .../Northwind/ScaffoldedDBContext/Shippers.cs | 23 - .../SummaryOfSalesByQuarter.cs | 16 - .../SummaryOfSalesByYear.cs | 16 - .../ScaffoldedDBContext/Suppliers.cs | 32 - .../ScaffoldedDBContext/Territories.cs | 24 - .../Test/DbContextModel/Northwind/Shipper.cs | 25 +- .../Test/DbContextModel/Northwind/Supplier.cs | 25 +- .../DbContextModel/Northwind/Territory.cs | 27 +- .../Test/DbContextModel/efpt.config.json | 303 + .../DataModels/AdventureWorksEFCore.cs | 18836 ---------------- .../DataModels/AdventureWorksEFCore.tt | 1298 -- ...DbCtx_Northwind.cs => EFCore_Northwind.cs} | 8 +- .../Northwind/EFCore_Northwind_POCO.cs | 115 - 210 files changed, 2473 insertions(+), 35501 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderHeader.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj rename src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/{ScaffoldedDBContext => }/CustomerCustomerDemo.cs (65%) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs rename src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/{ScaffoldedDBContext => }/CustomerDemographics.cs (85%) create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs rename src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/{ScaffoldedDBContext => }/EmployeeTerritories.cs (64%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/{ScaffoldedDBContext => }/Employees.cs (88%) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json delete mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs delete mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt rename src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/{EFCoreDbCtx_Northwind.cs => EFCore_Northwind.cs} (99%) delete mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs diff --git a/src/OpenRiaServices.EntityFramework/Test/CodeFirstModel/ProductInfo.cs b/src/OpenRiaServices.EntityFramework/Test/CodeFirstModel/ProductInfo.cs index 447677bd5..c5dc9da24 100644 --- a/src/OpenRiaServices.EntityFramework/Test/CodeFirstModel/ProductInfo.cs +++ b/src/OpenRiaServices.EntityFramework/Test/CodeFirstModel/ProductInfo.cs @@ -6,6 +6,10 @@ namespace CodeFirstModels { + /// + /// Non DAL projection type used to verify that such types can be returned + /// from the provider + /// public class ProductInfo { public static ProductInfo CreateProductInfo(int productID, string productName, string categoryName, string supplierName) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs deleted file mode 100644 index 1a5e1b83f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AWBuildVersion.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorksEFCore -{ - using System; - using System.Collections.Generic; - - public partial class AWBuildVersion - { - public byte SystemInformationID { get; set; } - public string Database_Version { get; set; } - public System.DateTime VersionDate { get; set; } - public System.DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs index e6c700c94..ee51e60a0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs @@ -1,42 +1,29 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Address", Schema = "Person")] public partial class Address { - public Address() - { - this.EmployeeAddresses = new HashSet(); - this.CustomerAddresses = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - this.SalesOrderHeaders1 = new HashSet(); - this.VendorAddresses = new HashSet(); - } - public int AddressID { get; set; } + [Required] + [StringLength(60)] public string AddressLine1 { get; set; } + [StringLength(60)] public string AddressLine2 { get; set; } + [Required] + [StringLength(30)] public string City { get; set; } public int StateProvinceID { get; set; } + [Required] + [StringLength(15)] public string PostalCode { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection EmployeeAddresses { get; set; } - public virtual StateProvince StateProvince { get; set; } - public virtual ICollection CustomerAddresses { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual ICollection SalesOrderHeaders1 { get; set; } - public virtual ICollection VendorAddresses { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs index 1c7790a5a..efe76515f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs @@ -1,31 +1,20 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("AddressType", Schema = "Person")] public partial class AddressType { - public AddressType() - { - this.CustomerAddresses = new HashSet(); - this.VendorAddresses = new HashSet(); - } - public int AddressTypeID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection CustomerAddresses { get; set; } - public virtual ICollection VendorAddresses { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs deleted file mode 100644 index cc26da788..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.cs +++ /dev/null @@ -1,98 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorksEFCore -{ - using System; - using Microsoft.EntityFrameworkCore; - - public partial class DbCtxAdventureWorksEntities : DbContext - { - public DbCtxAdventureWorksEntities() - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - throw new NotImplementedException(); - } - - public DbSet AWBuildVersions { get; set; } - public DbSet DatabaseLogs { get; set; } - public DbSet ErrorLogs { get; set; } - public DbSet sysdiagrams { get; set; } - public DbSet Departments { get; set; } - public DbSet Employees { get; set; } - public DbSet EmployeeAddresses { get; set; } - public DbSet EmployeeDepartmentHistories { get; set; } - public DbSet EmployeePayHistories { get; set; } - public DbSet JobCandidates { get; set; } - public DbSet Shifts { get; set; } - public DbSet
Addresses { get; set; } - public DbSet AddressTypes { get; set; } - public DbSet Contacts { get; set; } - public DbSet ContactTypes { get; set; } - public DbSet CountryRegions { get; set; } - public DbSet StateProvinces { get; set; } - public DbSet BillOfMaterials { get; set; } - public DbSet Cultures { get; set; } - public DbSet Documents { get; set; } - public DbSet Illustrations { get; set; } - public DbSet Locations { get; set; } - public DbSet Products { get; set; } - public DbSet ProductCategories { get; set; } - public DbSet ProductCostHistories { get; set; } - public DbSet ProductDescriptions { get; set; } - public DbSet ProductDocuments { get; set; } - public DbSet ProductInventories { get; set; } - public DbSet ProductListPriceHistories { get; set; } - public DbSet ProductModels { get; set; } - public DbSet ProductModelIllustrations { get; set; } - public DbSet ProductModelProductDescriptionCultures { get; set; } - public DbSet ProductPhotoes { get; set; } - public DbSet ProductProductPhotoes { get; set; } - public DbSet ProductReviews { get; set; } - public DbSet ProductSubcategories { get; set; } - public DbSet ScrapReasons { get; set; } - public DbSet TransactionHistories { get; set; } - public DbSet TransactionHistoryArchives { get; set; } - public DbSet UnitMeasures { get; set; } - public DbSet WorkOrders { get; set; } - public DbSet WorkOrderRoutings { get; set; } - public DbSet ProductVendors { get; set; } - public DbSet PurchaseOrderDetails { get; set; } - public DbSet PurchaseOrders { get; set; } - public DbSet ShipMethods { get; set; } - public DbSet Vendors { get; set; } - public DbSet VendorAddresses { get; set; } - public DbSet VendorContacts { get; set; } - public DbSet ContactCreditCards { get; set; } - public DbSet CountryRegionCurrencies { get; set; } - public DbSet CreditCards { get; set; } - public DbSet Currencies { get; set; } - public DbSet CurrencyRates { get; set; } - public DbSet Customers { get; set; } - public DbSet CustomerAddresses { get; set; } - public DbSet Individuals { get; set; } - public DbSet SalesOrderDetails { get; set; } - public DbSet SalesOrderHeaders { get; set; } - public DbSet SalesOrderHeaderSalesReasons { get; set; } - public DbSet SalesPersons { get; set; } - public DbSet SalesPersonQuotaHistories { get; set; } - public DbSet SalesReasons { get; set; } - public DbSet SalesTaxRates { get; set; } - public DbSet SalesTerritories { get; set; } - public DbSet SalesTerritoryHistories { get; set; } - public DbSet ShoppingCartItems { get; set; } - public DbSet SpecialOffers { get; set; } - public DbSet SpecialOfferProducts { get; set; } - public DbSet Stores { get; set; } - public DbSet StoreContacts { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt deleted file mode 100644 index 97de62047..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Context.tt +++ /dev/null @@ -1,194 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -var loader = new MetadataLoader(this); -var region = new CodeRegion(this); -var inputFile = @"AdventureWorksDbCtx.edmx"; -var ItemCollection = loader.CreateEdmItemCollection(inputFile); - -Code = new CodeGenerationTools(this); -EFTools = new MetadataTools(this); -ObjectNamespace = Code.VsNamespaceSuggestion(); -ModelNamespace = loader.GetModelNamespace(inputFile); - -EntityContainer container = ItemCollection.GetItems().FirstOrDefault(); -if (container == null) -{ - return string.Empty; -} -#> -//------------------------------------------------------------------------------ -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<# - -if (!String.IsNullOrEmpty(ObjectNamespace)) -{ -#> -namespace <#=Code.EscapeNamespace(ObjectNamespace)#> -{ -<# - PushIndent(CodeRegion.GetIndent(1)); -} - -#> -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -<# -if (container.FunctionImports.Any()) -{ -#> -using System.Data.Objects; -<# -} -#> - -<#=Accessibility.ForType(container)#> partial class <#=Code.Escape(container)#> : DbContext -{ - public <#=Code.Escape(container)#>() - : base("name=<#=container.Name#>") - { -<# - WriteLazyLoadingEnabled(container); -#> - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - -<# - foreach (var entitySet in container.BaseEntitySets.OfType()) - { -#> - <#=Accessibility.ForReadOnlyProperty(entitySet)#> DbSet<<#=Code.Escape(entitySet.ElementType)#>> <#=Code.Escape(entitySet)#> { get; set; } -<# - } - - foreach (var edmFunction in container.FunctionImports) - { - WriteFunctionImport(edmFunction, false); - } -#> -} -<# - -if (!String.IsNullOrEmpty(ObjectNamespace)) -{ - PopIndent(); -#> -} -<# -} -#> -<#+ -string ModelNamespace { get; set; } -string ObjectNamespace { get; set; } -CodeGenerationTools Code { get; set; } -MetadataTools EFTools { get; set; } - -string GetResourceString(string resourceName) -{ - if(_resourceManager == null) - { - _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); - } - - return _resourceManager.GetString(resourceName, null); -} -System.Resources.ResourceManager _resourceManager; - -void WriteLazyLoadingEnabled(EntityContainer container) -{ - string lazyLoadingAttributeValue = null; - var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; - if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) - { - bool isLazyLoading; - if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading) && !isLazyLoading) - { -#> - this.Configuration.LazyLoadingEnabled = false; -<#+ - } - } -} - -void WriteFunctionImport(EdmFunction edmFunction, bool includeMergeOption) -{ - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, Code, EFTools); - var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); - var returnType = edmFunction.ReturnParameter == null ? null : EFTools.GetElementType(edmFunction.ReturnParameter.TypeUsage); - var processedReturn = returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType) + ">"; - - if (includeMergeOption) - { - paramList = Code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } -#> - - <#=AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction))#> <#=processedReturn#> <#=Code.Escape(edmFunction)#>(<#=paramList#>) - { -<#+ - if(returnType != null && (returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || - returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) - { -#> - ((IObjectContextAdapter)this).ObjectContext.MetadataWorkspace.LoadFromAssembly(typeof(<#=MultiSchemaEscape(returnType)#>).Assembly); - -<#+ - } - - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))"; -#> - var <#=parameter.LocalVariableName#> = <#=isNotNull#> ? - <#=notNullInit#> : - <#=nullInit#>; - -<#+ - } - - var genericArg = returnType == null ? "" : "<" + MultiSchemaEscape(returnType) + ">"; - var callParams = Code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } -#> - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<#=genericArg#>("<#=edmFunction.Name#>"<#=callParams#>); - } -<#+ - if(!includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) - { - WriteFunctionImport(edmFunction, true); - } -} - -string AccessibilityAndVirtual(string accessibility) -{ - return accessibility + (accessibility != "private" ? " virtual" : ""); -} - -string MultiSchemaEscape(TypeUsage usage) -{ - var type = usage.EdmType as StructuralType; - return type != null && type.NamespaceName != ModelNamespace ? - Code.CreateFullName(Code.EscapeNamespace(type.NamespaceName), Code.Escape(type)) : - Code.Escape(usage); -} - -#> \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs deleted file mode 100644 index c525f7482..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.Designer.cs +++ /dev/null @@ -1,10 +0,0 @@ -// T4 code generation is enabled for model 'C:\Users\crmhli\source\repos\OpenRiaServices\src\OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\AdventureWorks\AdventureWorksDbCtx.edmx'. -// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer -// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model -// is open in the designer. - -// If no context and entity classes have been generated, it may be because you created an empty model but -// have not yet chosen which version of Entity Framework to use. To generate a context class and entity -// classes for your model, open the model in the designer, right-click on the designer surface, and -// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation -// Item...'. \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs deleted file mode 100644 index 0c4c97d77..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.cs +++ /dev/null @@ -1,9 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx deleted file mode 100644 index e66327900..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.edmx +++ /dev/null @@ -1,6405 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt deleted file mode 100644 index 097b51b40..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksDbCtx.tt +++ /dev/null @@ -1,280 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -CodeGenerationTools code = new CodeGenerationTools(this); -MetadataLoader loader = new MetadataLoader(this); -CodeRegion region = new CodeRegion(this, 1); -MetadataTools ef = new MetadataTools(this); - -string inputFile = @"AdventureWorksDbCtx.edmx"; -EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile); -string namespaceName = code.VsNamespaceSuggestion(); - -EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this); -WriteHeader(fileManager); - -foreach (var entity in ItemCollection.GetItems().OrderBy(e => e.Name)) -{ - fileManager.StartNewFile(entity.Name + ".cs"); - BeginNamespace(namespaceName, code); -#> -using System; -using System.Collections.Generic; - -<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#><#=code.StringBefore(" : ", code.Escape(entity.BaseType))#> -{ -<# - var propertiesWithDefaultValues = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity && p.DefaultValue != null); - var collectionNavigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - var complexProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == entity); - - if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(entity)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var navigationProperty in collectionNavigationProperties) - { -#> - this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=code.Escape(navigationProperty.ToEndMember.GetEntityType())#>>(); -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var primitiveProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity); - if (primitiveProperties.Any()) - { - foreach (var edmProperty in primitiveProperties) - { - WriteProperty(code, edmProperty); - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var complexProperty in complexProperties) - { - WriteProperty(code, complexProperty); - } - } - - var navigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity); - if (navigationProperties.Any()) - { -#> - -<# - foreach (var navigationProperty in navigationProperties) - { - WriteNavigationProperty(code, navigationProperty); - } - } -#> -} -<# - EndNamespace(namespaceName); -} - -foreach (var complex in ItemCollection.GetItems().OrderBy(e => e.Name)) -{ - fileManager.StartNewFile(complex.Name + ".cs"); - BeginNamespace(namespaceName, code); -#> -using System; - -<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> -{ -<# - var complexProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == complex); - var propertiesWithDefaultValues = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex && p.DefaultValue != null); - - if (propertiesWithDefaultValues.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(complex)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var primitiveProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex); - if (primitiveProperties.Any()) - { - foreach(var edmProperty in primitiveProperties) - { - WriteProperty(code, edmProperty); - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var edmProperty in complexProperties) - { - WriteProperty(code, edmProperty); - } - } -#> -} -<# - EndNamespace(namespaceName); -} - -if (!VerifyTypesAreCaseInsensitiveUnique(ItemCollection)) -{ - return ""; -} - -fileManager.Process(); - -#> -<#+ -string GetResourceString(string resourceName) -{ - if(_resourceManager == null) - { - _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); - } - - return _resourceManager.GetString(resourceName, null); -} -System.Resources.ResourceManager _resourceManager; - -void WriteHeader(EntityFrameworkTemplateFileManager fileManager) -{ - fileManager.StartHeader(); -#> -//------------------------------------------------------------------------------ -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<#+ - fileManager.EndBlock(); -} - -void BeginNamespace(string namespaceName, CodeGenerationTools code) -{ - CodeRegion region = new CodeRegion(this); - if (!String.IsNullOrEmpty(namespaceName)) - { -#> -namespace <#=code.EscapeNamespace(namespaceName)#> -{ -<#+ - PushIndent(CodeRegion.GetIndent(1)); - } -} - - -void EndNamespace(string namespaceName) -{ - if (!String.IsNullOrEmpty(namespaceName)) - { - PopIndent(); -#> -} -<#+ - } -} - -void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty) -{ - WriteProperty(Accessibility.ForProperty(edmProperty), - code.Escape(edmProperty.TypeUsage), - code.Escape(edmProperty), - code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - code.SpaceAfter(Accessibility.ForSetter(edmProperty))); -} - -void WriteNavigationProperty(CodeGenerationTools code, NavigationProperty navigationProperty) -{ - var endType = code.Escape(navigationProperty.ToEndMember.GetEntityType()); - WriteProperty(PropertyVirtualModifier(Accessibility.ForProperty(navigationProperty)), - navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - code.Escape(navigationProperty), - code.SpaceAfter(Accessibility.ForGetter(navigationProperty)), - code.SpaceAfter(Accessibility.ForSetter(navigationProperty))); -} - -void WriteProperty(string accessibility, string type, string name, string getterAccessibility, string setterAccessibility) -{ -#> - <#=accessibility#> <#=type#> <#=name#> { <#=getterAccessibility#>get; <#=setterAccessibility#>set; } -<#+ -} - -string PropertyVirtualModifier(string accessibility) -{ - return accessibility + (accessibility != "private" ? " virtual" : ""); -} - -bool VerifyTypesAreCaseInsensitiveUnique(EdmItemCollection itemCollection) -{ - var alreadySeen = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach(var type in itemCollection.GetItems()) - { - if (!(type is EntityType || type is ComplexType)) - { - continue; - } - - if (alreadySeen.ContainsKey(type.FullName)) - { - Error(String.Format(CultureInfo.CurrentCulture, "This template does not support types that differ only by case, the types {0} are not supported", type.FullName)); - return false; - } - else - { - alreadySeen.Add(type.FullName, true); - } - } - - return true; -} -#> diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs deleted file mode 100644 index 8d27c0402..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Runtime.Serialization; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.SqlServer; -using OpenRiaServices.Server; - -// These assembly attributes allow us to serialize different CLR types into the same contract -[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks", - ClrNamespace = "DbContextModels.AdventureWorksEFCore")] - -namespace DbContextModels.AdventureWorksEFCore -{ - public partial class DbCtxAdventureWorksEntities - { - string _connection; - public DbCtxAdventureWorksEntities(string connectionString) - { - _connection = connectionString; - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - base.OnConfiguring(optionsBuilder); - optionsBuilder.UseSqlServer(_connection); - } - } - - [MetadataType(typeof(PurchaseOrderMetadata))] - public partial class PurchaseOrder - { - } - - [MetadataType(typeof(PurchaseOrderDetailMetadata))] - public partial class PurchaseOrderDetail - { - } - - public static class PurchaseOrderMetadata - { - [Include] - public static object PurchaseOrderDetails; - } - - public static class PurchaseOrderDetailMetadata - { - [Include] - public static object Product; - } - - [MetadataType(typeof(ProductMetadata))] - public partial class Product - { - } - - public static class ProductMetadata - { - [Exclude] - public static object SafetyStockLevel; - - [RoundtripOriginal] - public static object Weight; - } - - [MetadataType(typeof(EmployeeMetadata))] - public partial class Employee - { - } - - public static class EmployeeMetadata - { - [Include] - public static object Manager; - } - - public class EmployeeInfo - { - public static EmployeeInfo CreateEmployeeInfo(int employeeID, string firstName, string lastName, int territoryID) - { - EmployeeInfo empInfo = new EmployeeInfo(); - empInfo.EmployeeID = employeeID; - empInfo.FirstName = firstName; - empInfo.LastName = lastName; - empInfo.TerritoryID = territoryID; - return empInfo; - } - - [Key] - public int EmployeeID - { - get; - set; - } - - public string FirstName - { - get; - set; - } - public string LastName - { - get; - set; - } - public int TerritoryID - { - get; - set; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs new file mode 100644 index 000000000..d1df2a117 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs @@ -0,0 +1,487 @@ +// This file has been auto generated by EF Core Power Tools. +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; + +namespace EFCoreModels.AdventureWorks.AdventureWorks +{ + public partial class AdventureworksContext : DbContext + { + public AdventureworksContext() + { + } + + public AdventureworksContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet
Address { get; set; } + public virtual DbSet AddressType { get; set; } + public virtual DbSet BillOfMaterials { get; set; } + public virtual DbSet Contact { get; set; } + public virtual DbSet ContactCreditCard { get; set; } + public virtual DbSet ContactType { get; set; } + public virtual DbSet CountryRegion { get; set; } + public virtual DbSet CountryRegionCurrency { get; set; } + public virtual DbSet CreditCard { get; set; } + public virtual DbSet Culture { get; set; } + public virtual DbSet Currency { get; set; } + public virtual DbSet CurrencyRate { get; set; } + public virtual DbSet Customer { get; set; } + public virtual DbSet CustomerAddress { get; set; } + public virtual DbSet Department { get; set; } + public virtual DbSet Document { get; set; } + public virtual DbSet Employee { get; set; } + public virtual DbSet EmployeeAddress { get; set; } + public virtual DbSet EmployeeDepartmentHistory { get; set; } + public virtual DbSet EmployeePayHistory { get; set; } + public virtual DbSet Illustration { get; set; } + public virtual DbSet Individual { get; set; } + public virtual DbSet JobCandidate { get; set; } + public virtual DbSet Location { get; set; } + public virtual DbSet Product { get; set; } + public virtual DbSet ProductCategory { get; set; } + public virtual DbSet ProductCostHistory { get; set; } + public virtual DbSet ProductDescription { get; set; } + public virtual DbSet ProductDocument { get; set; } + public virtual DbSet ProductInventory { get; set; } + public virtual DbSet ProductListPriceHistory { get; set; } + public virtual DbSet ProductModel { get; set; } + public virtual DbSet ProductModelIllustration { get; set; } + public virtual DbSet ProductModelProductDescriptionCulture { get; set; } + public virtual DbSet ProductPhoto { get; set; } + public virtual DbSet ProductProductPhoto { get; set; } + public virtual DbSet ProductReview { get; set; } + public virtual DbSet ProductSubcategory { get; set; } + public virtual DbSet ProductVendor { get; set; } + public virtual DbSet PurchaseOrderDetail { get; set; } + public virtual DbSet PurchaseOrderHeader { get; set; } + public virtual DbSet SalesOrderDetail { get; set; } + public virtual DbSet SalesOrderHeader { get; set; } + public virtual DbSet SalesOrderHeaderSalesReason { get; set; } + public virtual DbSet SalesPerson { get; set; } + public virtual DbSet SalesPersonQuotaHistory { get; set; } + public virtual DbSet SalesReason { get; set; } + public virtual DbSet SalesTaxRate { get; set; } + public virtual DbSet SalesTerritory { get; set; } + public virtual DbSet SalesTerritoryHistory { get; set; } + public virtual DbSet ScrapReason { get; set; } + public virtual DbSet Shift { get; set; } + public virtual DbSet ShipMethod { get; set; } + public virtual DbSet ShoppingCartItem { get; set; } + public virtual DbSet SpecialOffer { get; set; } + public virtual DbSet SpecialOfferProduct { get; set; } + public virtual DbSet StateProvince { get; set; } + public virtual DbSet Store { get; set; } + public virtual DbSet StoreContact { get; set; } + public virtual DbSet TransactionHistory { get; set; } + public virtual DbSet TransactionHistoryArchive { get; set; } + public virtual DbSet UnitMeasure { get; set; } + public virtual DbSet Vendor { get; set; } + public virtual DbSet VendorAddress { get; set; } + public virtual DbSet VendorContact { get; set; } + public virtual DbSet WorkOrder { get; set; } + public virtual DbSet WorkOrderRouting { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + { + optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=AdventureWorks;Integrated Security=True;Multiple Active Result Sets=True"); + } + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity
(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.UnitMeasureCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.PasswordHash).IsUnicode(false); + + entity.Property(e => e.PasswordSalt).IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.CurrencyCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.CultureID).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.CurrencyCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.FromCurrencyCode).IsFixedLength(); + + entity.Property(e => e.ToCurrencyCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.AccountNumber).IsUnicode(false); + + entity.Property(e => e.CustomerType).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.Revision).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.Gender).IsFixedLength(); + + entity.Property(e => e.MaritalStatus).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.Class).IsFixedLength(); + + entity.Property(e => e.ProductLine).IsFixedLength(); + + entity.Property(e => e.SizeUnitMeasureCode).IsFixedLength(); + + entity.Property(e => e.Style).IsFixedLength(); + + entity.Property(e => e.WeightUnitMeasureCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.CultureID).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.UnitMeasureCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.CreditCardApprovalCode).IsUnicode(false); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.StateProvinceCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.TransactionType).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.TransactionType).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.Property(e => e.UnitMeasureCode).IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs deleted file mode 100644 index 2b5ab3ca7..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterial.cs +++ /dev/null @@ -1,31 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorksEFCore -{ - using System; - using System.Collections.Generic; - - public partial class BillOfMaterial - { - public int BillOfMaterialsID { get; set; } - public Nullable ProductAssemblyID { get; set; } - public int ComponentID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public string UnitMeasureCode { get; set; } - public short BOMLevel { get; set; } - public decimal PerAssemblyQty { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual Product Product1 { get; set; } - public virtual UnitMeasure UnitMeasure { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs new file mode 100644 index 000000000..be4908c92 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs @@ -0,0 +1,28 @@ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace EFCoreModels.AdventureWorks.AdventureWorks +{ + [Table("BillOfMaterials", Schema = "Production")] + public partial class BillOfMaterials + { + public int BillOfMaterialsID { get; set; } + public int? ProductAssemblyID { get; set; } + public int ComponentID { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? EndDate { get; set; } + [Required] + [StringLength(3)] + public string UnitMeasureCode { get; set; } + public short BOMLevel { get; set; } + [Column(TypeName = "decimal(8, 2)")] + public decimal PerAssemblyQty { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } + } +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs index 5e359eeb1..76c616cdb 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs @@ -1,50 +1,43 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Contact", Schema = "Person")] public partial class Contact { - public Contact() - { - this.Employees = new HashSet(); - this.ContactCreditCards = new HashSet(); - this.Individuals = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - this.StoreContacts = new HashSet(); - this.VendorContacts = new HashSet(); - } - public int ContactID { get; set; } public bool NameStyle { get; set; } + [StringLength(8)] public string Title { get; set; } + [Required] + [StringLength(50)] public string FirstName { get; set; } + [StringLength(50)] public string MiddleName { get; set; } + [Required] + [StringLength(50)] public string LastName { get; set; } + [StringLength(10)] public string Suffix { get; set; } + [StringLength(50)] public string EmailAddress { get; set; } public int EmailPromotion { get; set; } + [StringLength(25)] public string Phone { get; set; } + [Required] + [StringLength(128)] public string PasswordHash { get; set; } + [Required] + [StringLength(10)] public string PasswordSalt { get; set; } + [Column(TypeName = "xml")] public string AdditionalContactInfo { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection Employees { get; set; } - public virtual ICollection ContactCreditCards { get; set; } - public virtual ICollection Individuals { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual ICollection StoreContacts { get; set; } - public virtual ICollection VendorContacts { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs index 23dedea59..cf8c5302c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs @@ -1,24 +1,17 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ContactCreditCard", Schema = "Sales")] public partial class ContactCreditCard { public int ContactID { get; set; } public int CreditCardID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual CreditCard CreditCard { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs index e80c53992..5a1ca0677 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs @@ -1,30 +1,19 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ContactType", Schema = "Person")] public partial class ContactType { - public ContactType() - { - this.StoreContacts = new HashSet(); - this.VendorContacts = new HashSet(); - } - public int ContactTypeID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection StoreContacts { get; set; } - public virtual ICollection VendorContacts { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs index 4165add13..431a98c03 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs @@ -1,30 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("CountryRegion", Schema = "Person")] public partial class CountryRegion { - public CountryRegion() - { - this.CountryRegionCurrencies = new HashSet(); - this.StateProvinces = new HashSet(); - } - + [Required] + [StringLength(3)] public string CountryRegionCode { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection CountryRegionCurrencies { get; set; } - public virtual ICollection StateProvinces { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs index 3041d3195..5889c662d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs @@ -1,24 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("CountryRegionCurrency", Schema = "Sales")] public partial class CountryRegionCurrency { + [Required] + [StringLength(3)] public string CountryRegionCode { get; set; } + [Required] + [StringLength(3)] public string CurrencyCode { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual CountryRegion CountryRegion { get; set; } - public virtual Currency Currency { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs index 315e50f73..24ac5c4a6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs @@ -1,33 +1,24 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("CreditCard", Schema = "Sales")] public partial class CreditCard { - public CreditCard() - { - this.ContactCreditCards = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - } - public int CreditCardID { get; set; } + [Required] + [StringLength(50)] public string CardType { get; set; } + [Required] + [StringLength(25)] public string CardNumber { get; set; } public byte ExpMonth { get; set; } public short ExpYear { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ContactCreditCards { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs index 1e7873ac4..9c1be5806 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs @@ -1,28 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Culture", Schema = "Production")] public partial class Culture { - public Culture() - { - this.ProductModelProductDescriptionCultures = new HashSet(); - } - + [Required] + [StringLength(6)] public string CultureID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs index 134de81e0..50ab87988 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs @@ -1,32 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Currency", Schema = "Sales")] public partial class Currency { - public Currency() - { - this.CountryRegionCurrencies = new HashSet(); - this.CurrencyRates = new HashSet(); - this.CurrencyRates1 = new HashSet(); - } - + [Required] + [StringLength(3)] public string CurrencyCode { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection CountryRegionCurrencies { get; set; } - public virtual ICollection CurrencyRates { get; set; } - public virtual ICollection CurrencyRates1 { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs index 52e8a2d98..67825a221 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs @@ -1,34 +1,28 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("CurrencyRate", Schema = "Sales")] public partial class CurrencyRate { - public CurrencyRate() - { - this.SalesOrderHeaders = new HashSet(); - } - public int CurrencyRateID { get; set; } - public System.DateTime CurrencyRateDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime CurrencyRateDate { get; set; } + [Required] + [StringLength(3)] public string FromCurrencyCode { get; set; } + [Required] + [StringLength(3)] public string ToCurrencyCode { get; set; } + [Column(TypeName = "money")] public decimal AverageRate { get; set; } + [Column(TypeName = "money")] public decimal EndOfDayRate { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Currency Currency { get; set; } - public virtual Currency Currency1 { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs index da2802401..adbeedfc0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs @@ -1,36 +1,24 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Customer", Schema = "Sales")] public partial class Customer { - public Customer() - { - this.CustomerAddresses = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - } - public int CustomerID { get; set; } - public Nullable TerritoryID { get; set; } + public int? TerritoryID { get; set; } + [Required] + [StringLength(10)] public string AccountNumber { get; set; } + [Required] + [StringLength(1)] public string CustomerType { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesTerritory SalesTerritory { get; set; } - public virtual ICollection CustomerAddresses { get; set; } - public virtual Individual Individual { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual Store Store { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs index 01e4696ca..068816191 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs @@ -1,27 +1,19 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("CustomerAddress", Schema = "Sales")] public partial class CustomerAddress { public int CustomerID { get; set; } public int AddressID { get; set; } public int AddressTypeID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Address Address { get; set; } - public virtual AddressType AddressType { get; set; } - public virtual Customer Customer { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs deleted file mode 100644 index 0cda0d149..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/DatabaseLog.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorksEFCore -{ - using System; - using System.Collections.Generic; - - public partial class DatabaseLog - { - public int DatabaseLogID { get; set; } - public System.DateTime PostTime { get; set; } - public string DatabaseUser { get; set; } - public string Event { get; set; } - public string Schema { get; set; } - public string Object { get; set; } - public string TSQL { get; set; } - public string XmlEvent { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs index 4048730b5..9e1056591 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs @@ -1,29 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Department", Schema = "HumanResources")] public partial class Department { - public Department() - { - this.EmployeeDepartmentHistories = new HashSet(); - } - public short DepartmentID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } + [Required] + [StringLength(50)] public string GroupName { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection EmployeeDepartmentHistories { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs index ac277b21b..75e053b8d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs @@ -1,35 +1,33 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Document", Schema = "Production")] public partial class Document { - public Document() - { - this.ProductDocuments = new HashSet(); - } - public int DocumentID { get; set; } + [Required] + [StringLength(50)] public string Title { get; set; } + [Required] + [StringLength(400)] public string FileName { get; set; } + [Required] + [StringLength(8)] public string FileExtension { get; set; } + [Required] + [StringLength(5)] public string Revision { get; set; } public int ChangeNumber { get; set; } public byte Status { get; set; } public string DocumentSummary { get; set; } + [Column("Document")] public byte[] Document1 { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductDocuments { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs index d2ccd28f3..965e47058 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs @@ -1,54 +1,42 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Employee", Schema = "HumanResources")] public partial class Employee { - public Employee() - { - this.Reports = new HashSet(); - this.EmployeeAddresses = new HashSet(); - this.EmployeeDepartmentHistories = new HashSet(); - this.EmployeePayHistories = new HashSet(); - this.JobCandidates = new HashSet(); - this.PurchaseOrders = new HashSet(); - } - public int EmployeeID { get; set; } + [Required] + [StringLength(15)] public string NationalIDNumber { get; set; } public int ContactID { get; set; } + [Required] + [StringLength(256)] public string LoginID { get; set; } - public Nullable ManagerID { get; set; } + public int? ManagerID { get; set; } + [Required] + [StringLength(50)] public string Title { get; set; } - public System.DateTime BirthDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime BirthDate { get; set; } + [Required] + [StringLength(1)] public string MaritalStatus { get; set; } + [Required] + [StringLength(1)] public string Gender { get; set; } - public System.DateTime HireDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime HireDate { get; set; } public bool SalariedFlag { get; set; } public short VacationHours { get; set; } public short SickLeaveHours { get; set; } public bool CurrentFlag { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual ICollection Reports { get; set; } - public virtual Employee Manager { get; set; } - public virtual ICollection EmployeeAddresses { get; set; } - public virtual ICollection EmployeeDepartmentHistories { get; set; } - public virtual ICollection EmployeePayHistories { get; set; } - public virtual ICollection JobCandidates { get; set; } - public virtual ICollection PurchaseOrders { get; set; } - public virtual SalesPerson SalesPerson { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs index 219ddf21a..a40152cc5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs @@ -1,25 +1,18 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("EmployeeAddress", Schema = "HumanResources")] public partial class EmployeeAddress { public int EmployeeID { get; set; } public int AddressID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - public virtual Address Address { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs index 7b6ecb654..853d8da1c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs @@ -1,28 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("EmployeeDepartmentHistory", Schema = "HumanResources")] public partial class EmployeeDepartmentHistory { public int EmployeeID { get; set; } public short DepartmentID { get; set; } public byte ShiftID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Department Department { get; set; } - public virtual Employee Employee { get; set; } - public virtual Shift Shift { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? EndDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs index e35e2438a..3842b92b6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs @@ -1,25 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("EmployeePayHistory", Schema = "HumanResources")] public partial class EmployeePayHistory { public int EmployeeID { get; set; } - public System.DateTime RateChangeDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime RateChangeDate { get; set; } + [Column(TypeName = "money")] public decimal Rate { get; set; } public byte PayFrequency { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs deleted file mode 100644 index c558e789d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ErrorLog.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorksEFCore -{ - using System; - using System.Collections.Generic; - - public partial class ErrorLog - { - public int ErrorLogID { get; set; } - public System.DateTime ErrorTime { get; set; } - public string UserName { get; set; } - public int ErrorNumber { get; set; } - public Nullable ErrorSeverity { get; set; } - public Nullable ErrorState { get; set; } - public string ErrorProcedure { get; set; } - public Nullable ErrorLine { get; set; } - public string ErrorMessage { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs index 7135bdaae..676d92ab2 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs @@ -1,28 +1,18 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Illustration", Schema = "Production")] public partial class Illustration { - public Illustration() - { - this.ProductModelIllustrations = new HashSet(); - } - public int IllustrationID { get; set; } + [Column(TypeName = "xml")] public string Diagram { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductModelIllustrations { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs index 75b95c8c3..81f7ab7e4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs @@ -1,25 +1,19 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Individual", Schema = "Sales")] public partial class Individual { public int CustomerID { get; set; } public int ContactID { get; set; } + [Column(TypeName = "xml")] public string Demographics { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual Customer Customer { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs index e54da12b3..5aa510e79 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs @@ -1,24 +1,19 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("JobCandidate", Schema = "HumanResources")] public partial class JobCandidate { public int JobCandidateID { get; set; } - public Nullable EmployeeID { get; set; } + public int? EmployeeID { get; set; } + [Column(TypeName = "xml")] public string Resume { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs index 238e6725c..3ff90d05c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs @@ -1,32 +1,23 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Location", Schema = "Production")] public partial class Location { - public Location() - { - this.ProductInventories = new HashSet(); - this.WorkOrderRoutings = new HashSet(); - } - public short LocationID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } + [Column(TypeName = "money")] public decimal CostRate { get; set; } + [Column(TypeName = "decimal(8, 2)")] public decimal Availability { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductInventories { get; set; } - public virtual ICollection WorkOrderRoutings { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs index 6c525acd7..df509f6a6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs @@ -1,80 +1,56 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Product", Schema = "Production")] public partial class Product { - public Product() - { - this.BillOfMaterials = new HashSet(); - this.BillOfMaterials1 = new HashSet(); - this.ProductCostHistories = new HashSet(); - this.ProductDocuments = new HashSet(); - this.ProductInventories = new HashSet(); - this.ProductListPriceHistories = new HashSet(); - this.ProductProductPhotoes = new HashSet(); - this.ProductReviews = new HashSet(); - this.ProductVendors = new HashSet(); - this.PurchaseOrderDetails = new HashSet(); - this.ShoppingCartItems = new HashSet(); - this.SpecialOfferProducts = new HashSet(); - this.TransactionHistories = new HashSet(); - this.WorkOrders = new HashSet(); - } - public int ProductID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } + [Required] + [StringLength(25)] public string ProductNumber { get; set; } public bool MakeFlag { get; set; } public bool FinishedGoodsFlag { get; set; } + [StringLength(15)] public string Color { get; set; } public short SafetyStockLevel { get; set; } public short ReorderPoint { get; set; } + [Column(TypeName = "money")] public decimal StandardCost { get; set; } + [Column(TypeName = "money")] public decimal ListPrice { get; set; } + [StringLength(5)] public string Size { get; set; } + [StringLength(3)] public string SizeUnitMeasureCode { get; set; } + [StringLength(3)] public string WeightUnitMeasureCode { get; set; } - public Nullable Weight { get; set; } + [Column(TypeName = "decimal(8, 2)")] + public decimal? Weight { get; set; } public int DaysToManufacture { get; set; } + [StringLength(2)] public string ProductLine { get; set; } + [StringLength(2)] public string Class { get; set; } + [StringLength(2)] public string Style { get; set; } - public Nullable ProductSubcategoryID { get; set; } - public Nullable ProductModelID { get; set; } - public System.DateTime SellStartDate { get; set; } - public Nullable SellEndDate { get; set; } - public Nullable DiscontinuedDate { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection BillOfMaterials { get; set; } - public virtual ICollection BillOfMaterials1 { get; set; } - public virtual ProductModel ProductModel { get; set; } - public virtual ProductSubcategory ProductSubcategory { get; set; } - public virtual UnitMeasure UnitMeasure { get; set; } - public virtual UnitMeasure UnitMeasure1 { get; set; } - public virtual ICollection ProductCostHistories { get; set; } - public virtual ICollection ProductDocuments { get; set; } - public virtual ICollection ProductInventories { get; set; } - public virtual ICollection ProductListPriceHistories { get; set; } - public virtual ICollection ProductProductPhotoes { get; set; } - public virtual ICollection ProductReviews { get; set; } - public virtual ICollection ProductVendors { get; set; } - public virtual ICollection PurchaseOrderDetails { get; set; } - public virtual ICollection ShoppingCartItems { get; set; } - public virtual ICollection SpecialOfferProducts { get; set; } - public virtual ICollection TransactionHistories { get; set; } - public virtual ICollection WorkOrders { get; set; } + public int? ProductSubcategoryID { get; set; } + public int? ProductModelID { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime SellStartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? SellEndDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? DiscontinuedDate { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs index 5dd599ef2..c8b2dfcb4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs @@ -1,29 +1,20 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductCategory", Schema = "Production")] public partial class ProductCategory { - public ProductCategory() - { - this.ProductSubcategories = new HashSet(); - } - public int ProductCategoryID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductSubcategories { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs index fff1c9b1c..568d75784 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs @@ -1,25 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductCostHistory", Schema = "Production")] public partial class ProductCostHistory { public int ProductID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? EndDate { get; set; } + [Column(TypeName = "money")] public decimal StandardCost { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs index 5b6593d73..9930cc36f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs @@ -1,29 +1,20 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductDescription", Schema = "Production")] public partial class ProductDescription { - public ProductDescription() - { - this.ProductModelProductDescriptionCultures = new HashSet(); - } - public int ProductDescriptionID { get; set; } + [Required] + [StringLength(400)] public string Description { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs index 633000193..e4c36afa3 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs @@ -1,24 +1,17 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductDocument", Schema = "Production")] public partial class ProductDocument { public int ProductID { get; set; } public int DocumentID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Document Document { get; set; } - public virtual Product Product { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs index 57c0bdede..9a1fd9d4d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs @@ -1,28 +1,23 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductInventory", Schema = "Production")] public partial class ProductInventory { public int ProductID { get; set; } public short LocationID { get; set; } + [Required] + [StringLength(10)] public string Shelf { get; set; } public byte Bin { get; set; } public short Quantity { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Location Location { get; set; } - public virtual Product Product { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs index 5d011b63a..49c37f5a8 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs @@ -1,25 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductListPriceHistory", Schema = "Production")] public partial class ProductListPriceHistory { public int ProductID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? EndDate { get; set; } + [Column(TypeName = "money")] public decimal ListPrice { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs index 42bae6938..0343f4538 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs @@ -1,35 +1,24 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductModel", Schema = "Production")] public partial class ProductModel { - public ProductModel() - { - this.Products = new HashSet(); - this.ProductModelIllustrations = new HashSet(); - this.ProductModelProductDescriptionCultures = new HashSet(); - } - public int ProductModelID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } + [Column(TypeName = "xml")] public string CatalogDescription { get; set; } + [Column(TypeName = "xml")] public string Instructions { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection Products { get; set; } - public virtual ICollection ProductModelIllustrations { get; set; } - public virtual ICollection ProductModelProductDescriptionCultures { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs index dd029f17c..34645dbd7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs @@ -1,24 +1,17 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductModelIllustration", Schema = "Production")] public partial class ProductModelIllustration { public int ProductModelID { get; set; } public int IllustrationID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Illustration Illustration { get; set; } - public virtual ProductModel ProductModel { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs index 2297d3b84..43ce57fa9 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs @@ -1,26 +1,20 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductModelProductDescriptionCulture", Schema = "Production")] public partial class ProductModelProductDescriptionCulture { public int ProductModelID { get; set; } public int ProductDescriptionID { get; set; } + [Required] + [StringLength(6)] public string CultureID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Culture Culture { get; set; } - public virtual ProductDescription ProductDescription { get; set; } - public virtual ProductModel ProductModel { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs index ac1820864..1b57e0709 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs @@ -1,31 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductPhoto", Schema = "Production")] public partial class ProductPhoto { - public ProductPhoto() - { - this.ProductProductPhotoes = new HashSet(); - } - public int ProductPhotoID { get; set; } public byte[] ThumbNailPhoto { get; set; } + [StringLength(50)] public string ThumbnailPhotoFileName { get; set; } public byte[] LargePhoto { get; set; } + [StringLength(50)] public string LargePhotoFileName { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductProductPhotoes { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs index 3fa49df95..aaddb75ec 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs @@ -1,25 +1,18 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductProductPhoto", Schema = "Production")] public partial class ProductProductPhoto { public int ProductID { get; set; } public int ProductPhotoID { get; set; } public bool Primary { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual ProductPhoto ProductPhoto { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs index 86c5ea4e8..149d39827 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs @@ -1,28 +1,28 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductReview", Schema = "Production")] public partial class ProductReview { public int ProductReviewID { get; set; } public int ProductID { get; set; } + [Required] + [StringLength(50)] public string ReviewerName { get; set; } - public System.DateTime ReviewDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ReviewDate { get; set; } + [Required] + [StringLength(50)] public string EmailAddress { get; set; } public int Rating { get; set; } + [StringLength(3850)] public string Comments { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs index 23ca32647..50daa5841 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs @@ -1,31 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductSubcategory", Schema = "Production")] public partial class ProductSubcategory { - public ProductSubcategory() - { - this.Products = new HashSet(); - } - public int ProductSubcategoryID { get; set; } public int ProductCategoryID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection Products { get; set; } - public virtual ProductCategory ProductCategory { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs index 424027eea..e25a0c61f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs @@ -1,33 +1,30 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ProductVendor", Schema = "Purchasing")] public partial class ProductVendor { public int ProductID { get; set; } public int VendorID { get; set; } public int AverageLeadTime { get; set; } + [Column(TypeName = "money")] public decimal StandardPrice { get; set; } - public Nullable LastReceiptCost { get; set; } - public Nullable LastReceiptDate { get; set; } + [Column(TypeName = "money")] + public decimal? LastReceiptCost { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? LastReceiptDate { get; set; } public int MinOrderQty { get; set; } public int MaxOrderQty { get; set; } - public Nullable OnOrderQty { get; set; } + public int? OnOrderQty { get; set; } + [Required] + [StringLength(3)] public string UnitMeasureCode { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual UnitMeasure UnitMeasure { get; set; } - public virtual Vendor Vendor { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs deleted file mode 100644 index 60bf72467..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs +++ /dev/null @@ -1,41 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorksEFCore -{ - using System; - using System.Collections.Generic; - - public partial class PurchaseOrder - { - public PurchaseOrder() - { - this.PurchaseOrderDetails = new HashSet(); - } - - public int PurchaseOrderID { get; set; } - public byte RevisionNumber { get; set; } - public byte Status { get; set; } - public int EmployeeID { get; set; } - public int VendorID { get; set; } - public int ShipMethodID { get; set; } - public System.DateTime OrderDate { get; set; } - public Nullable ShipDate { get; set; } - public decimal SubTotal { get; set; } - public decimal TaxAmt { get; set; } - public decimal Freight { get; set; } - public decimal TotalDue { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - public virtual ICollection PurchaseOrderDetails { get; set; } - public virtual ShipMethod ShipMethod { get; set; } - public virtual Vendor Vendor { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs index 9e5573d6c..01fab3f5d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs @@ -1,32 +1,31 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("PurchaseOrderDetail", Schema = "Purchasing")] public partial class PurchaseOrderDetail { public int PurchaseOrderID { get; set; } public int PurchaseOrderDetailID { get; set; } - public System.DateTime DueDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime DueDate { get; set; } public short OrderQty { get; set; } public int ProductID { get; set; } + [Column(TypeName = "money")] public decimal UnitPrice { get; set; } + [Column(TypeName = "money")] public decimal LineTotal { get; set; } + [Column(TypeName = "decimal(8, 2)")] public decimal ReceivedQty { get; set; } + [Column(TypeName = "decimal(8, 2)")] public decimal RejectedQty { get; set; } + [Column(TypeName = "decimal(9, 2)")] public decimal StockedQty { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual PurchaseOrder PurchaseOrder { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderHeader.cs new file mode 100644 index 000000000..bee9017ab --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderHeader.cs @@ -0,0 +1,33 @@ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace EFCoreModels.AdventureWorks.AdventureWorks +{ + [Table("PurchaseOrderHeader", Schema = "Purchasing")] + public partial class PurchaseOrderHeader + { + public int PurchaseOrderID { get; set; } + public byte RevisionNumber { get; set; } + public byte Status { get; set; } + public int EmployeeID { get; set; } + public int VendorID { get; set; } + public int ShipMethodID { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime OrderDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? ShipDate { get; set; } + [Column(TypeName = "money")] + public decimal SubTotal { get; set; } + [Column(TypeName = "money")] + public decimal TaxAmt { get; set; } + [Column(TypeName = "money")] + public decimal Freight { get; set; } + [Column(TypeName = "money")] + public decimal TotalDue { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } + } +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs index 2036c38e3..22e628067 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs @@ -1,32 +1,29 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesOrderDetail", Schema = "Sales")] public partial class SalesOrderDetail { public int SalesOrderID { get; set; } public int SalesOrderDetailID { get; set; } + [StringLength(25)] public string CarrierTrackingNumber { get; set; } public short OrderQty { get; set; } public int ProductID { get; set; } public int SpecialOfferID { get; set; } + [Column(TypeName = "money")] public decimal UnitPrice { get; set; } + [Column(TypeName = "money")] public decimal UnitPriceDiscount { get; set; } + [Column(TypeName = "decimal(38, 6)")] public decimal LineTotal { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesOrderHeader SalesOrderHeader { get; set; } - public virtual SpecialOfferProduct SpecialOfferProduct { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs index 21ca06fb2..51f31fc48 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs @@ -1,63 +1,54 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesOrderHeader", Schema = "Sales")] public partial class SalesOrderHeader { - public SalesOrderHeader() - { - this.SalesOrderDetails = new HashSet(); - this.SalesOrderHeaderSalesReasons = new HashSet(); - } - public int SalesOrderID { get; set; } public byte RevisionNumber { get; set; } - public System.DateTime OrderDate { get; set; } - public System.DateTime DueDate { get; set; } - public Nullable ShipDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime OrderDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime DueDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? ShipDate { get; set; } public byte Status { get; set; } public bool OnlineOrderFlag { get; set; } + [Required] + [StringLength(25)] public string SalesOrderNumber { get; set; } + [StringLength(25)] public string PurchaseOrderNumber { get; set; } + [StringLength(15)] public string AccountNumber { get; set; } public int CustomerID { get; set; } public int ContactID { get; set; } - public Nullable SalesPersonID { get; set; } - public Nullable TerritoryID { get; set; } + public int? SalesPersonID { get; set; } + public int? TerritoryID { get; set; } public int BillToAddressID { get; set; } public int ShipToAddressID { get; set; } public int ShipMethodID { get; set; } - public Nullable CreditCardID { get; set; } + public int? CreditCardID { get; set; } + [StringLength(15)] public string CreditCardApprovalCode { get; set; } - public Nullable CurrencyRateID { get; set; } + public int? CurrencyRateID { get; set; } + [Column(TypeName = "money")] public decimal SubTotal { get; set; } + [Column(TypeName = "money")] public decimal TaxAmt { get; set; } + [Column(TypeName = "money")] public decimal Freight { get; set; } + [Column(TypeName = "money")] public decimal TotalDue { get; set; } + [StringLength(128)] public string Comment { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Address Address { get; set; } - public virtual Address Address1 { get; set; } - public virtual Contact Contact { get; set; } - public virtual ShipMethod ShipMethod { get; set; } - public virtual CreditCard CreditCard { get; set; } - public virtual CurrencyRate CurrencyRate { get; set; } - public virtual Customer Customer { get; set; } - public virtual ICollection SalesOrderDetails { get; set; } - public virtual SalesPerson SalesPerson { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } - public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs index 1c2960fd5..cf90b2f2f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs @@ -1,24 +1,17 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesOrderHeaderSalesReason", Schema = "Sales")] public partial class SalesOrderHeaderSalesReason { public int SalesOrderID { get; set; } public int SalesReasonID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesOrderHeader SalesOrderHeader { get; set; } - public virtual SalesReason SalesReason { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs index 80a07073c..2056591ee 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs @@ -1,42 +1,28 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesPerson", Schema = "Sales")] public partial class SalesPerson { - public SalesPerson() - { - this.SalesOrderHeaders = new HashSet(); - this.SalesPersonQuotaHistories = new HashSet(); - this.SalesTerritoryHistories = new HashSet(); - this.Stores = new HashSet(); - } - public int SalesPersonID { get; set; } - public Nullable TerritoryID { get; set; } - public Nullable SalesQuota { get; set; } + public int? TerritoryID { get; set; } + [Column(TypeName = "money")] + public decimal? SalesQuota { get; set; } + [Column(TypeName = "money")] public decimal Bonus { get; set; } + [Column(TypeName = "money")] public decimal CommissionPct { get; set; } + [Column(TypeName = "money")] public decimal SalesYTD { get; set; } + [Column(TypeName = "money")] public decimal SalesLastYear { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Employee Employee { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } - public virtual ICollection SalesPersonQuotaHistories { get; set; } - public virtual ICollection SalesTerritoryHistories { get; set; } - public virtual ICollection Stores { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs index 9bd35d428..8d8672a55 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs @@ -1,25 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesPersonQuotaHistory", Schema = "Sales")] public partial class SalesPersonQuotaHistory { public int SalesPersonID { get; set; } - public System.DateTime QuotaDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime QuotaDate { get; set; } + [Column(TypeName = "money")] public decimal SalesQuota { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesPerson SalesPerson { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs index d3ca67609..098f051f1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs @@ -1,29 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesReason", Schema = "Sales")] public partial class SalesReason { - public SalesReason() - { - this.SalesOrderHeaderSalesReasons = new HashSet(); - } - public int SalesReasonID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } + [Required] + [StringLength(50)] public string ReasonType { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection SalesOrderHeaderSalesReasons { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs index afc578771..26c56e6ff 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs @@ -1,27 +1,24 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesTaxRate", Schema = "Sales")] public partial class SalesTaxRate { public int SalesTaxRateID { get; set; } public int StateProvinceID { get; set; } public byte TaxType { get; set; } + [Column(TypeName = "money")] public decimal TaxRate { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual StateProvince StateProvince { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs index 21684fec4..2fff70867 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs @@ -1,43 +1,34 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesTerritory", Schema = "Sales")] public partial class SalesTerritory { - public SalesTerritory() - { - this.StateProvinces = new HashSet(); - this.Customers = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - this.SalesPersons = new HashSet(); - this.SalesTerritoryHistories = new HashSet(); - } - public int TerritoryID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } + [Required] + [StringLength(3)] public string CountryRegionCode { get; set; } + [Required] + [StringLength(50)] public string Group { get; set; } + [Column(TypeName = "money")] public decimal SalesYTD { get; set; } + [Column(TypeName = "money")] public decimal SalesLastYear { get; set; } + [Column(TypeName = "money")] public decimal CostYTD { get; set; } + [Column(TypeName = "money")] public decimal CostLastYear { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection StateProvinces { get; set; } - public virtual ICollection Customers { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } - public virtual ICollection SalesPersons { get; set; } - public virtual ICollection SalesTerritoryHistories { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs index 96cf93d01..d5048d4f1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs @@ -1,27 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SalesTerritoryHistory", Schema = "Sales")] public partial class SalesTerritoryHistory { public int SalesPersonID { get; set; } public int TerritoryID { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual SalesPerson SalesPerson { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? EndDate { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs deleted file mode 100644 index c28036d8e..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Address.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Address - { - public int AddressId { get; set; } - public string AddressLine1 { get; set; } - public string AddressLine2 { get; set; } - public string City { get; set; } - public int StateProvinceId { get; set; } - public string PostalCode { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs deleted file mode 100644 index 881901218..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AddressType.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class AddressType - { - public int AddressTypeId { get; set; } - public string Name { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs deleted file mode 100644 index 9413423c5..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AdventureWorksContext.cs +++ /dev/null @@ -1,1650 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class AdventureWorksContext : DbContext - { - public AdventureWorksContext() - { - } - - public AdventureWorksContext(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet
Address { get; set; } - public virtual DbSet AddressType { get; set; } - public virtual DbSet AwbuildVersion { get; set; } - public virtual DbSet BillOfMaterials { get; set; } - public virtual DbSet Contact { get; set; } - public virtual DbSet ContactCreditCard { get; set; } - public virtual DbSet ContactType { get; set; } - public virtual DbSet CountryRegion { get; set; } - public virtual DbSet CountryRegionCurrency { get; set; } - public virtual DbSet CreditCard { get; set; } - public virtual DbSet Culture { get; set; } - public virtual DbSet Currency { get; set; } - public virtual DbSet CurrencyRate { get; set; } - public virtual DbSet Customer { get; set; } - public virtual DbSet CustomerAddress { get; set; } - public virtual DbSet DatabaseLog { get; set; } - public virtual DbSet Department { get; set; } - public virtual DbSet Document { get; set; } - public virtual DbSet Employee { get; set; } - public virtual DbSet EmployeeAddress { get; set; } - public virtual DbSet EmployeeDepartmentHistory { get; set; } - public virtual DbSet EmployeePayHistory { get; set; } - public virtual DbSet ErrorLog { get; set; } - public virtual DbSet Illustration { get; set; } - public virtual DbSet Individual { get; set; } - public virtual DbSet JobCandidate { get; set; } - public virtual DbSet Location { get; set; } - public virtual DbSet Product { get; set; } - public virtual DbSet ProductCategory { get; set; } - public virtual DbSet ProductCostHistory { get; set; } - public virtual DbSet ProductDescription { get; set; } - public virtual DbSet ProductDocument { get; set; } - public virtual DbSet ProductInventory { get; set; } - public virtual DbSet ProductListPriceHistory { get; set; } - public virtual DbSet ProductModel { get; set; } - public virtual DbSet ProductModelIllustration { get; set; } - public virtual DbSet ProductModelProductDescriptionCulture { get; set; } - public virtual DbSet ProductPhoto { get; set; } - public virtual DbSet ProductProductPhoto { get; set; } - public virtual DbSet ProductReview { get; set; } - public virtual DbSet ProductSubcategory { get; set; } - public virtual DbSet ProductVendor { get; set; } - public virtual DbSet PurchaseOrderDetail { get; set; } - public virtual DbSet PurchaseOrderHeader { get; set; } - public virtual DbSet SalesOrderDetail { get; set; } - public virtual DbSet SalesOrderHeader { get; set; } - public virtual DbSet SalesOrderHeaderSalesReason { get; set; } - public virtual DbSet SalesPerson { get; set; } - public virtual DbSet SalesPersonQuotaHistory { get; set; } - public virtual DbSet SalesReason { get; set; } - public virtual DbSet SalesTaxRate { get; set; } - public virtual DbSet SalesTerritory { get; set; } - public virtual DbSet SalesTerritoryHistory { get; set; } - public virtual DbSet ScrapReason { get; set; } - public virtual DbSet Shift { get; set; } - public virtual DbSet ShipMethod { get; set; } - public virtual DbSet ShoppingCartItem { get; set; } - public virtual DbSet SpecialOffer { get; set; } - public virtual DbSet SpecialOfferProduct { get; set; } - public virtual DbSet StateProvince { get; set; } - public virtual DbSet Store { get; set; } - public virtual DbSet StoreContact { get; set; } - public virtual DbSet TransactionHistory { get; set; } - public virtual DbSet TransactionHistoryArchive { get; set; } - public virtual DbSet UnitMeasure { get; set; } - public virtual DbSet Vendor { get; set; } - public virtual DbSet VendorAddress { get; set; } - public virtual DbSet VendorContact { get; set; } - public virtual DbSet WorkOrder { get; set; } - public virtual DbSet WorkOrderRouting { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - if (!optionsBuilder.IsConfigured) - { -#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. - optionsBuilder.UseSqlServer("server=.\\SQLEXPRESS;initial catalog=AdventureWorks;Integrated Security=SSPI; MultipleActiveResultSets=true"); - } - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity
(entity => - { - entity.HasNoKey(); - - entity.ToTable("Address", "Person"); - - entity.Property(e => e.AddressId).HasColumnName("AddressID"); - - entity.Property(e => e.AddressLine1) - .IsRequired() - .HasMaxLength(60); - - entity.Property(e => e.AddressLine2).HasMaxLength(60); - - entity.Property(e => e.City) - .IsRequired() - .HasMaxLength(30); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.PostalCode) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.StateProvinceId).HasColumnName("StateProvinceID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("AddressType", "Person"); - - entity.Property(e => e.AddressTypeId).HasColumnName("AddressTypeID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("AWBuildVersion"); - - entity.Property(e => e.DatabaseVersion) - .IsRequired() - .HasColumnName("Database Version") - .HasMaxLength(25); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.SystemInformationId).HasColumnName("SystemInformationID"); - - entity.Property(e => e.VersionDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("BillOfMaterials", "Production"); - - entity.Property(e => e.BillOfMaterialsId).HasColumnName("BillOfMaterialsID"); - - entity.Property(e => e.Bomlevel).HasColumnName("BOMLevel"); - - entity.Property(e => e.ComponentId).HasColumnName("ComponentID"); - - entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.PerAssemblyQty).HasColumnType("decimal(8, 2)"); - - entity.Property(e => e.ProductAssemblyId).HasColumnName("ProductAssemblyID"); - - entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.UnitMeasureCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Contact", "Person"); - - entity.Property(e => e.AdditionalContactInfo).HasColumnType("xml"); - - entity.Property(e => e.ContactId).HasColumnName("ContactID"); - - entity.Property(e => e.EmailAddress).HasMaxLength(50); - - entity.Property(e => e.FirstName) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.LastName) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.MiddleName).HasMaxLength(50); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.PasswordHash) - .IsRequired() - .HasMaxLength(128) - .IsUnicode(false); - - entity.Property(e => e.PasswordSalt) - .IsRequired() - .HasMaxLength(10) - .IsUnicode(false); - - entity.Property(e => e.Phone).HasMaxLength(25); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.Suffix).HasMaxLength(10); - - entity.Property(e => e.Title).HasMaxLength(8); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ContactCreditCard", "Sales"); - - entity.Property(e => e.ContactId).HasColumnName("ContactID"); - - entity.Property(e => e.CreditCardId).HasColumnName("CreditCardID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ContactType", "Person"); - - entity.Property(e => e.ContactTypeId).HasColumnName("ContactTypeID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("CountryRegion", "Person"); - - entity.Property(e => e.CountryRegionCode) - .IsRequired() - .HasMaxLength(3); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("CountryRegionCurrency", "Sales"); - - entity.Property(e => e.CountryRegionCode) - .IsRequired() - .HasMaxLength(3); - - entity.Property(e => e.CurrencyCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("CreditCard", "Sales"); - - entity.Property(e => e.CardNumber) - .IsRequired() - .HasMaxLength(25); - - entity.Property(e => e.CardType) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.CreditCardId).HasColumnName("CreditCardID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Culture", "Production"); - - entity.Property(e => e.CultureId) - .IsRequired() - .HasColumnName("CultureID") - .HasMaxLength(6) - .IsFixedLength(); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Currency", "Sales"); - - entity.Property(e => e.CurrencyCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("CurrencyRate", "Sales"); - - entity.Property(e => e.AverageRate).HasColumnType("money"); - - entity.Property(e => e.CurrencyRateDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.CurrencyRateId).HasColumnName("CurrencyRateID"); - - entity.Property(e => e.EndOfDayRate).HasColumnType("money"); - - entity.Property(e => e.FromCurrencyCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ToCurrencyCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Customer", "Sales"); - - entity.Property(e => e.AccountNumber) - .IsRequired() - .HasMaxLength(10) - .IsUnicode(false); - - entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); - - entity.Property(e => e.CustomerType) - .IsRequired() - .HasMaxLength(1) - .IsFixedLength(); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("CustomerAddress", "Sales"); - - entity.Property(e => e.AddressId).HasColumnName("AddressID"); - - entity.Property(e => e.AddressTypeId).HasColumnName("AddressTypeID"); - - entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.DatabaseLogId).HasColumnName("DatabaseLogID"); - - entity.Property(e => e.DatabaseUser) - .IsRequired() - .HasMaxLength(128); - - entity.Property(e => e.Event) - .IsRequired() - .HasMaxLength(128); - - entity.Property(e => e.Object).HasMaxLength(128); - - entity.Property(e => e.PostTime).HasColumnType("smalldatetime"); - - entity.Property(e => e.Schema).HasMaxLength(128); - - entity.Property(e => e.Tsql) - .IsRequired() - .HasColumnName("TSQL"); - - entity.Property(e => e.XmlEvent) - .IsRequired() - .HasColumnType("xml"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Department", "HumanResources"); - - entity.Property(e => e.DepartmentId).HasColumnName("DepartmentID"); - - entity.Property(e => e.GroupName) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Document", "Production"); - - entity.Property(e => e.Document1).HasColumnName("Document"); - - entity.Property(e => e.DocumentId).HasColumnName("DocumentID"); - - entity.Property(e => e.FileExtension) - .IsRequired() - .HasMaxLength(8); - - entity.Property(e => e.FileName) - .IsRequired() - .HasMaxLength(400); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Revision) - .IsRequired() - .HasMaxLength(5) - .IsFixedLength(); - - entity.Property(e => e.Title) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Employee", "HumanResources"); - - entity.Property(e => e.BirthDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ContactId).HasColumnName("ContactID"); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.Gender) - .IsRequired() - .HasMaxLength(1) - .IsFixedLength(); - - entity.Property(e => e.HireDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.LoginId) - .IsRequired() - .HasColumnName("LoginID") - .HasMaxLength(256); - - entity.Property(e => e.ManagerId).HasColumnName("ManagerID"); - - entity.Property(e => e.MaritalStatus) - .IsRequired() - .HasMaxLength(1) - .IsFixedLength(); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.NationalIdnumber) - .IsRequired() - .HasColumnName("NationalIDNumber") - .HasMaxLength(15); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.Title) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("EmployeeAddress", "HumanResources"); - - entity.Property(e => e.AddressId).HasColumnName("AddressID"); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("EmployeeDepartmentHistory", "HumanResources"); - - entity.Property(e => e.DepartmentId).HasColumnName("DepartmentID"); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ShiftId).HasColumnName("ShiftID"); - - entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("EmployeePayHistory", "HumanResources"); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rate).HasColumnType("money"); - - entity.Property(e => e.RateChangeDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.ErrorLogId).HasColumnName("ErrorLogID"); - - entity.Property(e => e.ErrorMessage) - .IsRequired() - .HasMaxLength(4000); - - entity.Property(e => e.ErrorProcedure).HasMaxLength(126); - - entity.Property(e => e.ErrorTime).HasColumnType("smalldatetime"); - - entity.Property(e => e.UserName) - .IsRequired() - .HasMaxLength(128); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Illustration", "Production"); - - entity.Property(e => e.Diagram).HasColumnType("xml"); - - entity.Property(e => e.IllustrationId).HasColumnName("IllustrationID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Individual", "Sales"); - - entity.Property(e => e.ContactId).HasColumnName("ContactID"); - - entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); - - entity.Property(e => e.Demographics).HasColumnType("xml"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("JobCandidate", "HumanResources"); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.JobCandidateId).HasColumnName("JobCandidateID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Resume).HasColumnType("xml"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Location", "Production"); - - entity.Property(e => e.Availability).HasColumnType("decimal(8, 2)"); - - entity.Property(e => e.CostRate).HasColumnType("money"); - - entity.Property(e => e.LocationId).HasColumnName("LocationID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Product", "Production"); - - entity.Property(e => e.Class) - .HasMaxLength(2) - .IsFixedLength(); - - entity.Property(e => e.Color).HasMaxLength(15); - - entity.Property(e => e.DiscontinuedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ListPrice).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ProductLine) - .HasMaxLength(2) - .IsFixedLength(); - - entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); - - entity.Property(e => e.ProductNumber) - .IsRequired() - .HasMaxLength(25); - - entity.Property(e => e.ProductSubcategoryId).HasColumnName("ProductSubcategoryID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SellEndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.SellStartDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Size).HasMaxLength(5); - - entity.Property(e => e.SizeUnitMeasureCode) - .HasMaxLength(3) - .IsFixedLength(); - - entity.Property(e => e.StandardCost).HasColumnType("money"); - - entity.Property(e => e.Style) - .HasMaxLength(2) - .IsFixedLength(); - - entity.Property(e => e.Weight).HasColumnType("decimal(8, 2)"); - - entity.Property(e => e.WeightUnitMeasureCode) - .HasMaxLength(3) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductCategory", "Production"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ProductCategoryId).HasColumnName("ProductCategoryID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductCostHistory", "Production"); - - entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.StandardCost).HasColumnType("money"); - - entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductDescription", "Production"); - - entity.Property(e => e.Description) - .IsRequired() - .HasMaxLength(400); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductDescriptionId).HasColumnName("ProductDescriptionID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductDocument", "Production"); - - entity.Property(e => e.DocumentId).HasColumnName("DocumentID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductInventory", "Production"); - - entity.Property(e => e.LocationId).HasColumnName("LocationID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.Shelf) - .IsRequired() - .HasMaxLength(10); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductListPriceHistory", "Production"); - - entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ListPrice).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductModel", "Production"); - - entity.Property(e => e.CatalogDescription).HasColumnType("xml"); - - entity.Property(e => e.Instructions).HasColumnType("xml"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductModelIllustration", "Production"); - - entity.Property(e => e.IllustrationId).HasColumnName("IllustrationID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductModelProductDescriptionCulture", "Production"); - - entity.Property(e => e.CultureId) - .IsRequired() - .HasColumnName("CultureID") - .HasMaxLength(6) - .IsFixedLength(); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductDescriptionId).HasColumnName("ProductDescriptionID"); - - entity.Property(e => e.ProductModelId).HasColumnName("ProductModelID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductPhoto", "Production"); - - entity.Property(e => e.LargePhotoFileName).HasMaxLength(50); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductPhotoId).HasColumnName("ProductPhotoID"); - - entity.Property(e => e.ThumbnailPhotoFileName).HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductProductPhoto", "Production"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ProductPhotoId).HasColumnName("ProductPhotoID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductReview", "Production"); - - entity.Property(e => e.Comments).HasMaxLength(3850); - - entity.Property(e => e.EmailAddress) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ProductReviewId).HasColumnName("ProductReviewID"); - - entity.Property(e => e.ReviewDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ReviewerName) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductSubcategory", "Production"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ProductCategoryId).HasColumnName("ProductCategoryID"); - - entity.Property(e => e.ProductSubcategoryId).HasColumnName("ProductSubcategoryID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ProductVendor", "Purchasing"); - - entity.Property(e => e.LastReceiptCost).HasColumnType("money"); - - entity.Property(e => e.LastReceiptDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.StandardPrice).HasColumnType("money"); - - entity.Property(e => e.UnitMeasureCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - - entity.Property(e => e.VendorId).HasColumnName("VendorID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("PurchaseOrderDetail", "Purchasing"); - - entity.Property(e => e.DueDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.LineTotal).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.PurchaseOrderDetailId).HasColumnName("PurchaseOrderDetailID"); - - entity.Property(e => e.PurchaseOrderId).HasColumnName("PurchaseOrderID"); - - entity.Property(e => e.ReceivedQty).HasColumnType("decimal(8, 2)"); - - entity.Property(e => e.RejectedQty).HasColumnType("decimal(8, 2)"); - - entity.Property(e => e.StockedQty).HasColumnType("decimal(9, 2)"); - - entity.Property(e => e.UnitPrice).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("PurchaseOrderHeader", "Purchasing"); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.Freight).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.OrderDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.PurchaseOrderId).HasColumnName("PurchaseOrderID"); - - entity.Property(e => e.ShipDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ShipMethodId).HasColumnName("ShipMethodID"); - - entity.Property(e => e.SubTotal).HasColumnType("money"); - - entity.Property(e => e.TaxAmt).HasColumnType("money"); - - entity.Property(e => e.TotalDue).HasColumnType("money"); - - entity.Property(e => e.VendorId).HasColumnName("VendorID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesOrderDetail", "Sales"); - - entity.Property(e => e.CarrierTrackingNumber).HasMaxLength(25); - - entity.Property(e => e.LineTotal).HasColumnType("decimal(38, 6)"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesOrderDetailId).HasColumnName("SalesOrderDetailID"); - - entity.Property(e => e.SalesOrderId).HasColumnName("SalesOrderID"); - - entity.Property(e => e.SpecialOfferId).HasColumnName("SpecialOfferID"); - - entity.Property(e => e.UnitPrice).HasColumnType("money"); - - entity.Property(e => e.UnitPriceDiscount).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesOrderHeader", "Sales"); - - entity.Property(e => e.AccountNumber).HasMaxLength(15); - - entity.Property(e => e.BillToAddressId).HasColumnName("BillToAddressID"); - - entity.Property(e => e.Comment).HasMaxLength(128); - - entity.Property(e => e.ContactId).HasColumnName("ContactID"); - - entity.Property(e => e.CreditCardApprovalCode) - .HasMaxLength(15) - .IsUnicode(false); - - entity.Property(e => e.CreditCardId).HasColumnName("CreditCardID"); - - entity.Property(e => e.CurrencyRateId).HasColumnName("CurrencyRateID"); - - entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); - - entity.Property(e => e.DueDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Freight).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.OrderDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.PurchaseOrderNumber).HasMaxLength(25); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesOrderId).HasColumnName("SalesOrderID"); - - entity.Property(e => e.SalesOrderNumber) - .IsRequired() - .HasMaxLength(25); - - entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); - - entity.Property(e => e.ShipDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ShipMethodId).HasColumnName("ShipMethodID"); - - entity.Property(e => e.ShipToAddressId).HasColumnName("ShipToAddressID"); - - entity.Property(e => e.SubTotal).HasColumnType("money"); - - entity.Property(e => e.TaxAmt).HasColumnType("money"); - - entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); - - entity.Property(e => e.TotalDue).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesOrderHeaderSalesReason", "Sales"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.SalesOrderId).HasColumnName("SalesOrderID"); - - entity.Property(e => e.SalesReasonId).HasColumnName("SalesReasonID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesPerson", "Sales"); - - entity.Property(e => e.Bonus).HasColumnType("money"); - - entity.Property(e => e.CommissionPct).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesLastYear).HasColumnType("money"); - - entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); - - entity.Property(e => e.SalesQuota).HasColumnType("money"); - - entity.Property(e => e.SalesYtd) - .HasColumnName("SalesYTD") - .HasColumnType("money"); - - entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesPersonQuotaHistory", "Sales"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.QuotaDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); - - entity.Property(e => e.SalesQuota).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesReason", "Sales"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ReasonType) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.SalesReasonId).HasColumnName("SalesReasonID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesTaxRate", "Sales"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesTaxRateId).HasColumnName("SalesTaxRateID"); - - entity.Property(e => e.StateProvinceId).HasColumnName("StateProvinceID"); - - entity.Property(e => e.TaxRate).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesTerritory", "Sales"); - - entity.Property(e => e.CostLastYear).HasColumnType("money"); - - entity.Property(e => e.CostYtd) - .HasColumnName("CostYTD") - .HasColumnType("money"); - - entity.Property(e => e.CountryRegionCode) - .IsRequired() - .HasMaxLength(3); - - entity.Property(e => e.Group) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesLastYear).HasColumnType("money"); - - entity.Property(e => e.SalesYtd) - .HasColumnName("SalesYTD") - .HasColumnType("money"); - - entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SalesTerritoryHistory", "Sales"); - - entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); - - entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ScrapReason", "Production"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ScrapReasonId).HasColumnName("ScrapReasonID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Shift", "HumanResources"); - - entity.Property(e => e.EndTime).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.ShiftId).HasColumnName("ShiftID"); - - entity.Property(e => e.StartTime).HasColumnType("smalldatetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ShipMethod", "Purchasing"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.ShipBase).HasColumnType("money"); - - entity.Property(e => e.ShipMethodId).HasColumnName("ShipMethodID"); - - entity.Property(e => e.ShipRate).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("ShoppingCartItem", "Sales"); - - entity.Property(e => e.DateCreated).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ShoppingCartId) - .IsRequired() - .HasColumnName("ShoppingCartID") - .HasMaxLength(50); - - entity.Property(e => e.ShoppingCartItemId).HasColumnName("ShoppingCartItemID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SpecialOffer", "Sales"); - - entity.Property(e => e.Category) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Description) - .IsRequired() - .HasMaxLength(255); - - entity.Property(e => e.DiscountPct).HasColumnType("money"); - - entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SpecialOfferId).HasColumnName("SpecialOfferID"); - - entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Type) - .IsRequired() - .HasMaxLength(50); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("SpecialOfferProduct", "Sales"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SpecialOfferId).HasColumnName("SpecialOfferID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("StateProvince", "Person"); - - entity.Property(e => e.CountryRegionCode) - .IsRequired() - .HasMaxLength(3); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.StateProvinceCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - - entity.Property(e => e.StateProvinceId).HasColumnName("StateProvinceID"); - - entity.Property(e => e.TerritoryId).HasColumnName("TerritoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Store", "Sales"); - - entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); - - entity.Property(e => e.Demographics).HasColumnType("xml"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - - entity.Property(e => e.SalesPersonId).HasColumnName("SalesPersonID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("StoreContact", "Sales"); - - entity.Property(e => e.ContactId).HasColumnName("ContactID"); - - entity.Property(e => e.ContactTypeId).HasColumnName("ContactTypeID"); - - entity.Property(e => e.CustomerId).HasColumnName("CustomerID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Rowguid).HasColumnName("rowguid"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("TransactionHistory", "Production"); - - entity.Property(e => e.ActualCost).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ReferenceOrderId).HasColumnName("ReferenceOrderID"); - - entity.Property(e => e.ReferenceOrderLineId).HasColumnName("ReferenceOrderLineID"); - - entity.Property(e => e.TransactionDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.TransactionId).HasColumnName("TransactionID"); - - entity.Property(e => e.TransactionType) - .IsRequired() - .HasMaxLength(1) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("TransactionHistoryArchive", "Production"); - - entity.Property(e => e.ActualCost).HasColumnType("money"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ReferenceOrderId).HasColumnName("ReferenceOrderID"); - - entity.Property(e => e.ReferenceOrderLineId).HasColumnName("ReferenceOrderLineID"); - - entity.Property(e => e.TransactionDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.TransactionId).HasColumnName("TransactionID"); - - entity.Property(e => e.TransactionType) - .IsRequired() - .HasMaxLength(1) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("UnitMeasure", "Production"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.UnitMeasureCode) - .IsRequired() - .HasMaxLength(3) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("Vendor", "Purchasing"); - - entity.Property(e => e.AccountNumber) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.Name) - .IsRequired() - .HasMaxLength(50); - - entity.Property(e => e.PurchasingWebServiceUrl) - .HasColumnName("PurchasingWebServiceURL") - .HasMaxLength(1024); - - entity.Property(e => e.VendorId).HasColumnName("VendorID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("VendorAddress", "Purchasing"); - - entity.Property(e => e.AddressId).HasColumnName("AddressID"); - - entity.Property(e => e.AddressTypeId).HasColumnName("AddressTypeID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.VendorId).HasColumnName("VendorID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("VendorContact", "Purchasing"); - - entity.Property(e => e.ContactId).HasColumnName("ContactID"); - - entity.Property(e => e.ContactTypeId).HasColumnName("ContactTypeID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.VendorId).HasColumnName("VendorID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("WorkOrder", "Production"); - - entity.Property(e => e.DueDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.EndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ScrapReasonId).HasColumnName("ScrapReasonID"); - - entity.Property(e => e.StartDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.WorkOrderId).HasColumnName("WorkOrderID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToTable("WorkOrderRouting", "Production"); - - entity.Property(e => e.ActualCost).HasColumnType("money"); - - entity.Property(e => e.ActualEndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ActualResourceHrs).HasColumnType("decimal(9, 4)"); - - entity.Property(e => e.ActualStartDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.LocationId).HasColumnName("LocationID"); - - entity.Property(e => e.ModifiedDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.PlannedCost).HasColumnType("money"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ScheduledEndDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.ScheduledStartDate).HasColumnType("smalldatetime"); - - entity.Property(e => e.WorkOrderId).HasColumnName("WorkOrderID"); - }); - - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs deleted file mode 100644 index 9cfc4ade7..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/AwbuildVersion.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class AwbuildVersion - { - public byte SystemInformationId { get; set; } - public string DatabaseVersion { get; set; } - public DateTime VersionDate { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs deleted file mode 100644 index 33c5845bd..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/BillOfMaterials.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class BillOfMaterials - { - public int BillOfMaterialsId { get; set; } - public int? ProductAssemblyId { get; set; } - public int ComponentId { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - public string UnitMeasureCode { get; set; } - public short Bomlevel { get; set; } - public decimal PerAssemblyQty { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs deleted file mode 100644 index cd5266387..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Contact.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Contact - { - public int ContactId { get; set; } - public bool NameStyle { get; set; } - public string Title { get; set; } - public string FirstName { get; set; } - public string MiddleName { get; set; } - public string LastName { get; set; } - public string Suffix { get; set; } - public string EmailAddress { get; set; } - public int EmailPromotion { get; set; } - public string Phone { get; set; } - public string PasswordHash { get; set; } - public string PasswordSalt { get; set; } - public string AdditionalContactInfo { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs deleted file mode 100644 index 6e72c1c7e..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactCreditCard.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ContactCreditCard - { - public int ContactId { get; set; } - public int CreditCardId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs deleted file mode 100644 index 8bdef5e5a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ContactType.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ContactType - { - public int ContactTypeId { get; set; } - public string Name { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs deleted file mode 100644 index c7db43c15..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegion.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class CountryRegion - { - public string CountryRegionCode { get; set; } - public string Name { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs deleted file mode 100644 index f2b16a6f3..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CountryRegionCurrency.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class CountryRegionCurrency - { - public string CountryRegionCode { get; set; } - public string CurrencyCode { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs deleted file mode 100644 index 9568e479d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CreditCard.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class CreditCard - { - public int CreditCardId { get; set; } - public string CardType { get; set; } - public string CardNumber { get; set; } - public byte ExpMonth { get; set; } - public short ExpYear { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs deleted file mode 100644 index fd7a54abe..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Culture.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Culture - { - public string CultureId { get; set; } - public string Name { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs deleted file mode 100644 index dd385f47d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Currency.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Currency - { - public string CurrencyCode { get; set; } - public string Name { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs deleted file mode 100644 index fcb462acb..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CurrencyRate.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class CurrencyRate - { - public int CurrencyRateId { get; set; } - public DateTime CurrencyRateDate { get; set; } - public string FromCurrencyCode { get; set; } - public string ToCurrencyCode { get; set; } - public decimal AverageRate { get; set; } - public decimal EndOfDayRate { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs deleted file mode 100644 index e012d0f07..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Customer.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Customer - { - public int CustomerId { get; set; } - public int? TerritoryId { get; set; } - public string AccountNumber { get; set; } - public string CustomerType { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs deleted file mode 100644 index eb85bfbf2..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/CustomerAddress.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class CustomerAddress - { - public int CustomerId { get; set; } - public int AddressId { get; set; } - public int AddressTypeId { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs deleted file mode 100644 index cb135fbea..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/DatabaseLog.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class DatabaseLog - { - public int DatabaseLogId { get; set; } - public DateTime PostTime { get; set; } - public string DatabaseUser { get; set; } - public string Event { get; set; } - public string Schema { get; set; } - public string Object { get; set; } - public string Tsql { get; set; } - public string XmlEvent { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs deleted file mode 100644 index fea2fc559..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Department.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Department - { - public short DepartmentId { get; set; } - public string Name { get; set; } - public string GroupName { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs deleted file mode 100644 index c23b23e1a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Document.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Document - { - public int DocumentId { get; set; } - public string Title { get; set; } - public string FileName { get; set; } - public string FileExtension { get; set; } - public string Revision { get; set; } - public int ChangeNumber { get; set; } - public byte Status { get; set; } - public string DocumentSummary { get; set; } - public byte[] Document1 { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs deleted file mode 100644 index 65e74b7ed..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Employee.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Employee - { - public int EmployeeId { get; set; } - public string NationalIdnumber { get; set; } - public int ContactId { get; set; } - public string LoginId { get; set; } - public int? ManagerId { get; set; } - public string Title { get; set; } - public DateTime BirthDate { get; set; } - public string MaritalStatus { get; set; } - public string Gender { get; set; } - public DateTime HireDate { get; set; } - public bool SalariedFlag { get; set; } - public short VacationHours { get; set; } - public short SickLeaveHours { get; set; } - public bool CurrentFlag { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs deleted file mode 100644 index 093646ffc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeAddress.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class EmployeeAddress - { - public int EmployeeId { get; set; } - public int AddressId { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs deleted file mode 100644 index 7c2730d02..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeeDepartmentHistory.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class EmployeeDepartmentHistory - { - public int EmployeeId { get; set; } - public short DepartmentId { get; set; } - public byte ShiftId { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs deleted file mode 100644 index 18259bcfe..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/EmployeePayHistory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class EmployeePayHistory - { - public int EmployeeId { get; set; } - public DateTime RateChangeDate { get; set; } - public decimal Rate { get; set; } - public byte PayFrequency { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs deleted file mode 100644 index 76001e731..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ErrorLog.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ErrorLog - { - public int ErrorLogId { get; set; } - public DateTime ErrorTime { get; set; } - public string UserName { get; set; } - public int ErrorNumber { get; set; } - public int? ErrorSeverity { get; set; } - public int? ErrorState { get; set; } - public string ErrorProcedure { get; set; } - public int? ErrorLine { get; set; } - public string ErrorMessage { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs deleted file mode 100644 index 80d5ad5ef..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Illustration.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Illustration - { - public int IllustrationId { get; set; } - public string Diagram { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs deleted file mode 100644 index 143cb7da7..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Individual.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Individual - { - public int CustomerId { get; set; } - public int ContactId { get; set; } - public string Demographics { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs deleted file mode 100644 index 34265cae5..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/JobCandidate.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class JobCandidate - { - public int JobCandidateId { get; set; } - public int? EmployeeId { get; set; } - public string Resume { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs deleted file mode 100644 index 59ae6c23c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Location.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Location - { - public short LocationId { get; set; } - public string Name { get; set; } - public decimal CostRate { get; set; } - public decimal Availability { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs deleted file mode 100644 index e5c4ae392..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Product.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Product - { - public int ProductId { get; set; } - public string Name { get; set; } - public string ProductNumber { get; set; } - public bool MakeFlag { get; set; } - public bool FinishedGoodsFlag { get; set; } - public string Color { get; set; } - public short SafetyStockLevel { get; set; } - public short ReorderPoint { get; set; } - public decimal StandardCost { get; set; } - public decimal ListPrice { get; set; } - public string Size { get; set; } - public string SizeUnitMeasureCode { get; set; } - public string WeightUnitMeasureCode { get; set; } - public decimal? Weight { get; set; } - public int DaysToManufacture { get; set; } - public string ProductLine { get; set; } - public string Class { get; set; } - public string Style { get; set; } - public int? ProductSubcategoryId { get; set; } - public int? ProductModelId { get; set; } - public DateTime SellStartDate { get; set; } - public DateTime? SellEndDate { get; set; } - public DateTime? DiscontinuedDate { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs deleted file mode 100644 index 540b65a6b..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCategory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductCategory - { - public int ProductCategoryId { get; set; } - public string Name { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs deleted file mode 100644 index e1e4940ca..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductCostHistory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductCostHistory - { - public int ProductId { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - public decimal StandardCost { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs deleted file mode 100644 index 9060c00bd..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDescription.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductDescription - { - public int ProductDescriptionId { get; set; } - public string Description { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs deleted file mode 100644 index 2cd941ab5..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductDocument.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductDocument - { - public int ProductId { get; set; } - public int DocumentId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs deleted file mode 100644 index 15b63db30..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductInventory.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductInventory - { - public int ProductId { get; set; } - public short LocationId { get; set; } - public string Shelf { get; set; } - public byte Bin { get; set; } - public short Quantity { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs deleted file mode 100644 index 17b4d1502..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductListPriceHistory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductListPriceHistory - { - public int ProductId { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - public decimal ListPrice { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs deleted file mode 100644 index 88c5db791..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductModel - { - public int ProductModelId { get; set; } - public string Name { get; set; } - public string CatalogDescription { get; set; } - public string Instructions { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs deleted file mode 100644 index 6bcfae994..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelIllustration.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductModelIllustration - { - public int ProductModelId { get; set; } - public int IllustrationId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs deleted file mode 100644 index 9c27a78c7..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductModelProductDescriptionCulture.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductModelProductDescriptionCulture - { - public int ProductModelId { get; set; } - public int ProductDescriptionId { get; set; } - public string CultureId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs deleted file mode 100644 index 658c53192..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductPhoto.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductPhoto - { - public int ProductPhotoId { get; set; } - public byte[] ThumbNailPhoto { get; set; } - public string ThumbnailPhotoFileName { get; set; } - public byte[] LargePhoto { get; set; } - public string LargePhotoFileName { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs deleted file mode 100644 index b3a64c241..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductProductPhoto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductProductPhoto - { - public int ProductId { get; set; } - public int ProductPhotoId { get; set; } - public bool Primary { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs deleted file mode 100644 index ffa217f97..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductReview.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductReview - { - public int ProductReviewId { get; set; } - public int ProductId { get; set; } - public string ReviewerName { get; set; } - public DateTime ReviewDate { get; set; } - public string EmailAddress { get; set; } - public int Rating { get; set; } - public string Comments { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs deleted file mode 100644 index 819598573..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductSubcategory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductSubcategory - { - public int ProductSubcategoryId { get; set; } - public int ProductCategoryId { get; set; } - public string Name { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs deleted file mode 100644 index acfaf08cc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ProductVendor.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ProductVendor - { - public int ProductId { get; set; } - public int VendorId { get; set; } - public int AverageLeadTime { get; set; } - public decimal StandardPrice { get; set; } - public decimal? LastReceiptCost { get; set; } - public DateTime? LastReceiptDate { get; set; } - public int MinOrderQty { get; set; } - public int MaxOrderQty { get; set; } - public int? OnOrderQty { get; set; } - public string UnitMeasureCode { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs deleted file mode 100644 index 5ec016b66..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderDetail.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class PurchaseOrderDetail - { - public int PurchaseOrderId { get; set; } - public int PurchaseOrderDetailId { get; set; } - public DateTime DueDate { get; set; } - public short OrderQty { get; set; } - public int ProductId { get; set; } - public decimal UnitPrice { get; set; } - public decimal LineTotal { get; set; } - public decimal ReceivedQty { get; set; } - public decimal RejectedQty { get; set; } - public decimal StockedQty { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs deleted file mode 100644 index 000474db6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/PurchaseOrderHeader.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class PurchaseOrderHeader - { - public int PurchaseOrderId { get; set; } - public byte RevisionNumber { get; set; } - public byte Status { get; set; } - public int EmployeeId { get; set; } - public int VendorId { get; set; } - public int ShipMethodId { get; set; } - public DateTime OrderDate { get; set; } - public DateTime? ShipDate { get; set; } - public decimal SubTotal { get; set; } - public decimal TaxAmt { get; set; } - public decimal Freight { get; set; } - public decimal TotalDue { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs deleted file mode 100644 index ff1a8d87d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderDetail.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesOrderDetail - { - public int SalesOrderId { get; set; } - public int SalesOrderDetailId { get; set; } - public string CarrierTrackingNumber { get; set; } - public short OrderQty { get; set; } - public int ProductId { get; set; } - public int SpecialOfferId { get; set; } - public decimal UnitPrice { get; set; } - public decimal UnitPriceDiscount { get; set; } - public decimal LineTotal { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs deleted file mode 100644 index 3359da3a9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeader.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesOrderHeader - { - public int SalesOrderId { get; set; } - public byte RevisionNumber { get; set; } - public DateTime OrderDate { get; set; } - public DateTime DueDate { get; set; } - public DateTime? ShipDate { get; set; } - public byte Status { get; set; } - public bool OnlineOrderFlag { get; set; } - public string SalesOrderNumber { get; set; } - public string PurchaseOrderNumber { get; set; } - public string AccountNumber { get; set; } - public int CustomerId { get; set; } - public int ContactId { get; set; } - public int? SalesPersonId { get; set; } - public int? TerritoryId { get; set; } - public int BillToAddressId { get; set; } - public int ShipToAddressId { get; set; } - public int ShipMethodId { get; set; } - public int? CreditCardId { get; set; } - public string CreditCardApprovalCode { get; set; } - public int? CurrencyRateId { get; set; } - public decimal SubTotal { get; set; } - public decimal TaxAmt { get; set; } - public decimal Freight { get; set; } - public decimal TotalDue { get; set; } - public string Comment { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs deleted file mode 100644 index b90d09600..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesOrderHeaderSalesReason.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesOrderHeaderSalesReason - { - public int SalesOrderId { get; set; } - public int SalesReasonId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs deleted file mode 100644 index 6c6ce70fc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPerson.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesPerson - { - public int SalesPersonId { get; set; } - public int? TerritoryId { get; set; } - public decimal? SalesQuota { get; set; } - public decimal Bonus { get; set; } - public decimal CommissionPct { get; set; } - public decimal SalesYtd { get; set; } - public decimal SalesLastYear { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs deleted file mode 100644 index 71a86f8de..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesPersonQuotaHistory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesPersonQuotaHistory - { - public int SalesPersonId { get; set; } - public DateTime QuotaDate { get; set; } - public decimal SalesQuota { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs deleted file mode 100644 index 2a8bba75c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesReason.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesReason - { - public int SalesReasonId { get; set; } - public string Name { get; set; } - public string ReasonType { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs deleted file mode 100644 index b9e75510c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTaxRate.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesTaxRate - { - public int SalesTaxRateId { get; set; } - public int StateProvinceId { get; set; } - public byte TaxType { get; set; } - public decimal TaxRate { get; set; } - public string Name { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs deleted file mode 100644 index 59f2a597c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritory.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesTerritory - { - public int TerritoryId { get; set; } - public string Name { get; set; } - public string CountryRegionCode { get; set; } - public string Group { get; set; } - public decimal SalesYtd { get; set; } - public decimal SalesLastYear { get; set; } - public decimal CostYtd { get; set; } - public decimal CostLastYear { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs deleted file mode 100644 index f01dfbbb2..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SalesTerritoryHistory.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SalesTerritoryHistory - { - public int SalesPersonId { get; set; } - public int TerritoryId { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs deleted file mode 100644 index 0e1617233..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ScrapReason.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ScrapReason - { - public short ScrapReasonId { get; set; } - public string Name { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs deleted file mode 100644 index c4c2477b0..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Shift.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Shift - { - public byte ShiftId { get; set; } - public string Name { get; set; } - public DateTime StartTime { get; set; } - public DateTime EndTime { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs deleted file mode 100644 index 91fd29f29..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShipMethod.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ShipMethod - { - public int ShipMethodId { get; set; } - public string Name { get; set; } - public decimal ShipBase { get; set; } - public decimal ShipRate { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs deleted file mode 100644 index e94927892..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/ShoppingCartItem.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class ShoppingCartItem - { - public int ShoppingCartItemId { get; set; } - public string ShoppingCartId { get; set; } - public int Quantity { get; set; } - public int ProductId { get; set; } - public DateTime DateCreated { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs deleted file mode 100644 index fad2136e9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOffer.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SpecialOffer - { - public int SpecialOfferId { get; set; } - public string Description { get; set; } - public decimal DiscountPct { get; set; } - public string Type { get; set; } - public string Category { get; set; } - public DateTime StartDate { get; set; } - public DateTime EndDate { get; set; } - public int MinQty { get; set; } - public int? MaxQty { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs deleted file mode 100644 index b2b986468..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/SpecialOfferProduct.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class SpecialOfferProduct - { - public int SpecialOfferId { get; set; } - public int ProductId { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs deleted file mode 100644 index 1494d60f8..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StateProvince.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class StateProvince - { - public int StateProvinceId { get; set; } - public string StateProvinceCode { get; set; } - public string CountryRegionCode { get; set; } - public bool IsOnlyStateProvinceFlag { get; set; } - public string Name { get; set; } - public int TerritoryId { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs deleted file mode 100644 index 3caa50f84..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Store.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Store - { - public int CustomerId { get; set; } - public string Name { get; set; } - public int? SalesPersonId { get; set; } - public string Demographics { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs deleted file mode 100644 index 5dbe582ce..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/StoreContact.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class StoreContact - { - public int CustomerId { get; set; } - public int ContactId { get; set; } - public int ContactTypeId { get; set; } - public Guid Rowguid { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs deleted file mode 100644 index 41240c021..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistory.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class TransactionHistory - { - public int TransactionId { get; set; } - public int ProductId { get; set; } - public int ReferenceOrderId { get; set; } - public int ReferenceOrderLineId { get; set; } - public DateTime TransactionDate { get; set; } - public string TransactionType { get; set; } - public int Quantity { get; set; } - public decimal ActualCost { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs deleted file mode 100644 index 749261eec..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/TransactionHistoryArchive.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class TransactionHistoryArchive - { - public int TransactionId { get; set; } - public int ProductId { get; set; } - public int ReferenceOrderId { get; set; } - public int ReferenceOrderLineId { get; set; } - public DateTime TransactionDate { get; set; } - public string TransactionType { get; set; } - public int Quantity { get; set; } - public decimal ActualCost { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs deleted file mode 100644 index f2f8f8397..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/UnitMeasure.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class UnitMeasure - { - public string UnitMeasureCode { get; set; } - public string Name { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs deleted file mode 100644 index 2de6e9879..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/Vendor.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class Vendor - { - public int VendorId { get; set; } - public string AccountNumber { get; set; } - public string Name { get; set; } - public byte CreditRating { get; set; } - public bool PreferredVendorStatus { get; set; } - public bool ActiveFlag { get; set; } - public string PurchasingWebServiceUrl { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs deleted file mode 100644 index ff97a5ddc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorAddress.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class VendorAddress - { - public int VendorId { get; set; } - public int AddressId { get; set; } - public int AddressTypeId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs deleted file mode 100644 index 2077bb1b0..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/VendorContact.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class VendorContact - { - public int VendorId { get; set; } - public int ContactId { get; set; } - public int ContactTypeId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs deleted file mode 100644 index 16cb85785..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrder.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class WorkOrder - { - public int WorkOrderId { get; set; } - public int ProductId { get; set; } - public int OrderQty { get; set; } - public int StockedQty { get; set; } - public short ScrappedQty { get; set; } - public DateTime StartDate { get; set; } - public DateTime? EndDate { get; set; } - public DateTime DueDate { get; set; } - public short? ScrapReasonId { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs deleted file mode 100644 index 6ff2232d1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SchaffoldedDBContext/WorkOrderRouting.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.AdventureWorksEFCoreScaffolded -{ - public partial class WorkOrderRouting - { - public int WorkOrderId { get; set; } - public int ProductId { get; set; } - public short OperationSequence { get; set; } - public short LocationId { get; set; } - public DateTime ScheduledStartDate { get; set; } - public DateTime ScheduledEndDate { get; set; } - public DateTime? ActualStartDate { get; set; } - public DateTime? ActualEndDate { get; set; } - public decimal? ActualResourceHrs { get; set; } - public decimal PlannedCost { get; set; } - public decimal? ActualCost { get; set; } - public DateTime ModifiedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs index 345c17b71..78d58e7c6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs @@ -1,28 +1,19 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ScrapReason", Schema = "Production")] public partial class ScrapReason { - public ScrapReason() - { - this.WorkOrders = new HashSet(); - } - public short ScrapReasonID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection WorkOrders { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs index 6076d85de..f34bc885b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs @@ -1,30 +1,23 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Shift", Schema = "HumanResources")] public partial class Shift { - public Shift() - { - this.EmployeeDepartmentHistories = new HashSet(); - } - public byte ShiftID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.DateTime StartTime { get; set; } - public System.DateTime EndTime { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection EmployeeDepartmentHistories { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartTime { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime EndTime { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs index 3305cf588..4c25976ec 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs @@ -1,33 +1,24 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ShipMethod", Schema = "Purchasing")] public partial class ShipMethod { - public ShipMethod() - { - this.PurchaseOrderHeaders = new HashSet(); - this.SalesOrderHeaders = new HashSet(); - } - public int ShipMethodID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } + [Column(TypeName = "money")] public decimal ShipBase { get; set; } + [Column(TypeName = "money")] public decimal ShipRate { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection PurchaseOrderHeaders { get; set; } - public virtual ICollection SalesOrderHeaders { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs index e472c9608..cea76b5c9 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs @@ -1,26 +1,23 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("ShoppingCartItem", Schema = "Sales")] public partial class ShoppingCartItem { public int ShoppingCartItemID { get; set; } + [Required] + [StringLength(50)] public string ShoppingCartID { get; set; } public int Quantity { get; set; } public int ProductID { get; set; } - public System.DateTime DateCreated { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime DateCreated { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs index d3a1ac9c1..3a9ba0c1c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs @@ -1,36 +1,34 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SpecialOffer", Schema = "Sales")] public partial class SpecialOffer { - public SpecialOffer() - { - this.SpecialOfferProducts = new HashSet(); - } - public int SpecialOfferID { get; set; } + [Required] + [StringLength(255)] public string Description { get; set; } + [Column(TypeName = "money")] public decimal DiscountPct { get; set; } + [Required] + [StringLength(50)] public string Type { get; set; } + [Required] + [StringLength(50)] public string Category { get; set; } - public System.DateTime StartDate { get; set; } - public System.DateTime EndDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime EndDate { get; set; } public int MinQty { get; set; } - public Nullable MaxQty { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection SpecialOfferProducts { get; set; } + public int? MaxQty { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs index 975ad1629..0676de783 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs @@ -1,31 +1,18 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("SpecialOfferProduct", Schema = "Sales")] public partial class SpecialOfferProduct { - public SpecialOfferProduct() - { - this.SalesOrderDetails = new HashSet(); - } - public int SpecialOfferID { get; set; } public int ProductID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual ICollection SalesOrderDetails { get; set; } - public virtual SpecialOffer SpecialOffer { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs index 4362309c6..e8ddefc02 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs @@ -1,37 +1,28 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("StateProvince", Schema = "Person")] public partial class StateProvince { - public StateProvince() - { - this.Addresses = new HashSet
(); - this.SalesTaxRates = new HashSet(); - } - public int StateProvinceID { get; set; } + [Required] + [StringLength(3)] public string StateProvinceCode { get; set; } + [Required] + [StringLength(3)] public string CountryRegionCode { get; set; } public bool IsOnlyStateProvinceFlag { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } public int TerritoryID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection
Addresses { get; set; } - public virtual CountryRegion CountryRegion { get; set; } - public virtual ICollection SalesTaxRates { get; set; } - public virtual SalesTerritory SalesTerritory { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs index 4b5ae26de..08505ba63 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs @@ -1,33 +1,23 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Store", Schema = "Sales")] public partial class Store { - public Store() - { - this.StoreContacts = new HashSet(); - } - public int CustomerID { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public Nullable SalesPersonID { get; set; } + public int? SalesPersonID { get; set; } + [Column(TypeName = "xml")] public string Demographics { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Customer Customer { get; set; } - public virtual SalesPerson SalesPerson { get; set; } - public virtual ICollection StoreContacts { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs index 48ac4a0f4..564e81fac 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs @@ -1,27 +1,19 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("StoreContact", Schema = "Sales")] public partial class StoreContact { public int CustomerID { get; set; } public int ContactID { get; set; } public int ContactTypeID { get; set; } - public System.Guid rowguid { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual ContactType ContactType { get; set; } - public virtual Store Store { get; set; } + public Guid rowguid { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs index 08ed8d258..7c2d5a277 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs @@ -1,29 +1,27 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("TransactionHistory", Schema = "Production")] public partial class TransactionHistory { public int TransactionID { get; set; } public int ProductID { get; set; } public int ReferenceOrderID { get; set; } public int ReferenceOrderLineID { get; set; } - public System.DateTime TransactionDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime TransactionDate { get; set; } + [Required] + [StringLength(1)] public string TransactionType { get; set; } public int Quantity { get; set; } + [Column(TypeName = "money")] public decimal ActualCost { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs index 66cff9519..301e8549d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs @@ -1,27 +1,27 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("TransactionHistoryArchive", Schema = "Production")] public partial class TransactionHistoryArchive { public int TransactionID { get; set; } public int ProductID { get; set; } public int ReferenceOrderID { get; set; } public int ReferenceOrderLineID { get; set; } - public System.DateTime TransactionDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime TransactionDate { get; set; } + [Required] + [StringLength(1)] public string TransactionType { get; set; } public int Quantity { get; set; } + [Column(TypeName = "money")] public decimal ActualCost { get; set; } - public System.DateTime ModifiedDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs index 1a58eb23b..d222e6197 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs @@ -1,34 +1,21 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("UnitMeasure", Schema = "Production")] public partial class UnitMeasure { - public UnitMeasure() - { - this.BillOfMaterials = new HashSet(); - this.Products = new HashSet(); - this.Products1 = new HashSet(); - this.ProductVendors = new HashSet(); - } - + [Required] + [StringLength(3)] public string UnitMeasureCode { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection BillOfMaterials { get; set; } - public virtual ICollection Products { get; set; } - public virtual ICollection Products1 { get; set; } - public virtual ICollection ProductVendors { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs index 97e3c2914..a9328aabb 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs @@ -1,39 +1,27 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("Vendor", Schema = "Purchasing")] public partial class Vendor { - public Vendor() - { - this.ProductVendors = new HashSet(); - this.PurchaseOrderHeaders = new HashSet(); - this.VendorAddresses = new HashSet(); - this.VendorContacts = new HashSet(); - } - public int VendorID { get; set; } + [Required] + [StringLength(15)] public string AccountNumber { get; set; } + [Required] + [StringLength(50)] public string Name { get; set; } public byte CreditRating { get; set; } public bool PreferredVendorStatus { get; set; } public bool ActiveFlag { get; set; } + [StringLength(1024)] public string PurchasingWebServiceURL { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual ICollection ProductVendors { get; set; } - public virtual ICollection PurchaseOrderHeaders { get; set; } - public virtual ICollection VendorAddresses { get; set; } - public virtual ICollection VendorContacts { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs index 0389ec45a..9dc0e988c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs @@ -1,26 +1,18 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("VendorAddress", Schema = "Purchasing")] public partial class VendorAddress { public int VendorID { get; set; } public int AddressID { get; set; } public int AddressTypeID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Address Address { get; set; } - public virtual AddressType AddressType { get; set; } - public virtual Vendor Vendor { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs index 95fd9b078..3b02b2ba4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs @@ -1,26 +1,18 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("VendorContact", Schema = "Purchasing")] public partial class VendorContact { public int VendorID { get; set; } public int ContactID { get; set; } public int ContactTypeID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Contact Contact { get; set; } - public virtual ContactType ContactType { get; set; } - public virtual Vendor Vendor { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs index 3a6378d9e..cbf94c35d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs @@ -1,37 +1,27 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("WorkOrder", Schema = "Production")] public partial class WorkOrder { - public WorkOrder() - { - this.WorkOrderRoutings = new HashSet(); - } - public int WorkOrderID { get; set; } public int ProductID { get; set; } public int OrderQty { get; set; } public int StockedQty { get; set; } public short ScrappedQty { get; set; } - public System.DateTime StartDate { get; set; } - public Nullable EndDate { get; set; } - public System.DateTime DueDate { get; set; } - public Nullable ScrapReasonID { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Product Product { get; set; } - public virtual ScrapReason ScrapReason { get; set; } - public virtual ICollection WorkOrderRoutings { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime StartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? EndDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime DueDate { get; set; } + public short? ScrapReasonID { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs index 88cf5ed07..babc67b63 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs @@ -1,33 +1,33 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +// This file has been auto generated by EF Core Power Tools. +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; -namespace DbContextModels.AdventureWorksEFCore +namespace EFCoreModels.AdventureWorks.AdventureWorks { - using System; - using System.Collections.Generic; - + [Table("WorkOrderRouting", Schema = "Production")] public partial class WorkOrderRouting { public int WorkOrderID { get; set; } public int ProductID { get; set; } public short OperationSequence { get; set; } public short LocationID { get; set; } - public System.DateTime ScheduledStartDate { get; set; } - public System.DateTime ScheduledEndDate { get; set; } - public Nullable ActualStartDate { get; set; } - public Nullable ActualEndDate { get; set; } - public Nullable ActualResourceHrs { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ScheduledStartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ScheduledEndDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? ActualStartDate { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime? ActualEndDate { get; set; } + [Column(TypeName = "decimal(9, 4)")] + public decimal? ActualResourceHrs { get; set; } + [Column(TypeName = "money")] public decimal PlannedCost { get; set; } - public Nullable ActualCost { get; set; } - public System.DateTime ModifiedDate { get; set; } - - public virtual Location Location { get; set; } - public virtual WorkOrder WorkOrder { get; set; } + [Column(TypeName = "money")] + public decimal? ActualCost { get; set; } + [Column(TypeName = "smalldatetime")] + public DateTime ModifiedDate { get; set; } } -} +} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs deleted file mode 100644 index 9dc580abd..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/sysdiagram.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.AdventureWorksEFCore -{ - using System; - using System.Collections.Generic; - - public partial class sysdiagram - { - public string name { get; set; } - public int principal_id { get; set; } - public int diagram_id { get; set; } - public Nullable version { get; set; } - public byte[] definition { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config deleted file mode 100644 index ba200051a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/App.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - -
- - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj deleted file mode 100644 index 0e82d7346..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreDbContextModels.csproj +++ /dev/null @@ -1,335 +0,0 @@ - - - 618 - DbContextModels - EFCoreDbContextModels - net472 - 1.0.0.0 - - - - - - - - - - - - - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - True - True - AdventureWorksDbCtx.Context.tt - - - True - True - AdventureWorksDbCtx.tt - - - True - True - AdventureWorksDbCtx.edmx - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - AdventureWorksDbCtx.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - True - True - NorthwindDbCtx.edmx - - - True - True - NorthwindEntities.Context.tt - - - True - True - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - NorthwindEntities.tt - - - - - EntityModelCodeGenerator - NorthwindDbCtx.Designer.cs - DbContextModels - - - - - EntityModelCodeGenerator - AdventureWorksDbCtx.Designer.cs - DbContextModels.AdventureWorks - - - TextTemplatingFileGenerator - AdventureWorksDbCtx.Context.cs - - - TextTemplatingFileGenerator - AdventureWorksDbCtx.cs - - - TextTemplatingFileGenerator - NorthwindEntities.Context.cs - - - TextTemplatingFileGenerator - NorthwindEntities.cs - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj new file mode 100644 index 000000000..0c0657051 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj @@ -0,0 +1,22 @@ + + + 618 + + net472 + 1.0.0.0 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs index 4a6059dc4..1a3303e9b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Category.cs @@ -1,29 +1,24 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Category { public Category() { - this.Products = new HashSet(); + Products = new HashSet(); } - + public int CategoryID { get; set; } public string CategoryName { get; set; } public string Description { get; set; } public byte[] Picture { get; set; } - + public virtual ICollection Products { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs index 92d78d7ad..d0045b315 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Customer.cs @@ -1,25 +1,20 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Customer { public Customer() { - this.Orders = new HashSet(); - this.CustomerDemographics = new HashSet(); + CustomerCustomerDemo = new HashSet(); + Orders = new HashSet(); } - + public string CustomerID { get; set; } public string CompanyName { get; set; } public string ContactName { get; set; } @@ -31,8 +26,8 @@ public Customer() public string Country { get; set; } public string Phone { get; set; } public string Fax { get; set; } - + + public virtual ICollection CustomerCustomerDemo { get; set; } public virtual ICollection Orders { get; set; } - public virtual ICollection CustomerDemographics { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerCustomerDemo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerCustomerDemo.cs similarity index 65% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerCustomerDemo.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerCustomerDemo.cs index c57cd9e20..7b06c18af 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerCustomerDemo.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerCustomerDemo.cs @@ -5,14 +5,14 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels.NorthwindEFCoreScaffolded +namespace EFCoreModels.Northwind { public partial class CustomerCustomerDemo { - public string CustomerId { get; set; } - public string CustomerTypeId { get; set; } + public string CustomerID { get; set; } + public string CustomerTypeID { get; set; } - public virtual Customers Customer { get; set; } + public virtual Customer Customer { get; set; } public virtual CustomerDemographics CustomerType { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs deleted file mode 100644 index c53b07930..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographic.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.NorthwindEFCore -{ - using System; - using System.Collections.Generic; - - public partial class CustomerDemographic - { - public CustomerDemographic() - { - this.Customers = new HashSet(); - } - - public string CustomerTypeID { get; set; } - public string CustomerDesc { get; set; } - - public virtual ICollection Customers { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerDemographics.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographics.cs similarity index 85% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerDemographics.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographics.cs index d43cd63fb..c029bf405 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerDemographics.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/CustomerDemographics.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels.NorthwindEFCoreScaffolded +namespace EFCoreModels.Northwind { public partial class CustomerDemographics { @@ -14,7 +14,7 @@ public CustomerDemographics() CustomerCustomerDemo = new HashSet(); } - public string CustomerTypeId { get; set; } + public string CustomerTypeID { get; set; } public string CustomerDesc { get; set; } public virtual ICollection CustomerCustomerDemo { get; set; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs new file mode 100644 index 000000000..628d15bd6 --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -0,0 +1,488 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; + +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind +{ + public partial class EFCoreDbCtxNorthwindEntities : DbContext + { + public EFCoreDbCtxNorthwindEntities() + { + } + + public EFCoreDbCtxNorthwindEntities(string connectionString) + : this(BuildOptions(connectionString)) + { + } + + public EFCoreDbCtxNorthwindEntities(DbContextOptions options) + : base(options) + { + } + + private static DbContextOptions BuildOptions(string connectionString) + { + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseSqlServer(connectionString); + return optionsBuilder.Options; + } + + public virtual DbSet Categories { get; set; } + public virtual DbSet CustomerCustomerDemo { get; set; } + public virtual DbSet CustomerDemographics { get; set; } + public virtual DbSet Customers { get; set; } + public virtual DbSet EmployeeTerritories { get; set; } + public virtual DbSet Employees { get; set; } + public virtual DbSet Order_Details { get; set; } + public virtual DbSet Orders { get; set; } + public virtual DbSet Products { get; set; } + public virtual DbSet Regions { get; set; } + public virtual DbSet Shippers { get; set; } + public virtual DbSet Suppliers { get; set; } + public virtual DbSet Territories { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + if (!optionsBuilder.IsConfigured) + { + optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=Northwind;Integrated Security=True;MultipleActiveResultSets=True;Encrypt=false"); + } + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryID); + + entity.HasIndex(e => e.CategoryName) + .HasName("CategoryName"); + + entity.Property(e => e.CategoryID).HasColumnName("CategoryID"); + + entity.Property(e => e.CategoryName) + .IsRequired() + .HasMaxLength(15); + + entity.Property(e => e.Description).HasColumnType("ntext"); + + entity.Property(e => e.Picture).HasColumnType("image"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.CustomerID, e.CustomerTypeID }) + .IsClustered(false); + + entity.Property(e => e.CustomerID) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.CustomerTypeID) + .HasColumnName("CustomerTypeID") + .HasMaxLength(10) + .IsFixedLength(); + + entity.HasOne(d => d.Customer) + .WithMany(p => p.CustomerCustomerDemo) + .HasForeignKey(d => d.CustomerID) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CustomerCustomerDemo_Customers"); + + entity.HasOne(d => d.CustomerType) + .WithMany(p => p.CustomerCustomerDemo) + .HasForeignKey(d => d.CustomerTypeID) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CustomerCustomerDemo"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CustomerTypeID) + .IsClustered(false); + + entity.Property(e => e.CustomerTypeID) + .HasColumnName("CustomerTypeID") + .HasMaxLength(10) + .IsFixedLength(); + + entity.Property(e => e.CustomerDesc).HasColumnType("ntext"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CustomerID); + + entity.HasIndex(e => e.City) + .HasName("City"); + + entity.HasIndex(e => e.CompanyName) + .HasName("CompanyName"); + + entity.HasIndex(e => e.PostalCode) + .HasName("PostalCode"); + + entity.HasIndex(e => e.Region) + .HasName("Region"); + + entity.Property(e => e.CustomerID) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ContactName).HasMaxLength(30); + + entity.Property(e => e.ContactTitle).HasMaxLength(30); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.Fax).HasMaxLength(24); + + entity.Property(e => e.Phone).HasMaxLength(24); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.Region).HasMaxLength(15); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.EmployeeID, e.TerritoryID }) + .IsClustered(false); + + entity.Property(e => e.EmployeeID).HasColumnName("EmployeeID"); + + entity.Property(e => e.TerritoryID) + .HasColumnName("TerritoryID") + .HasMaxLength(20); + + entity.HasOne(d => d.Employee) + .WithMany(p => p.EmployeeTerritories) + .HasForeignKey(d => d.EmployeeID) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmployeeTerritories_Employees"); + + entity.HasOne(d => d.Territory) + .WithMany(p => p.EmployeeTerritories) + .HasForeignKey(d => d.TerritoryID) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmployeeTerritories_Territories"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.EmployeeID); + + entity.HasIndex(e => e.LastName) + .HasName("LastName"); + + entity.HasIndex(e => e.PostalCode) + .HasName("PostalCode"); + + entity.Property(e => e.EmployeeID).HasColumnName("EmployeeID"); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.BirthDate).HasColumnType("datetime"); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.Extension).HasMaxLength(4); + + entity.Property(e => e.FirstName) + .IsRequired() + .HasMaxLength(10); + + entity.Property(e => e.HireDate).HasColumnType("datetime"); + + entity.Property(e => e.HomePhone).HasMaxLength(24); + + entity.Property(e => e.LastName) + .IsRequired() + .HasMaxLength(20); + + entity.Property(e => e.Notes).HasColumnType("ntext"); + + entity.Property(e => e.Photo).HasColumnType("image"); + + entity.Property(e => e.PhotoPath).HasMaxLength(255); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.Region).HasMaxLength(15); + + entity.Property(e => e.Title).HasMaxLength(30); + + entity.Property(e => e.TitleOfCourtesy).HasMaxLength(25); + + entity.HasOne(d => d.ReportsToNavigation) + .WithMany(p => p.InverseReportsToNavigation) + .HasForeignKey(d => d.ReportsTo) + .HasConstraintName("FK_Employees_Employees"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.OrderID, e.ProductID }) + .HasName("PK_Order_Details"); + + entity.ToTable("Order Details"); + + entity.HasIndex(e => e.OrderID) + .HasName("OrdersOrder_Details"); + + entity.HasIndex(e => e.ProductID) + .HasName("ProductsOrder_Details"); + + entity.Property(e => e.OrderID).HasColumnName("OrderID"); + + entity.Property(e => e.ProductID).HasColumnName("ProductID"); + + entity.Property(e => e.Discount).HasDefaultValueSql("(0)"); + + entity.Property(e => e.Quantity).HasDefaultValueSql("(1)"); + + entity.Property(e => e.UnitPrice) + .HasColumnType("money") + .HasDefaultValueSql("(0)"); + + entity.HasOne(d => d.Order) + .WithMany(p => p.OrderDetails) + .HasForeignKey(d => d.OrderID) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Order_Details_Orders"); + + entity.HasOne(d => d.Product) + .WithMany(p => p.OrderDetails) + .HasForeignKey(d => d.ProductID) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Order_Details_Products"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.OrderID); + + entity.HasIndex(e => e.CustomerID) + .HasName("CustomersOrders"); + + entity.HasIndex(e => e.EmployeeID) + .HasName("EmployeesOrders"); + + entity.HasIndex(e => e.OrderDate) + .HasName("OrderDate"); + + entity.HasIndex(e => e.ShipPostalCode) + .HasName("ShipPostalCode"); + + entity.HasIndex(e => e.ShipVia) + .HasName("ShippersOrders"); + + entity.HasIndex(e => e.ShippedDate) + .HasName("ShippedDate"); + + entity.Property(e => e.OrderID).HasColumnName("OrderID"); + + entity.Property(e => e.CustomerID) + .HasColumnName("CustomerID") + .HasMaxLength(5) + .IsFixedLength(); + + entity.Property(e => e.EmployeeID).HasColumnName("EmployeeID"); + + entity.Property(e => e.Freight) + .HasColumnType("money") + .HasDefaultValueSql("(0)"); + + entity.Property(e => e.OrderDate).HasColumnType("datetime"); + + entity.Property(e => e.RequiredDate).HasColumnType("datetime"); + + entity.Property(e => e.ShipAddress).HasMaxLength(60); + + entity.Property(e => e.ShipCity).HasMaxLength(15); + + entity.Property(e => e.ShipCountry).HasMaxLength(15); + + entity.Property(e => e.ShipName).HasMaxLength(40); + + entity.Property(e => e.ShipPostalCode).HasMaxLength(10); + + entity.Property(e => e.ShipRegion).HasMaxLength(15); + + entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + + entity.HasOne(d => d.Customer) + .WithMany(p => p.Orders) + .HasForeignKey(d => d.CustomerID) + .HasConstraintName("FK_Orders_Customers"); + + entity.HasOne(d => d.Employee) + .WithMany(p => p.Orders) + .HasForeignKey(d => d.EmployeeID) + .HasConstraintName("FK_Orders_Employees"); + + entity.HasOne(d => d.ShipViaNavigation) + .WithMany(p => p.Orders) + .HasForeignKey(d => d.ShipVia) + .HasConstraintName("FK_Orders_Shippers"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ProductID); + + entity.HasIndex(e => e.CategoryID) + .HasName("CategoryID"); + + entity.HasIndex(e => e.ProductName) + .HasName("ProductName"); + + entity.HasIndex(e => e.SupplierID) + .HasName("SuppliersProducts"); + + entity.Property(e => e.ProductID).HasColumnName("ProductID"); + + entity.Property(e => e.CategoryID).HasColumnName("CategoryID"); + + entity.Property(e => e.Discontinued) + .IsRequired(); + + entity.Property(e => e.ProductName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); + + entity.Property(e => e.ReorderLevel).HasDefaultValueSql("(0)"); + + entity.Property(e => e.SupplierID).HasColumnName("SupplierID"); + + entity.Property(e => e.UnitPrice) + .HasColumnType("money") + .HasDefaultValueSql("(0)"); + + entity.Property(e => e.UnitsInStock).HasDefaultValueSql("(0)"); + + entity.Property(e => e.UnitsOnOrder).HasDefaultValueSql("(0)"); + + entity.HasOne(d => d.Category) + .WithMany(p => p.Products) + .HasForeignKey(d => d.CategoryID) + .HasConstraintName("FK_Products_Categories"); + + entity.HasOne(d => d.Supplier) + .WithMany(p => p.Products) + .HasForeignKey(d => d.SupplierID) + .HasConstraintName("FK_Products_Suppliers"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RegionID) + .IsClustered(false); + + entity.Property(e => e.RegionID) + .HasColumnName("RegionID") + .ValueGeneratedNever(); + + entity.Property(e => e.RegionDescription) + .IsRequired() + .HasMaxLength(50) + .IsFixedLength(); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShipperID); + + entity.Property(e => e.ShipperID).HasColumnName("ShipperID"); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.Phone).HasMaxLength(24); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SupplierID); + + entity.HasIndex(e => e.CompanyName) + .HasName("CompanyName"); + + entity.HasIndex(e => e.PostalCode) + .HasName("PostalCode"); + + entity.Property(e => e.SupplierID).HasColumnName("SupplierID"); + + entity.Property(e => e.Address).HasMaxLength(60); + + entity.Property(e => e.City).HasMaxLength(15); + + entity.Property(e => e.CompanyName) + .IsRequired() + .HasMaxLength(40); + + entity.Property(e => e.ContactName).HasMaxLength(30); + + entity.Property(e => e.ContactTitle).HasMaxLength(30); + + entity.Property(e => e.Country).HasMaxLength(15); + + entity.Property(e => e.Fax).HasMaxLength(24); + + entity.Property(e => e.HomePage).HasColumnType("ntext"); + + entity.Property(e => e.Phone).HasMaxLength(24); + + entity.Property(e => e.PostalCode).HasMaxLength(10); + + entity.Property(e => e.Region).HasMaxLength(15); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TerritoryID) + .IsClustered(false); + + entity.Property(e => e.TerritoryID) + .HasColumnName("TerritoryID") + .HasMaxLength(20); + + entity.Property(e => e.RegionID).HasColumnName("RegionID"); + + entity.Property(e => e.TerritoryDescription) + .IsRequired() + .HasMaxLength(50) + .IsFixedLength(); + + entity.HasOne(d => d.Region) + .WithMany(p => p.Territories) + .HasForeignKey(d => d.RegionID) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Territories_Region"); + }); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs deleted file mode 100644 index 836e10df4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employee.cs +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.NorthwindEFCore -{ - using System; - using System.Collections.Generic; - - public partial class Employee - { - public Employee() - { - this.Employees1 = new HashSet(); - this.Orders = new HashSet(); - this.Territories = new HashSet(); - } - - public int EmployeeID { get; set; } - public string LastName { get; set; } - public string FirstName { get; set; } - public string Title { get; set; } - public string TitleOfCourtesy { get; set; } - public Nullable BirthDate { get; set; } - public Nullable HireDate { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Region { get; set; } - public string PostalCode { get; set; } - public string Country { get; set; } - public string HomePhone { get; set; } - public string Extension { get; set; } - public byte[] Photo { get; set; } - public string Notes { get; set; } - public Nullable ReportsTo { get; set; } - public string PhotoPath { get; set; } - - public virtual ICollection Employees1 { get; set; } - public virtual Employee Employee1 { get; set; } - public virtual ICollection Orders { get; set; } - public virtual ICollection Territories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/EmployeeTerritories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EmployeeTerritories.cs similarity index 64% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/EmployeeTerritories.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EmployeeTerritories.cs index ec46d8fa2..6f3fa5332 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/EmployeeTerritories.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EmployeeTerritories.cs @@ -5,14 +5,14 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels.NorthwindEFCoreScaffolded +namespace EFCoreModels.Northwind { public partial class EmployeeTerritories { - public int EmployeeId { get; set; } - public string TerritoryId { get; set; } + public int EmployeeID { get; set; } + public string TerritoryID { get; set; } public virtual Employees Employee { get; set; } - public virtual Territories Territory { get; set; } + public virtual Territory Territory { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Employees.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employees.cs similarity index 88% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Employees.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employees.cs index ec7621bd0..b9c3f150c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Employees.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Employees.cs @@ -5,7 +5,7 @@ // If you have enabled NRTs for your project, then un-comment the following line: // #nullable disable -namespace DbContextModels.NorthwindEFCoreScaffolded +namespace EFCoreModels.Northwind { public partial class Employees { @@ -13,10 +13,10 @@ public Employees() { EmployeeTerritories = new HashSet(); InverseReportsToNavigation = new HashSet(); - Orders = new HashSet(); + Orders = new HashSet(); } - public int EmployeeId { get; set; } + public int EmployeeID { get; set; } public string LastName { get; set; } public string FirstName { get; set; } public string Title { get; set; } @@ -38,6 +38,6 @@ public Employees() public virtual Employees ReportsToNavigation { get; set; } public virtual ICollection EmployeeTerritories { get; set; } public virtual ICollection InverseReportsToNavigation { get; set; } - public virtual ICollection Orders { get; set; } + public virtual ICollection Orders { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs deleted file mode 100644 index 9ca18a4de..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.Designer.cs +++ /dev/null @@ -1,10 +0,0 @@ -// T4 code generation is enabled for model 'C:\Users\crmhli\source\repos\OpenRiaServices\src\OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\Northwind\NorthwindDbCtx.edmx'. -// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer -// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model -// is open in the designer. - -// If no context and entity classes have been generated, it may be because you created an empty model but -// have not yet chosen which version of Entity Framework to use. To generate a context class and entity -// classes for your model, open the model in the designer, right-click on the designer surface, and -// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation -// Item...'. \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx deleted file mode 100644 index 264a90efc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindDbCtx.edmx +++ /dev/null @@ -1,934 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs deleted file mode 100644 index 7d0e45fe3..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.cs +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -namespace DbContextModels.NorthwindEFCore -{ - using System; - using Microsoft.EntityFrameworkCore; - - - public partial class EFCoreDbCtxNorthwindEntities : DbContext - { - public EFCoreDbCtxNorthwindEntities() - : base() - { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - throw new NotImplementedException(); - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - - } - - public DbSet Categories { get; set; } - public DbSet CustomerDemographics { get; set; } - public DbSet Customers { get; set; } - public DbSet Employees { get; set; } - public DbSet Order_Details { get; set; } - public DbSet Orders { get; set; } - public DbSet Products { get; set; } - public DbSet Regions { get; set; } - public DbSet Shippers { get; set; } - public DbSet Suppliers { get; set; } - public DbSet Territories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt deleted file mode 100644 index b3ee0b480..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.Context.tt +++ /dev/null @@ -1,194 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -var loader = new MetadataLoader(this); -var region = new CodeRegion(this); -var inputFile = @"NorthwindDbCtx.edmx"; -var ItemCollection = loader.CreateEdmItemCollection(inputFile); - -Code = new CodeGenerationTools(this); -EFTools = new MetadataTools(this); -ObjectNamespace = Code.VsNamespaceSuggestion(); -ModelNamespace = loader.GetModelNamespace(inputFile); - -EntityContainer container = ItemCollection.GetItems().FirstOrDefault(); -if (container == null) -{ - return string.Empty; -} -#> -//------------------------------------------------------------------------------ -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<# - -if (!String.IsNullOrEmpty(ObjectNamespace)) -{ -#> -namespace <#=Code.EscapeNamespace(ObjectNamespace)#> -{ -<# - PushIndent(CodeRegion.GetIndent(1)); -} - -#> -using System; -using System.Data.Entity; -using System.Data.Entity.Infrastructure; -<# -if (container.FunctionImports.Any()) -{ -#> -using System.Data.Objects; -<# -} -#> - -<#=Accessibility.ForType(container)#> partial class <#=Code.Escape(container)#> : DbContext -{ - public <#=Code.Escape(container)#>() - : base("name=<#=container.Name#>") - { -<# - WriteLazyLoadingEnabled(container); -#> - } - - protected override void OnModelCreating(DbModelBuilder modelBuilder) - { - throw new UnintentionalCodeFirstException(); - } - -<# - foreach (var entitySet in container.BaseEntitySets.OfType()) - { -#> - <#=Accessibility.ForReadOnlyProperty(entitySet)#> DbSet<<#=Code.Escape(entitySet.ElementType)#>> <#=Code.Escape(entitySet)#> { get; set; } -<# - } - - foreach (var edmFunction in container.FunctionImports) - { - WriteFunctionImport(edmFunction, false); - } -#> -} -<# - -if (!String.IsNullOrEmpty(ObjectNamespace)) -{ - PopIndent(); -#> -} -<# -} -#> -<#+ -string ModelNamespace { get; set; } -string ObjectNamespace { get; set; } -CodeGenerationTools Code { get; set; } -MetadataTools EFTools { get; set; } - -string GetResourceString(string resourceName) -{ - if(_resourceManager == null) - { - _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); - } - - return _resourceManager.GetString(resourceName, null); -} -System.Resources.ResourceManager _resourceManager; - -void WriteLazyLoadingEnabled(EntityContainer container) -{ - string lazyLoadingAttributeValue = null; - var lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; - if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) - { - bool isLazyLoading; - if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading) && !isLazyLoading) - { -#> - this.Configuration.LazyLoadingEnabled = false; -<#+ - } - } -} - -void WriteFunctionImport(EdmFunction edmFunction, bool includeMergeOption) -{ - var parameters = FunctionImportParameter.Create(edmFunction.Parameters, Code, EFTools); - var paramList = String.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); - var returnType = edmFunction.ReturnParameter == null ? null : EFTools.GetElementType(edmFunction.ReturnParameter.TypeUsage); - var processedReturn = returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType) + ">"; - - if (includeMergeOption) - { - paramList = Code.StringAfter(paramList, ", ") + "MergeOption mergeOption"; - } -#> - - <#=AccessibilityAndVirtual(Accessibility.ForMethod(edmFunction))#> <#=processedReturn#> <#=Code.Escape(edmFunction)#>(<#=paramList#>) - { -<#+ - if(returnType != null && (returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || - returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) - { -#> - ((IObjectContextAdapter)this).ObjectContext.MetadataWorkspace.LoadFromAssembly(typeof(<#=MultiSchemaEscape(returnType)#>).Assembly); - -<#+ - } - - foreach (var parameter in parameters.Where(p => p.NeedsLocalVariable)) - { - var isNotNull = parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"; - var notNullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", " + parameter.FunctionParameterName + ")"; - var nullInit = "new ObjectParameter(\"" + parameter.EsqlParameterName + "\", typeof(" + parameter.RawClrTypeName + "))"; -#> - var <#=parameter.LocalVariableName#> = <#=isNotNull#> ? - <#=notNullInit#> : - <#=nullInit#>; - -<#+ - } - - var genericArg = returnType == null ? "" : "<" + MultiSchemaEscape(returnType) + ">"; - var callParams = Code.StringBefore(", ", String.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray())); - - if (includeMergeOption) - { - callParams = ", mergeOption" + callParams; - } -#> - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<#=genericArg#>("<#=edmFunction.Name#>"<#=callParams#>); - } -<#+ - if(!includeMergeOption && returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) - { - WriteFunctionImport(edmFunction, true); - } -} - -string AccessibilityAndVirtual(string accessibility) -{ - return accessibility + (accessibility != "private" ? " virtual" : ""); -} - -string MultiSchemaEscape(TypeUsage usage) -{ - var type = usage.EdmType as StructuralType; - return type != null && type.NamespaceName != ModelNamespace ? - Code.CreateFullName(Code.EscapeNamespace(type.NamespaceName), Code.Escape(type)) : - Code.Escape(usage); -} - -#> \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs deleted file mode 100644 index 0c4c97d77..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.cs +++ /dev/null @@ -1,9 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt deleted file mode 100644 index b471b6d41..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindEntities.tt +++ /dev/null @@ -1,280 +0,0 @@ -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -CodeGenerationTools code = new CodeGenerationTools(this); -MetadataLoader loader = new MetadataLoader(this); -CodeRegion region = new CodeRegion(this, 1); -MetadataTools ef = new MetadataTools(this); - -string inputFile = @"NorthwindDbCtx.edmx"; -EdmItemCollection ItemCollection = loader.CreateEdmItemCollection(inputFile); -string namespaceName = code.VsNamespaceSuggestion(); - -EntityFrameworkTemplateFileManager fileManager = EntityFrameworkTemplateFileManager.Create(this); -WriteHeader(fileManager); - -foreach (var entity in ItemCollection.GetItems().OrderBy(e => e.Name)) -{ - fileManager.StartNewFile(entity.Name + ".cs"); - BeginNamespace(namespaceName, code); -#> -using System; -using System.Collections.Generic; - -<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#><#=code.StringBefore(" : ", code.Escape(entity.BaseType))#> -{ -<# - var propertiesWithDefaultValues = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity && p.DefaultValue != null); - var collectionNavigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity && np.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many); - var complexProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == entity); - - if (propertiesWithDefaultValues.Any() || collectionNavigationProperties.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(entity)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var navigationProperty in collectionNavigationProperties) - { -#> - this.<#=code.Escape(navigationProperty)#> = new HashSet<<#=code.Escape(navigationProperty.ToEndMember.GetEntityType())#>>(); -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var primitiveProperties = entity.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == entity); - if (primitiveProperties.Any()) - { - foreach (var edmProperty in primitiveProperties) - { - WriteProperty(code, edmProperty); - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var complexProperty in complexProperties) - { - WriteProperty(code, complexProperty); - } - } - - var navigationProperties = entity.NavigationProperties.Where(np => np.DeclaringType == entity); - if (navigationProperties.Any()) - { -#> - -<# - foreach (var navigationProperty in navigationProperties) - { - WriteNavigationProperty(code, navigationProperty); - } - } -#> -} -<# - EndNamespace(namespaceName); -} - -foreach (var complex in ItemCollection.GetItems().OrderBy(e => e.Name)) -{ - fileManager.StartNewFile(complex.Name + ".cs"); - BeginNamespace(namespaceName, code); -#> -using System; - -<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> -{ -<# - var complexProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is ComplexType && p.DeclaringType == complex); - var propertiesWithDefaultValues = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex && p.DefaultValue != null); - - if (propertiesWithDefaultValues.Any() || complexProperties.Any()) - { -#> - public <#=code.Escape(complex)#>() - { -<# - foreach (var edmProperty in propertiesWithDefaultValues) - { -#> - this.<#=code.Escape(edmProperty)#> = <#=code.CreateLiteral(edmProperty.DefaultValue)#>; -<# - } - - foreach (var complexProperty in complexProperties) - { -#> - this.<#=code.Escape(complexProperty)#> = new <#=code.Escape(complexProperty.TypeUsage)#>(); -<# - } -#> - } - -<# - } - - var primitiveProperties = complex.Properties.Where(p => p.TypeUsage.EdmType is PrimitiveType && p.DeclaringType == complex); - if (primitiveProperties.Any()) - { - foreach(var edmProperty in primitiveProperties) - { - WriteProperty(code, edmProperty); - } - } - - if (complexProperties.Any()) - { -#> - -<# - foreach(var edmProperty in complexProperties) - { - WriteProperty(code, edmProperty); - } - } -#> -} -<# - EndNamespace(namespaceName); -} - -if (!VerifyTypesAreCaseInsensitiveUnique(ItemCollection)) -{ - return ""; -} - -fileManager.Process(); - -#> -<#+ -string GetResourceString(string resourceName) -{ - if(_resourceManager == null) - { - _resourceManager = new System.Resources.ResourceManager("System.Data.Entity.Design", typeof(System.Data.Entity.Design.MetadataItemCollectionFactory).Assembly); - } - - return _resourceManager.GetString(resourceName, null); -} -System.Resources.ResourceManager _resourceManager; - -void WriteHeader(EntityFrameworkTemplateFileManager fileManager) -{ - fileManager.StartHeader(); -#> -//------------------------------------------------------------------------------ -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -<#+ - fileManager.EndBlock(); -} - -void BeginNamespace(string namespaceName, CodeGenerationTools code) -{ - CodeRegion region = new CodeRegion(this); - if (!String.IsNullOrEmpty(namespaceName)) - { -#> -namespace <#=code.EscapeNamespace(namespaceName)#> -{ -<#+ - PushIndent(CodeRegion.GetIndent(1)); - } -} - - -void EndNamespace(string namespaceName) -{ - if (!String.IsNullOrEmpty(namespaceName)) - { - PopIndent(); -#> -} -<#+ - } -} - -void WriteProperty(CodeGenerationTools code, EdmProperty edmProperty) -{ - WriteProperty(Accessibility.ForProperty(edmProperty), - code.Escape(edmProperty.TypeUsage), - code.Escape(edmProperty), - code.SpaceAfter(Accessibility.ForGetter(edmProperty)), - code.SpaceAfter(Accessibility.ForSetter(edmProperty))); -} - -void WriteNavigationProperty(CodeGenerationTools code, NavigationProperty navigationProperty) -{ - var endType = code.Escape(navigationProperty.ToEndMember.GetEntityType()); - WriteProperty(PropertyVirtualModifier(Accessibility.ForProperty(navigationProperty)), - navigationProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many ? ("ICollection<" + endType + ">") : endType, - code.Escape(navigationProperty), - code.SpaceAfter(Accessibility.ForGetter(navigationProperty)), - code.SpaceAfter(Accessibility.ForSetter(navigationProperty))); -} - -void WriteProperty(string accessibility, string type, string name, string getterAccessibility, string setterAccessibility) -{ -#> - <#=accessibility#> <#=type#> <#=name#> { <#=getterAccessibility#>get; <#=setterAccessibility#>set; } -<#+ -} - -string PropertyVirtualModifier(string accessibility) -{ - return accessibility + (accessibility != "private" ? " virtual" : ""); -} - -bool VerifyTypesAreCaseInsensitiveUnique(EdmItemCollection itemCollection) -{ - var alreadySeen = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach(var type in itemCollection.GetItems()) - { - if (!(type is EntityType || type is ComplexType)) - { - continue; - } - - if (alreadySeen.ContainsKey(type.FullName)) - { - Error(String.Format(CultureInfo.CurrentCulture, "This template does not support types that differ only by case, the types {0} are not supported", type.FullName)); - return false; - } - else - { - alreadySeen.Add(type.FullName, true); - } - } - - return true; -} -#> diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs index fc81b4896..36d998cba 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs @@ -5,20 +5,11 @@ // These assembly attributes allow us to serialize different CLR types into the same contract [assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", - ClrNamespace = "DbContextModels.NorthwindEFCore")] + ClrNamespace = "DbContextModels.Northwind")] -namespace DbContextModels.NorthwindEFCore +namespace EFCoreModels.Northwind { - public partial class EFCoreDbCtxNorthwindEntities - { - string _connection; - - public EFCoreDbCtxNorthwindEntities(string connection) - { - _connection = connection; - } - } - + // TODO: Remove MetaDataType attributes and move attributes directly to classe == [MetadataType(typeof(RegionMetadata))] public partial class Region { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs index f82c1cf97..76cbcfac4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs @@ -1,42 +1,37 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Order { public Order() { - this.Order_Details = new HashSet(); + OrderDetails = new HashSet(); } - + public int OrderID { get; set; } public string CustomerID { get; set; } - public Nullable EmployeeID { get; set; } - public Nullable OrderDate { get; set; } - public Nullable RequiredDate { get; set; } - public Nullable ShippedDate { get; set; } - public Nullable ShipVia { get; set; } - public Nullable Freight { get; set; } + public int? EmployeeID { get; set; } + public DateTime? OrderDate { get; set; } + public DateTime? RequiredDate { get; set; } + public DateTime? ShippedDate { get; set; } + public int? ShipVia { get; set; } + public decimal? Freight { get; set; } public string ShipName { get; set; } public string ShipAddress { get; set; } public string ShipCity { get; set; } public string ShipRegion { get; set; } public string ShipPostalCode { get; set; } public string ShipCountry { get; set; } - + public virtual Customer Customer { get; set; } - public virtual Employee Employee { get; set; } - public virtual ICollection Order_Details { get; set; } - public virtual Shipper Shipper { get; set; } + public virtual Employees Employee { get; set; } + public virtual Shipper ShipViaNavigation { get; set; } + public virtual ICollection OrderDetails { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs index 804e968b5..576e5ca09 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs @@ -1,17 +1,12 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Order_Detail { public int OrderID { get; set; } @@ -19,7 +14,7 @@ public partial class Order_Detail public decimal UnitPrice { get; set; } public short Quantity { get; set; } public float Discount { get; set; } - + public virtual Order Order { get; set; } public virtual Product Product { get; set; } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs index 48658c2fc..7068aa68d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs @@ -1,37 +1,32 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Product { public Product() { - this.Order_Details = new HashSet(); + OrderDetails = new HashSet(); } - + public int ProductID { get; set; } public string ProductName { get; set; } - public Nullable SupplierID { get; set; } - public Nullable CategoryID { get; set; } + public int? SupplierID { get; set; } + public int? CategoryID { get; set; } public string QuantityPerUnit { get; set; } - public Nullable UnitPrice { get; set; } - public Nullable UnitsInStock { get; set; } - public Nullable UnitsOnOrder { get; set; } - public Nullable ReorderLevel { get; set; } + public decimal? UnitPrice { get; set; } + public short? UnitsInStock { get; set; } + public short? UnitsOnOrder { get; set; } + public short? ReorderLevel { get; set; } public bool Discontinued { get; set; } - + public virtual Category Category { get; set; } - public virtual ICollection Order_Details { get; set; } public virtual Supplier Supplier { get; set; } + public virtual ICollection OrderDetails { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs index 538583bb1..9e808a3bc 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs @@ -1,27 +1,22 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Region { public Region() { - this.Territories = new HashSet(); + Territories = new HashSet(); } - + public int RegionID { get; set; } public string RegionDescription { get; set; } - + public virtual ICollection Territories { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs deleted file mode 100644 index f859d045d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/AlphabeticalListOfProducts.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class AlphabeticalListOfProducts - { - public int ProductId { get; set; } - public string ProductName { get; set; } - public int? SupplierId { get; set; } - public int? CategoryId { get; set; } - public string QuantityPerUnit { get; set; } - public decimal? UnitPrice { get; set; } - public short? UnitsInStock { get; set; } - public short? UnitsOnOrder { get; set; } - public short? ReorderLevel { get; set; } - public bool Discontinued { get; set; } - public string CategoryName { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs deleted file mode 100644 index 5853eb839..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Categories.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Categories - { - public Categories() - { - Products = new HashSet(); - } - - public int CategoryId { get; set; } - public string CategoryName { get; set; } - public string Description { get; set; } - public byte[] Picture { get; set; } - - public virtual ICollection Products { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs deleted file mode 100644 index bf367837e..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CategorySalesFor1997.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class CategorySalesFor1997 - { - public string CategoryName { get; set; } - public decimal? CategorySales { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs deleted file mode 100644 index 6fe696927..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CurrentProductList.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class CurrentProductList - { - public int ProductId { get; set; } - public string ProductName { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs deleted file mode 100644 index 8bb9f88ba..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/CustomerAndSuppliersByCity.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class CustomerAndSuppliersByCity - { - public string City { get; set; } - public string CompanyName { get; set; } - public string ContactName { get; set; } - public string Relationship { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs deleted file mode 100644 index 70f3349ad..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Customers.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Customers - { - public Customers() - { - CustomerCustomerDemo = new HashSet(); - Orders = new HashSet(); - } - - public string CustomerId { get; set; } - public string CompanyName { get; set; } - public string ContactName { get; set; } - public string ContactTitle { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Region { get; set; } - public string PostalCode { get; set; } - public string Country { get; set; } - public string Phone { get; set; } - public string Fax { get; set; } - - public virtual ICollection CustomerCustomerDemo { get; set; } - public virtual ICollection Orders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs deleted file mode 100644 index b8ec9bd13..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Invoices.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Invoices - { - public string ShipName { get; set; } - public string ShipAddress { get; set; } - public string ShipCity { get; set; } - public string ShipRegion { get; set; } - public string ShipPostalCode { get; set; } - public string ShipCountry { get; set; } - public string CustomerId { get; set; } - public string CustomerName { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Region { get; set; } - public string PostalCode { get; set; } - public string Country { get; set; } - public string Salesperson { get; set; } - public int OrderId { get; set; } - public DateTime? OrderDate { get; set; } - public DateTime? RequiredDate { get; set; } - public DateTime? ShippedDate { get; set; } - public string ShipperName { get; set; } - public int ProductId { get; set; } - public string ProductName { get; set; } - public decimal UnitPrice { get; set; } - public short Quantity { get; set; } - public float Discount { get; set; } - public decimal? ExtendedPrice { get; set; } - public decimal? Freight { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs deleted file mode 100644 index 8bc826e92..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/NorthwindContext.cs +++ /dev/null @@ -1,840 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class NorthwindContext : DbContext - { - public NorthwindContext() - { - } - - public NorthwindContext(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet AlphabeticalListOfProducts { get; set; } - public virtual DbSet Categories { get; set; } - public virtual DbSet CategorySalesFor1997 { get; set; } - public virtual DbSet CurrentProductList { get; set; } - public virtual DbSet CustomerAndSuppliersByCity { get; set; } - public virtual DbSet CustomerCustomerDemo { get; set; } - public virtual DbSet CustomerDemographics { get; set; } - public virtual DbSet Customers { get; set; } - public virtual DbSet EmployeeTerritories { get; set; } - public virtual DbSet Employees { get; set; } - public virtual DbSet Invoices { get; set; } - public virtual DbSet OrderDetails { get; set; } - public virtual DbSet OrderDetailsExtended { get; set; } - public virtual DbSet OrderSubtotals { get; set; } - public virtual DbSet Orders { get; set; } - public virtual DbSet OrdersQry { get; set; } - public virtual DbSet ProductSalesFor1997 { get; set; } - public virtual DbSet Products { get; set; } - public virtual DbSet ProductsAboveAveragePrice { get; set; } - public virtual DbSet ProductsByCategory { get; set; } - public virtual DbSet QuarterlyOrders { get; set; } - public virtual DbSet Region { get; set; } - public virtual DbSet SalesByCategory { get; set; } - public virtual DbSet SalesTotalsByAmount { get; set; } - public virtual DbSet Shippers { get; set; } - public virtual DbSet SummaryOfSalesByQuarter { get; set; } - public virtual DbSet SummaryOfSalesByYear { get; set; } - public virtual DbSet Suppliers { get; set; } - public virtual DbSet Territories { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - if (!optionsBuilder.IsConfigured) - { -#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings. - optionsBuilder.UseSqlServer("server=.\\SQLEXPRESS;initial catalog=Northwind;Integrated Security=SSPI; MultipleActiveResultSets=true"); - } - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Alphabetical list of products"); - - entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); - - entity.Property(e => e.CategoryName) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); - - entity.Property(e => e.SupplierId).HasColumnName("SupplierID"); - - entity.Property(e => e.UnitPrice).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId); - - entity.HasIndex(e => e.CategoryName) - .HasName("CategoryName"); - - entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); - - entity.Property(e => e.CategoryName) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.Description).HasColumnType("ntext"); - - entity.Property(e => e.Picture).HasColumnType("image"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Category Sales for 1997"); - - entity.Property(e => e.CategoryName) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.CategorySales).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Current Product List"); - - entity.Property(e => e.ProductId) - .HasColumnName("ProductID") - .ValueGeneratedOnAdd(); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Customer and Suppliers by City"); - - entity.Property(e => e.City).HasMaxLength(15); - - entity.Property(e => e.CompanyName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.ContactName).HasMaxLength(30); - - entity.Property(e => e.Relationship) - .IsRequired() - .HasMaxLength(9) - .IsUnicode(false); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.CustomerId, e.CustomerTypeId }) - .IsClustered(false); - - entity.Property(e => e.CustomerId) - .HasColumnName("CustomerID") - .HasMaxLength(5) - .IsFixedLength(); - - entity.Property(e => e.CustomerTypeId) - .HasColumnName("CustomerTypeID") - .HasMaxLength(10) - .IsFixedLength(); - - entity.HasOne(d => d.Customer) - .WithMany(p => p.CustomerCustomerDemo) - .HasForeignKey(d => d.CustomerId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CustomerCustomerDemo_Customers"); - - entity.HasOne(d => d.CustomerType) - .WithMany(p => p.CustomerCustomerDemo) - .HasForeignKey(d => d.CustomerTypeId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CustomerCustomerDemo"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CustomerTypeId) - .IsClustered(false); - - entity.Property(e => e.CustomerTypeId) - .HasColumnName("CustomerTypeID") - .HasMaxLength(10) - .IsFixedLength(); - - entity.Property(e => e.CustomerDesc).HasColumnType("ntext"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CustomerId); - - entity.HasIndex(e => e.City) - .HasName("City"); - - entity.HasIndex(e => e.CompanyName) - .HasName("CompanyName"); - - entity.HasIndex(e => e.PostalCode) - .HasName("PostalCode"); - - entity.HasIndex(e => e.Region) - .HasName("Region"); - - entity.Property(e => e.CustomerId) - .HasColumnName("CustomerID") - .HasMaxLength(5) - .IsFixedLength(); - - entity.Property(e => e.Address).HasMaxLength(60); - - entity.Property(e => e.City).HasMaxLength(15); - - entity.Property(e => e.CompanyName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.ContactName).HasMaxLength(30); - - entity.Property(e => e.ContactTitle).HasMaxLength(30); - - entity.Property(e => e.Country).HasMaxLength(15); - - entity.Property(e => e.Fax).HasMaxLength(24); - - entity.Property(e => e.Phone).HasMaxLength(24); - - entity.Property(e => e.PostalCode).HasMaxLength(10); - - entity.Property(e => e.Region).HasMaxLength(15); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.EmployeeId, e.TerritoryId }) - .IsClustered(false); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.TerritoryId) - .HasColumnName("TerritoryID") - .HasMaxLength(20); - - entity.HasOne(d => d.Employee) - .WithMany(p => p.EmployeeTerritories) - .HasForeignKey(d => d.EmployeeId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmployeeTerritories_Employees"); - - entity.HasOne(d => d.Territory) - .WithMany(p => p.EmployeeTerritories) - .HasForeignKey(d => d.TerritoryId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmployeeTerritories_Territories"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.EmployeeId); - - entity.HasIndex(e => e.LastName) - .HasName("LastName"); - - entity.HasIndex(e => e.PostalCode) - .HasName("PostalCode"); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.Address).HasMaxLength(60); - - entity.Property(e => e.BirthDate).HasColumnType("datetime"); - - entity.Property(e => e.City).HasMaxLength(15); - - entity.Property(e => e.Country).HasMaxLength(15); - - entity.Property(e => e.Extension).HasMaxLength(4); - - entity.Property(e => e.FirstName) - .IsRequired() - .HasMaxLength(10); - - entity.Property(e => e.HireDate).HasColumnType("datetime"); - - entity.Property(e => e.HomePhone).HasMaxLength(24); - - entity.Property(e => e.LastName) - .IsRequired() - .HasMaxLength(20); - - entity.Property(e => e.Notes).HasColumnType("ntext"); - - entity.Property(e => e.Photo).HasColumnType("image"); - - entity.Property(e => e.PhotoPath).HasMaxLength(255); - - entity.Property(e => e.PostalCode).HasMaxLength(10); - - entity.Property(e => e.Region).HasMaxLength(15); - - entity.Property(e => e.Title).HasMaxLength(30); - - entity.Property(e => e.TitleOfCourtesy).HasMaxLength(25); - - entity.HasOne(d => d.ReportsToNavigation) - .WithMany(p => p.InverseReportsToNavigation) - .HasForeignKey(d => d.ReportsTo) - .HasConstraintName("FK_Employees_Employees"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Invoices"); - - entity.Property(e => e.Address).HasMaxLength(60); - - entity.Property(e => e.City).HasMaxLength(15); - - entity.Property(e => e.Country).HasMaxLength(15); - - entity.Property(e => e.CustomerId) - .HasColumnName("CustomerID") - .HasMaxLength(5) - .IsFixedLength(); - - entity.Property(e => e.CustomerName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.ExtendedPrice).HasColumnType("money"); - - entity.Property(e => e.Freight).HasColumnType("money"); - - entity.Property(e => e.OrderDate).HasColumnType("datetime"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.PostalCode).HasMaxLength(10); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.Region).HasMaxLength(15); - - entity.Property(e => e.RequiredDate).HasColumnType("datetime"); - - entity.Property(e => e.Salesperson) - .IsRequired() - .HasMaxLength(31); - - entity.Property(e => e.ShipAddress).HasMaxLength(60); - - entity.Property(e => e.ShipCity).HasMaxLength(15); - - entity.Property(e => e.ShipCountry).HasMaxLength(15); - - entity.Property(e => e.ShipName).HasMaxLength(40); - - entity.Property(e => e.ShipPostalCode).HasMaxLength(10); - - entity.Property(e => e.ShipRegion).HasMaxLength(15); - - entity.Property(e => e.ShippedDate).HasColumnType("datetime"); - - entity.Property(e => e.ShipperName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.UnitPrice).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => new { e.OrderId, e.ProductId }) - .HasName("PK_Order_Details"); - - entity.ToTable("Order Details"); - - entity.HasIndex(e => e.OrderId) - .HasName("OrdersOrder_Details"); - - entity.HasIndex(e => e.ProductId) - .HasName("ProductsOrder_Details"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.Discount).HasDefaultValueSql("(0)"); - - entity.Property(e => e.Quantity).HasDefaultValueSql("(1)"); - - entity.Property(e => e.UnitPrice) - .HasColumnType("money") - .HasDefaultValueSql("(0)"); - - entity.HasOne(d => d.Order) - .WithMany(p => p.OrderDetails) - .HasForeignKey(d => d.OrderId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Order_Details_Orders"); - - entity.HasOne(d => d.Product) - .WithMany(p => p.OrderDetails) - .HasForeignKey(d => d.ProductId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Order_Details_Products"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Order Details Extended"); - - entity.Property(e => e.ExtendedPrice).HasColumnType("money"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.UnitPrice).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Order Subtotals"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.Subtotal).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.OrderId); - - entity.HasIndex(e => e.CustomerId) - .HasName("CustomersOrders"); - - entity.HasIndex(e => e.EmployeeId) - .HasName("EmployeesOrders"); - - entity.HasIndex(e => e.OrderDate) - .HasName("OrderDate"); - - entity.HasIndex(e => e.ShipPostalCode) - .HasName("ShipPostalCode"); - - entity.HasIndex(e => e.ShipVia) - .HasName("ShippersOrders"); - - entity.HasIndex(e => e.ShippedDate) - .HasName("ShippedDate"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.CustomerId) - .HasColumnName("CustomerID") - .HasMaxLength(5) - .IsFixedLength(); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.Freight) - .HasColumnType("money") - .HasDefaultValueSql("(0)"); - - entity.Property(e => e.OrderDate).HasColumnType("datetime"); - - entity.Property(e => e.RequiredDate).HasColumnType("datetime"); - - entity.Property(e => e.ShipAddress).HasMaxLength(60); - - entity.Property(e => e.ShipCity).HasMaxLength(15); - - entity.Property(e => e.ShipCountry).HasMaxLength(15); - - entity.Property(e => e.ShipName).HasMaxLength(40); - - entity.Property(e => e.ShipPostalCode).HasMaxLength(10); - - entity.Property(e => e.ShipRegion).HasMaxLength(15); - - entity.Property(e => e.ShippedDate).HasColumnType("datetime"); - - entity.HasOne(d => d.Customer) - .WithMany(p => p.Orders) - .HasForeignKey(d => d.CustomerId) - .HasConstraintName("FK_Orders_Customers"); - - entity.HasOne(d => d.Employee) - .WithMany(p => p.Orders) - .HasForeignKey(d => d.EmployeeId) - .HasConstraintName("FK_Orders_Employees"); - - entity.HasOne(d => d.ShipViaNavigation) - .WithMany(p => p.Orders) - .HasForeignKey(d => d.ShipVia) - .HasConstraintName("FK_Orders_Shippers"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Orders Qry"); - - entity.Property(e => e.Address).HasMaxLength(60); - - entity.Property(e => e.City).HasMaxLength(15); - - entity.Property(e => e.CompanyName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.Country).HasMaxLength(15); - - entity.Property(e => e.CustomerId) - .HasColumnName("CustomerID") - .HasMaxLength(5) - .IsFixedLength(); - - entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID"); - - entity.Property(e => e.Freight).HasColumnType("money"); - - entity.Property(e => e.OrderDate).HasColumnType("datetime"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.PostalCode).HasMaxLength(10); - - entity.Property(e => e.Region).HasMaxLength(15); - - entity.Property(e => e.RequiredDate).HasColumnType("datetime"); - - entity.Property(e => e.ShipAddress).HasMaxLength(60); - - entity.Property(e => e.ShipCity).HasMaxLength(15); - - entity.Property(e => e.ShipCountry).HasMaxLength(15); - - entity.Property(e => e.ShipName).HasMaxLength(40); - - entity.Property(e => e.ShipPostalCode).HasMaxLength(10); - - entity.Property(e => e.ShipRegion).HasMaxLength(15); - - entity.Property(e => e.ShippedDate).HasColumnType("datetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Product Sales for 1997"); - - entity.Property(e => e.CategoryName) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.ProductSales).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ProductId); - - entity.HasIndex(e => e.CategoryId) - .HasName("CategoryID"); - - entity.HasIndex(e => e.ProductName) - .HasName("ProductName"); - - entity.HasIndex(e => e.SupplierId) - .HasName("SuppliersProducts"); - - entity.Property(e => e.ProductId).HasColumnName("ProductID"); - - entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); - - entity.Property(e => e.Discontinued) - .IsRequired() - .HasDefaultValueSql("(0)"); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); - - entity.Property(e => e.ReorderLevel).HasDefaultValueSql("(0)"); - - entity.Property(e => e.SupplierId).HasColumnName("SupplierID"); - - entity.Property(e => e.UnitPrice) - .HasColumnType("money") - .HasDefaultValueSql("(0)"); - - entity.Property(e => e.UnitsInStock).HasDefaultValueSql("(0)"); - - entity.Property(e => e.UnitsOnOrder).HasDefaultValueSql("(0)"); - - entity.HasOne(d => d.Category) - .WithMany(p => p.Products) - .HasForeignKey(d => d.CategoryId) - .HasConstraintName("FK_Products_Categories"); - - entity.HasOne(d => d.Supplier) - .WithMany(p => p.Products) - .HasForeignKey(d => d.SupplierId) - .HasConstraintName("FK_Products_Suppliers"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Products Above Average Price"); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.UnitPrice).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Products by Category"); - - entity.Property(e => e.CategoryName) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Quarterly Orders"); - - entity.Property(e => e.City).HasMaxLength(15); - - entity.Property(e => e.CompanyName).HasMaxLength(40); - - entity.Property(e => e.Country).HasMaxLength(15); - - entity.Property(e => e.CustomerId) - .HasColumnName("CustomerID") - .HasMaxLength(5) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.RegionId) - .IsClustered(false); - - entity.Property(e => e.RegionId) - .HasColumnName("RegionID") - .ValueGeneratedNever(); - - entity.Property(e => e.RegionDescription) - .IsRequired() - .HasMaxLength(50) - .IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Sales by Category"); - - entity.Property(e => e.CategoryId).HasColumnName("CategoryID"); - - entity.Property(e => e.CategoryName) - .IsRequired() - .HasMaxLength(15); - - entity.Property(e => e.ProductName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.ProductSales).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Sales Totals by Amount"); - - entity.Property(e => e.CompanyName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.SaleAmount).HasColumnType("money"); - - entity.Property(e => e.ShippedDate).HasColumnType("datetime"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ShipperId); - - entity.Property(e => e.ShipperId).HasColumnName("ShipperID"); - - entity.Property(e => e.CompanyName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.Phone).HasMaxLength(24); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Summary of Sales by Quarter"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.ShippedDate).HasColumnType("datetime"); - - entity.Property(e => e.Subtotal).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.ToView("Summary of Sales by Year"); - - entity.Property(e => e.OrderId).HasColumnName("OrderID"); - - entity.Property(e => e.ShippedDate).HasColumnType("datetime"); - - entity.Property(e => e.Subtotal).HasColumnType("money"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SupplierId); - - entity.HasIndex(e => e.CompanyName) - .HasName("CompanyName"); - - entity.HasIndex(e => e.PostalCode) - .HasName("PostalCode"); - - entity.Property(e => e.SupplierId).HasColumnName("SupplierID"); - - entity.Property(e => e.Address).HasMaxLength(60); - - entity.Property(e => e.City).HasMaxLength(15); - - entity.Property(e => e.CompanyName) - .IsRequired() - .HasMaxLength(40); - - entity.Property(e => e.ContactName).HasMaxLength(30); - - entity.Property(e => e.ContactTitle).HasMaxLength(30); - - entity.Property(e => e.Country).HasMaxLength(15); - - entity.Property(e => e.Fax).HasMaxLength(24); - - entity.Property(e => e.HomePage).HasColumnType("ntext"); - - entity.Property(e => e.Phone).HasMaxLength(24); - - entity.Property(e => e.PostalCode).HasMaxLength(10); - - entity.Property(e => e.Region).HasMaxLength(15); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TerritoryId) - .IsClustered(false); - - entity.Property(e => e.TerritoryId) - .HasColumnName("TerritoryID") - .HasMaxLength(20); - - entity.Property(e => e.RegionId).HasColumnName("RegionID"); - - entity.Property(e => e.TerritoryDescription) - .IsRequired() - .HasMaxLength(50) - .IsFixedLength(); - - entity.HasOne(d => d.Region) - .WithMany(p => p.Territories) - .HasForeignKey(d => d.RegionId) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Territories_Region"); - }); - - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs deleted file mode 100644 index 3fce9a2cc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetails.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class OrderDetails - { - public int OrderId { get; set; } - public int ProductId { get; set; } - public decimal UnitPrice { get; set; } - public short Quantity { get; set; } - public float Discount { get; set; } - - public virtual Orders Order { get; set; } - public virtual Products Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs deleted file mode 100644 index 4c3591643..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderDetailsExtended.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class OrderDetailsExtended - { - public int OrderId { get; set; } - public int ProductId { get; set; } - public string ProductName { get; set; } - public decimal UnitPrice { get; set; } - public short Quantity { get; set; } - public float Discount { get; set; } - public decimal? ExtendedPrice { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs deleted file mode 100644 index 30d8d65f5..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrderSubtotals.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class OrderSubtotals - { - public int OrderId { get; set; } - public decimal? Subtotal { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs deleted file mode 100644 index 8ffbe7214..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Orders.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Orders - { - public Orders() - { - OrderDetails = new HashSet(); - } - - public int OrderId { get; set; } - public string CustomerId { get; set; } - public int? EmployeeId { get; set; } - public DateTime? OrderDate { get; set; } - public DateTime? RequiredDate { get; set; } - public DateTime? ShippedDate { get; set; } - public int? ShipVia { get; set; } - public decimal? Freight { get; set; } - public string ShipName { get; set; } - public string ShipAddress { get; set; } - public string ShipCity { get; set; } - public string ShipRegion { get; set; } - public string ShipPostalCode { get; set; } - public string ShipCountry { get; set; } - - public virtual Customers Customer { get; set; } - public virtual Employees Employee { get; set; } - public virtual Shippers ShipViaNavigation { get; set; } - public virtual ICollection OrderDetails { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs deleted file mode 100644 index f6e0db6bc..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/OrdersQry.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class OrdersQry - { - public int OrderId { get; set; } - public string CustomerId { get; set; } - public int? EmployeeId { get; set; } - public DateTime? OrderDate { get; set; } - public DateTime? RequiredDate { get; set; } - public DateTime? ShippedDate { get; set; } - public int? ShipVia { get; set; } - public decimal? Freight { get; set; } - public string ShipName { get; set; } - public string ShipAddress { get; set; } - public string ShipCity { get; set; } - public string ShipRegion { get; set; } - public string ShipPostalCode { get; set; } - public string ShipCountry { get; set; } - public string CompanyName { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Region { get; set; } - public string PostalCode { get; set; } - public string Country { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs deleted file mode 100644 index 87b13dde3..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductSalesFor1997.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class ProductSalesFor1997 - { - public string CategoryName { get; set; } - public string ProductName { get; set; } - public decimal? ProductSales { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs deleted file mode 100644 index a6651907b..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Products.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Products - { - public Products() - { - OrderDetails = new HashSet(); - } - - public int ProductId { get; set; } - public string ProductName { get; set; } - public int? SupplierId { get; set; } - public int? CategoryId { get; set; } - public string QuantityPerUnit { get; set; } - public decimal? UnitPrice { get; set; } - public short? UnitsInStock { get; set; } - public short? UnitsOnOrder { get; set; } - public short? ReorderLevel { get; set; } - public bool? Discontinued { get; set; } - - public virtual Categories Category { get; set; } - public virtual Suppliers Supplier { get; set; } - public virtual ICollection OrderDetails { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs deleted file mode 100644 index 1056845b0..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsAboveAveragePrice.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class ProductsAboveAveragePrice - { - public string ProductName { get; set; } - public decimal? UnitPrice { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs deleted file mode 100644 index cb68e96aa..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/ProductsByCategory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class ProductsByCategory - { - public string CategoryName { get; set; } - public string ProductName { get; set; } - public string QuantityPerUnit { get; set; } - public short? UnitsInStock { get; set; } - public bool Discontinued { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs deleted file mode 100644 index ddb4dc4f8..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/QuarterlyOrders.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class QuarterlyOrders - { - public string CustomerId { get; set; } - public string CompanyName { get; set; } - public string City { get; set; } - public string Country { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs deleted file mode 100644 index 0dcc26b66..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Region.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Region - { - public Region() - { - Territories = new HashSet(); - } - - public int RegionId { get; set; } - public string RegionDescription { get; set; } - - public virtual ICollection Territories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs deleted file mode 100644 index f520b3c01..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesByCategory.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class SalesByCategory - { - public int CategoryId { get; set; } - public string CategoryName { get; set; } - public string ProductName { get; set; } - public decimal? ProductSales { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs deleted file mode 100644 index 425ad6305..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SalesTotalsByAmount.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class SalesTotalsByAmount - { - public decimal? SaleAmount { get; set; } - public int OrderId { get; set; } - public string CompanyName { get; set; } - public DateTime? ShippedDate { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs deleted file mode 100644 index bbb71f130..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Shippers.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Shippers - { - public Shippers() - { - Orders = new HashSet(); - } - - public int ShipperId { get; set; } - public string CompanyName { get; set; } - public string Phone { get; set; } - - public virtual ICollection Orders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs deleted file mode 100644 index 619bfdc11..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByQuarter.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class SummaryOfSalesByQuarter - { - public DateTime? ShippedDate { get; set; } - public int OrderId { get; set; } - public decimal? Subtotal { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs deleted file mode 100644 index 9ed3a1dab..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/SummaryOfSalesByYear.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class SummaryOfSalesByYear - { - public DateTime? ShippedDate { get; set; } - public int OrderId { get; set; } - public decimal? Subtotal { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs deleted file mode 100644 index a115dd4f4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Suppliers.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Suppliers - { - public Suppliers() - { - Products = new HashSet(); - } - - public int SupplierId { get; set; } - public string CompanyName { get; set; } - public string ContactName { get; set; } - public string ContactTitle { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Region { get; set; } - public string PostalCode { get; set; } - public string Country { get; set; } - public string Phone { get; set; } - public string Fax { get; set; } - public string HomePage { get; set; } - - public virtual ICollection Products { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs deleted file mode 100644 index 71acea158..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/ScaffoldedDBContext/Territories.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; - -// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. -// If you have enabled NRTs for your project, then un-comment the following line: -// #nullable disable - -namespace DbContextModels.NorthwindEFCoreScaffolded -{ - public partial class Territories - { - public Territories() - { - EmployeeTerritories = new HashSet(); - } - - public string TerritoryId { get; set; } - public string TerritoryDescription { get; set; } - public int RegionId { get; set; } - - public virtual Region Region { get; set; } - public virtual ICollection EmployeeTerritories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs index f5bf540f7..64f1b92e1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Shipper.cs @@ -1,28 +1,23 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Shipper { public Shipper() { - this.Orders = new HashSet(); + Orders = new HashSet(); } - + public int ShipperID { get; set; } public string CompanyName { get; set; } public string Phone { get; set; } - + public virtual ICollection Orders { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs index b479444d5..502950d83 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Supplier.cs @@ -1,24 +1,19 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Supplier { public Supplier() { - this.Products = new HashSet(); + Products = new HashSet(); } - + public int SupplierID { get; set; } public string CompanyName { get; set; } public string ContactName { get; set; } @@ -31,7 +26,7 @@ public Supplier() public string Phone { get; set; } public string Fax { get; set; } public string HomePage { get; set; } - + public virtual ICollection Products { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs index 986107dbe..72c560216 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs @@ -1,29 +1,24 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; -namespace DbContextModels.NorthwindEFCore +// Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. +// If you have enabled NRTs for your project, then un-comment the following line: +// #nullable disable + +namespace EFCoreModels.Northwind { - using System; - using System.Collections.Generic; - public partial class Territory { public Territory() { - this.Employees = new HashSet(); + EmployeeTerritories = new HashSet(); } - + public string TerritoryID { get; set; } public string TerritoryDescription { get; set; } public int RegionID { get; set; } - + public virtual Region Region { get; set; } - public virtual ICollection Employees { get; set; } + public virtual ICollection EmployeeTerritories { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json new file mode 100644 index 000000000..198ed47ce --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json @@ -0,0 +1,303 @@ +{ + "CodeGenerationMode": 1, + "ContextClassName": "AdventureworksContext", + "ContextNamespace": null, + "DefaultDacpacSchema": null, + "FilterSchemas": false, + "IncludeConnectionString": true, + "ModelNamespace": null, + "OutputContextPath": "AdventureWorks", + "OutputPath": "AdventureWorks", + "ProjectRootNamespace": "EFCoreModels.AdventureWorks", + "Schemas": null, + "SelectedHandlebarsLanguage": 0, + "SelectedToBeGenerated": 0, + "Tables": [ + { + "Name": "[HumanResources].[Department]", + "ObjectType": 0 + }, + { + "Name": "[HumanResources].[Employee]", + "ObjectType": 0 + }, + { + "Name": "[HumanResources].[EmployeeAddress]", + "ObjectType": 0 + }, + { + "Name": "[HumanResources].[EmployeeDepartmentHistory]", + "ObjectType": 0 + }, + { + "Name": "[HumanResources].[EmployeePayHistory]", + "ObjectType": 0 + }, + { + "Name": "[HumanResources].[JobCandidate]", + "ObjectType": 0 + }, + { + "Name": "[HumanResources].[Shift]", + "ObjectType": 0 + }, + { + "Name": "[Person].[Address]", + "ObjectType": 0 + }, + { + "Name": "[Person].[AddressType]", + "ObjectType": 0 + }, + { + "Name": "[Person].[Contact]", + "ObjectType": 0 + }, + { + "Name": "[Person].[ContactType]", + "ObjectType": 0 + }, + { + "Name": "[Person].[CountryRegion]", + "ObjectType": 0 + }, + { + "Name": "[Person].[StateProvince]", + "ObjectType": 0 + }, + { + "Name": "[Production].[BillOfMaterials]", + "ObjectType": 0 + }, + { + "Name": "[Production].[Culture]", + "ObjectType": 0 + }, + { + "Name": "[Production].[Document]", + "ObjectType": 0 + }, + { + "Name": "[Production].[Illustration]", + "ObjectType": 0 + }, + { + "Name": "[Production].[Location]", + "ObjectType": 0 + }, + { + "Name": "[Production].[Product]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductCategory]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductCostHistory]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductDescription]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductDocument]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductInventory]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductListPriceHistory]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductModel]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductModelIllustration]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductModelProductDescriptionCulture]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductPhoto]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductProductPhoto]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductReview]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ProductSubcategory]", + "ObjectType": 0 + }, + { + "Name": "[Production].[ScrapReason]", + "ObjectType": 0 + }, + { + "Name": "[Production].[TransactionHistory]", + "ObjectType": 0 + }, + { + "Name": "[Production].[TransactionHistoryArchive]", + "ObjectType": 0 + }, + { + "Name": "[Production].[UnitMeasure]", + "ObjectType": 0 + }, + { + "Name": "[Production].[WorkOrder]", + "ObjectType": 0 + }, + { + "Name": "[Production].[WorkOrderRouting]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[ProductVendor]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[PurchaseOrderDetail]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[PurchaseOrderHeader]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[ShipMethod]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[Vendor]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[VendorAddress]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[VendorContact]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[ContactCreditCard]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[CountryRegionCurrency]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[CreditCard]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[Currency]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[CurrencyRate]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[Customer]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[CustomerAddress]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[Individual]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesOrderDetail]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesOrderHeader]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesOrderHeaderSalesReason]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesPerson]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesPersonQuotaHistory]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesReason]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesTaxRate]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesTerritory]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SalesTerritoryHistory]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[ShoppingCartItem]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SpecialOffer]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[SpecialOfferProduct]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[Store]", + "ObjectType": 0 + }, + { + "Name": "[Sales].[StoreContact]", + "ObjectType": 0 + } + ], + "UiHint": "AdventureWorks (WebsiteFullTrust)", + "UseBoolPropertiesWithoutDefaultSql": false, + "UseDatabaseNames": true, + "UseDbContextSplitting": false, + "UseFluentApiOnly": false, + "UseHandleBars": false, + "UseHierarchyId": false, + "UseInflector": true, + "UseLegacyPluralizer": true, + "UseManyToManyEntity": false, + "UseNoConstructor": false, + "UseNoDefaultConstructor": false, + "UseNoNavigations": false, + "UseNoObjectFilter": false, + "UseNodaTime": false, + "UseNullableReferences": false, + "UseSchemaFolders": false, + "UseSpatial": false +} \ No newline at end of file diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs deleted file mode 100644 index 584755c92..000000000 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.cs +++ /dev/null @@ -1,18836 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using Microsoft.EntityFrameworkCore; -using System.Linq; -using System.Runtime.Serialization; -using System.Xml.Serialization; - -namespace AdventureWorksModelEFCore -{ - #region Contexts - - /// - /// No Metadata Documentation available. - /// - public partial class AdventureWorksEntities - { - #region Constructors - - /// - /// Initializes a new AdventureWorksEntities object using the connection string found in the 'AdventureWorksEntities' section of the application configuration file. - /// - public AdventureWorksEntities() - { - OnContextCreated(); - } - - /// - /// Initialize a new AdventureWorksEntities object. - /// - public AdventureWorksEntities(string connectionString) - { - OnContextCreated(); - } - - #endregion - - #region Partial Methods - - partial void OnContextCreated(); - - #endregion - } - - #endregion - - #region Entities - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Address - { - #region Factory Method - - /// - /// Create a new Address object. - /// - /// Initial value of the AddressID property. - /// Initial value of the AddressLine1 property. - /// Initial value of the City property. - /// Initial value of the StateProvinceID property. - /// Initial value of the PostalCode property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static Address CreateAddress(global::System.Int32 addressID, global::System.String addressLine1, global::System.String city, global::System.Int32 stateProvinceID, global::System.String postalCode, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - Address address = new Address(); - address.AddressID = addressID; - address.AddressLine1 = addressLine1; - address.City = city; - address.StateProvinceID = stateProvinceID; - address.PostalCode = postalCode; - address.rowguid = rowguid; - address.ModifiedDate = modifiedDate; - return address; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AddressID - { - get - { - return _AddressID; - } - set - { - if (_AddressID != value) - { - OnAddressIDChanging(value); - _AddressID = value; - OnAddressIDChanged(); - } - } - } - private global::System.Int32 _AddressID; - partial void OnAddressIDChanging(global::System.Int32 value); - partial void OnAddressIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String AddressLine1 - { - get - { - return _AddressLine1; - } - set - { - OnAddressLine1Changing(value); - OnAddressLine1Changed(); - } - } - private global::System.String _AddressLine1; - partial void OnAddressLine1Changing(global::System.String value); - partial void OnAddressLine1Changed(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String AddressLine2 - { - get - { - return _AddressLine2; - } - set - { - OnAddressLine2Changing(value); - _AddressLine2 = value; - OnAddressLine2Changed(); - } - } - private global::System.String _AddressLine2; - partial void OnAddressLine2Changing(global::System.String value); - partial void OnAddressLine2Changed(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String City - { - get - { - return _City; - } - set - { - OnCityChanging(value); - _City = value; - OnCityChanged(); - } - } - private global::System.String _City; - partial void OnCityChanging(global::System.String value); - partial void OnCityChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 StateProvinceID - { - get - { - return _StateProvinceID; - } - set - { - OnStateProvinceIDChanging(value); - _StateProvinceID = value; - OnStateProvinceIDChanged(); - } - } - private global::System.Int32 _StateProvinceID; - partial void OnStateProvinceIDChanging(global::System.Int32 value); - partial void OnStateProvinceIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String PostalCode - { - get - { - return _PostalCode; - } - set - { - OnPostalCodeChanging(value); - _PostalCode = value; - OnPostalCodeChanged(); - } - } - private global::System.String _PostalCode; - partial void OnPostalCodeChanging(global::System.String value); - partial void OnPostalCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection EmployeeAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "EmployeeAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "EmployeeAddress", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public StateProvince StateProvince - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference StateProvinceReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "StateProvince", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection CustomerAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "CustomerAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "CustomerAddress", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public IEntityCollection VendorAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "VendorAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "VendorAddress", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class AddressType - { - #region Factory Method - - /// - /// Create a new AddressType object. - /// - /// Initial value of the AddressTypeID property. - /// Initial value of the Name property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static AddressType CreateAddressType(global::System.Int32 addressTypeID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - AddressType addressType = new AddressType(); - addressType.AddressTypeID = addressTypeID; - addressType.Name = name; - addressType.rowguid = rowguid; - addressType.ModifiedDate = modifiedDate; - return addressType; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AddressTypeID - { - get - { - return _AddressTypeID; - } - set - { - if (_AddressTypeID != value) - { - OnAddressTypeIDChanging(value); - _AddressTypeID = value; - OnAddressTypeIDChanged(); - } - } - } - private global::System.Int32 _AddressTypeID; - partial void OnAddressTypeIDChanging(global::System.Int32 value); - partial void OnAddressTypeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection CustomerAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "CustomerAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "CustomerAddress", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection VendorAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "VendorAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "VendorAddress", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class AWBuildVersion - { - #region Factory Method - - /// - /// Create a new AWBuildVersion object. - /// - /// Initial value of the SystemInformationID property. - /// Initial value of the Database_Version property. - /// Initial value of the VersionDate property. - /// Initial value of the ModifiedDate property. - public static AWBuildVersion CreateAWBuildVersion(global::System.Byte systemInformationID, global::System.String database_Version, global::System.DateTime versionDate, global::System.DateTime modifiedDate) - { - AWBuildVersion aWBuildVersion = new AWBuildVersion(); - aWBuildVersion.SystemInformationID = systemInformationID; - aWBuildVersion.Database_Version = database_Version; - aWBuildVersion.VersionDate = versionDate; - aWBuildVersion.ModifiedDate = modifiedDate; - return aWBuildVersion; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte SystemInformationID - { - get - { - return _SystemInformationID; - } - set - { - if (_SystemInformationID != value) - { - OnSystemInformationIDChanging(value); - _SystemInformationID = value; - OnSystemInformationIDChanged(); - } - } - } - private global::System.Byte _SystemInformationID; - partial void OnSystemInformationIDChanging(global::System.Byte value); - partial void OnSystemInformationIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Database_Version - { - get - { - return _Database_Version; - } - set - { - OnDatabase_VersionChanging(value); - _Database_Version = value; - OnDatabase_VersionChanged(); - } - } - private global::System.String _Database_Version; - partial void OnDatabase_VersionChanging(global::System.String value); - partial void OnDatabase_VersionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime VersionDate - { - get - { - return _VersionDate; - } - set - { - OnVersionDateChanging(value); - _VersionDate = value; - OnVersionDateChanged(); - } - } - private global::System.DateTime _VersionDate; - partial void OnVersionDateChanging(global::System.DateTime value); - partial void OnVersionDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class BillOfMaterial - { - #region Factory Method - - /// - /// Create a new BillOfMaterial object. - /// - /// Initial value of the BillOfMaterialsID property. - /// Initial value of the ComponentID property. - /// Initial value of the StartDate property. - /// Initial value of the UnitMeasureCode property. - /// Initial value of the BOMLevel property. - /// Initial value of the PerAssemblyQty property. - /// Initial value of the ModifiedDate property. - public static BillOfMaterial CreateBillOfMaterial(global::System.Int32 billOfMaterialsID, global::System.Int32 componentID, global::System.DateTime startDate, global::System.String unitMeasureCode, global::System.Int16 bOMLevel, global::System.Decimal perAssemblyQty, global::System.DateTime modifiedDate) - { - BillOfMaterial billOfMaterial = new BillOfMaterial(); - billOfMaterial.BillOfMaterialsID = billOfMaterialsID; - billOfMaterial.ComponentID = componentID; - billOfMaterial.StartDate = startDate; - billOfMaterial.UnitMeasureCode = unitMeasureCode; - billOfMaterial.BOMLevel = bOMLevel; - billOfMaterial.PerAssemblyQty = perAssemblyQty; - billOfMaterial.ModifiedDate = modifiedDate; - return billOfMaterial; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 BillOfMaterialsID - { - get - { - return _BillOfMaterialsID; - } - set - { - if (_BillOfMaterialsID != value) - { - OnBillOfMaterialsIDChanging(value); - _BillOfMaterialsID = value; - OnBillOfMaterialsIDChanged(); - } - } - } - private global::System.Int32 _BillOfMaterialsID; - partial void OnBillOfMaterialsIDChanging(global::System.Int32 value); - partial void OnBillOfMaterialsIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ProductAssemblyID - { - get - { - return _ProductAssemblyID; - } - set - { - OnProductAssemblyIDChanging(value); - _ProductAssemblyID = value; - OnProductAssemblyIDChanged(); - } - } - private Nullable _ProductAssemblyID; - partial void OnProductAssemblyIDChanging(Nullable value); - partial void OnProductAssemblyIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ComponentID - { - get - { - return _ComponentID; - } - set - { - OnComponentIDChanging(value); - _ComponentID = value; - OnComponentIDChanged(); - } - } - private global::System.Int32 _ComponentID; - partial void OnComponentIDChanging(global::System.Int32 value); - partial void OnComponentIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartDate - { - get - { - return _StartDate; - } - set - { - OnStartDateChanging(value); - _StartDate = value; - OnStartDateChanged(); - } - } - private global::System.DateTime _StartDate; - partial void OnStartDateChanging(global::System.DateTime value); - partial void OnStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable EndDate - { - get - { - return _EndDate; - } - set - { - OnEndDateChanging(value); - _EndDate = value; - OnEndDateChanged(); - } - } - private Nullable _EndDate; - partial void OnEndDateChanging(Nullable value); - partial void OnEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String UnitMeasureCode - { - get - { - return _UnitMeasureCode; - } - set - { - OnUnitMeasureCodeChanging(value); - _UnitMeasureCode = value; - OnUnitMeasureCodeChanged(); - } - } - private global::System.String _UnitMeasureCode; - partial void OnUnitMeasureCodeChanging(global::System.String value); - partial void OnUnitMeasureCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 BOMLevel - { - get - { - return _BOMLevel; - } - set - { - OnBOMLevelChanging(value); - _BOMLevel = value; - OnBOMLevelChanged(); - } - } - private global::System.Int16 _BOMLevel; - partial void OnBOMLevelChanging(global::System.Int16 value); - partial void OnBOMLevelChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal PerAssemblyQty - { - get - { - return _PerAssemblyQty; - } - set - { - OnPerAssemblyQtyChanging(value); - _PerAssemblyQty = value; - OnPerAssemblyQtyChanged(); - } - } - private global::System.Decimal _PerAssemblyQty; - partial void OnPerAssemblyQtyChanging(global::System.Decimal value); - partial void OnPerAssemblyQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference Product1Reference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public UnitMeasure UnitMeasure - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference UnitMeasureReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "UnitMeasure", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Contact - { - #region Factory Method - - /// - /// Create a new Contact object. - /// - /// Initial value of the ContactID property. - /// Initial value of the NameStyle property. - /// Initial value of the FirstName property. - /// Initial value of the LastName property. - /// Initial value of the EmailPromotion property. - /// Initial value of the PasswordHash property. - /// Initial value of the PasswordSalt property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static Contact CreateContact(global::System.Int32 contactID, global::System.Boolean nameStyle, global::System.String firstName, global::System.String lastName, global::System.Int32 emailPromotion, global::System.String passwordHash, global::System.String passwordSalt, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - Contact contact = new Contact(); - contact.ContactID = contactID; - contact.NameStyle = nameStyle; - contact.FirstName = firstName; - contact.LastName = lastName; - contact.EmailPromotion = emailPromotion; - contact.PasswordHash = passwordHash; - contact.PasswordSalt = passwordSalt; - contact.rowguid = rowguid; - contact.ModifiedDate = modifiedDate; - return contact; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactID - { - get - { - return _ContactID; - } - set - { - if (_ContactID != value) - { - OnContactIDChanging(value); - _ContactID = value; - OnContactIDChanged(); - } - } - } - private global::System.Int32 _ContactID; - partial void OnContactIDChanging(global::System.Int32 value); - partial void OnContactIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean NameStyle - { - get - { - return _NameStyle; - } - set - { - OnNameStyleChanging(value); - _NameStyle = value; - OnNameStyleChanged(); - } - } - private global::System.Boolean _NameStyle; - partial void OnNameStyleChanging(global::System.Boolean value); - partial void OnNameStyleChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Title - { - get - { - return _Title; - } - set - { - OnTitleChanging(value); - _Title = value; - OnTitleChanged(); - } - } - private global::System.String _Title; - partial void OnTitleChanging(global::System.String value); - partial void OnTitleChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String FirstName - { - get - { - return _FirstName; - } - set - { - OnFirstNameChanging(value); - _FirstName = value; - OnFirstNameChanged(); - } - } - private global::System.String _FirstName; - partial void OnFirstNameChanging(global::System.String value); - partial void OnFirstNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String MiddleName - { - get - { - return _MiddleName; - } - set - { - OnMiddleNameChanging(value); - _MiddleName = value; - OnMiddleNameChanged(); - } - } - private global::System.String _MiddleName; - partial void OnMiddleNameChanging(global::System.String value); - partial void OnMiddleNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String LastName - { - get - { - return _LastName; - } - set - { - OnLastNameChanging(value); - _LastName = value; - OnLastNameChanged(); - } - } - private global::System.String _LastName; - partial void OnLastNameChanging(global::System.String value); - partial void OnLastNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Suffix - { - get - { - return _Suffix; - } - set - { - OnSuffixChanging(value); - _Suffix = value; - OnSuffixChanged(); - } - } - private global::System.String _Suffix; - partial void OnSuffixChanging(global::System.String value); - partial void OnSuffixChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String EmailAddress - { - get - { - return _EmailAddress; - } - set - { - OnEmailAddressChanging(value); - _EmailAddress = value; - OnEmailAddressChanged(); - } - } - private global::System.String _EmailAddress; - partial void OnEmailAddressChanging(global::System.String value); - partial void OnEmailAddressChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 EmailPromotion - { - get - { - return _EmailPromotion; - } - set - { - OnEmailPromotionChanging(value); - _EmailPromotion = value; - OnEmailPromotionChanged(); - } - } - private global::System.Int32 _EmailPromotion; - partial void OnEmailPromotionChanging(global::System.Int32 value); - partial void OnEmailPromotionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Phone - { - get - { - return _Phone; - } - set - { - OnPhoneChanging(value); - _Phone = value; - OnPhoneChanged(); - } - } - private global::System.String _Phone; - partial void OnPhoneChanging(global::System.String value); - partial void OnPhoneChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String PasswordHash - { - get - { - return _PasswordHash; - } - set - { - OnPasswordHashChanging(value); - _PasswordHash = value; - OnPasswordHashChanged(); - } - } - private global::System.String _PasswordHash; - partial void OnPasswordHashChanging(global::System.String value); - partial void OnPasswordHashChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String PasswordSalt - { - get - { - return _PasswordSalt; - } - set - { - OnPasswordSaltChanging(value); - _PasswordSalt = value; - OnPasswordSaltChanged(); - } - } - private global::System.String _PasswordSalt; - partial void OnPasswordSaltChanging(global::System.String value); - partial void OnPasswordSaltChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String AdditionalContactInfo - { - get - { - return _AdditionalContactInfo; - } - set - { - OnAdditionalContactInfoChanging(value); - _AdditionalContactInfo = value; - OnAdditionalContactInfoChanged(); - } - } - private global::System.String _AdditionalContactInfo; - partial void OnAdditionalContactInfoChanging(global::System.String value); - partial void OnAdditionalContactInfoChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Employees - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Employee_Contact_ContactID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Employee_Contact_ContactID", "Employee", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ContactCreditCards - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "ContactCreditCard"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "ContactCreditCard", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Individuals - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Individual_Contact_ContactID", "Individual"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Individual_Contact_ContactID", "Individual", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection StoreContacts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "StoreContact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "StoreContact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection VendorContacts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "VendorContact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "VendorContact", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ContactCreditCard - { - #region Factory Method - - /// - /// Create a new ContactCreditCard object. - /// - /// Initial value of the ContactID property. - /// Initial value of the CreditCardID property. - /// Initial value of the ModifiedDate property. - public static ContactCreditCard CreateContactCreditCard(global::System.Int32 contactID, global::System.Int32 creditCardID, global::System.DateTime modifiedDate) - { - ContactCreditCard contactCreditCard = new ContactCreditCard(); - contactCreditCard.ContactID = contactID; - contactCreditCard.CreditCardID = creditCardID; - contactCreditCard.ModifiedDate = modifiedDate; - return contactCreditCard; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactID - { - get - { - return _ContactID; - } - set - { - if (_ContactID != value) - { - OnContactIDChanging(value); - _ContactID = value; - OnContactIDChanged(); - } - } - } - private global::System.Int32 _ContactID; - partial void OnContactIDChanging(global::System.Int32 value); - partial void OnContactIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CreditCardID - { - get - { - return _CreditCardID; - } - set - { - if (_CreditCardID != value) - { - OnCreditCardIDChanging(value); - _CreditCardID = value; - OnCreditCardIDChanged(); - } - } - } - private global::System.Int32 _CreditCardID; - partial void OnCreditCardIDChanging(global::System.Int32 value); - partial void OnCreditCardIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Contact Contact - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ContactCreditCard_Contact_ContactID", "Contact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public CreditCard CreditCard - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CreditCardReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "CreditCard", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ContactType - { - #region Factory Method - - /// - /// Create a new ContactType object. - /// - /// Initial value of the ContactTypeID property. - /// Initial value of the Name property. - /// Initial value of the ModifiedDate property. - public static ContactType CreateContactType(global::System.Int32 contactTypeID, global::System.String name, global::System.DateTime modifiedDate) - { - ContactType contactType = new ContactType(); - contactType.ContactTypeID = contactTypeID; - contactType.Name = name; - contactType.ModifiedDate = modifiedDate; - return contactType; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactTypeID - { - get - { - return _ContactTypeID; - } - set - { - if (_ContactTypeID != value) - { - OnContactTypeIDChanging(value); - _ContactTypeID = value; - OnContactTypeIDChanged(); - } - } - } - private global::System.Int32 _ContactTypeID; - partial void OnContactTypeIDChanging(global::System.Int32 value); - partial void OnContactTypeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection StoreContacts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "StoreContact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "StoreContact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection VendorContacts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "VendorContact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "VendorContact", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class CountryRegion - { - #region Factory Method - - /// - /// Create a new CountryRegion object. - /// - /// Initial value of the CountryRegionCode property. - /// Initial value of the Name property. - /// Initial value of the ModifiedDate property. - public static CountryRegion CreateCountryRegion(global::System.String countryRegionCode, global::System.String name, global::System.DateTime modifiedDate) - { - CountryRegion countryRegion = new CountryRegion(); - countryRegion.CountryRegionCode = countryRegionCode; - countryRegion.Name = name; - countryRegion.ModifiedDate = modifiedDate; - return countryRegion; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CountryRegionCode - { - get - { - return _CountryRegionCode; - } - set - { - if (_CountryRegionCode != value) - { - OnCountryRegionCodeChanging(value); - _CountryRegionCode = value; - OnCountryRegionCodeChanged(); - } - } - } - private global::System.String _CountryRegionCode; - partial void OnCountryRegionCodeChanging(global::System.String value); - partial void OnCountryRegionCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection CountryRegionCurrencies - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegionCurrency"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegionCurrency", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection StateProvinces - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "StateProvince"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "StateProvince", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class CountryRegionCurrency - { - #region Factory Method - - /// - /// Create a new CountryRegionCurrency object. - /// - /// Initial value of the CountryRegionCode property. - /// Initial value of the CurrencyCode property. - /// Initial value of the ModifiedDate property. - public static CountryRegionCurrency CreateCountryRegionCurrency(global::System.String countryRegionCode, global::System.String currencyCode, global::System.DateTime modifiedDate) - { - CountryRegionCurrency countryRegionCurrency = new CountryRegionCurrency(); - countryRegionCurrency.CountryRegionCode = countryRegionCode; - countryRegionCurrency.CurrencyCode = currencyCode; - countryRegionCurrency.ModifiedDate = modifiedDate; - return countryRegionCurrency; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CountryRegionCode - { - get - { - return _CountryRegionCode; - } - set - { - if (_CountryRegionCode != value) - { - OnCountryRegionCodeChanging(value); - _CountryRegionCode = value; - OnCountryRegionCodeChanged(); - } - } - } - private global::System.String _CountryRegionCode; - partial void OnCountryRegionCodeChanging(global::System.String value); - partial void OnCountryRegionCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CurrencyCode - { - get - { - return _CurrencyCode; - } - set - { - if (_CurrencyCode != value) - { - OnCurrencyCodeChanging(value); - _CurrencyCode = value; - OnCurrencyCodeChanged(); - } - } - } - private global::System.String _CurrencyCode; - partial void OnCurrencyCodeChanging(global::System.String value); - partial void OnCurrencyCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public CountryRegion CountryRegion - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CountryRegionReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_CountryRegion_CountryRegionCode", "CountryRegion", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Currency Currency - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CurrencyReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "Currency", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class CreditCard - { - #region Factory Method - - /// - /// Create a new CreditCard object. - /// - /// Initial value of the CreditCardID property. - /// Initial value of the CardType property. - /// Initial value of the CardNumber property. - /// Initial value of the ExpMonth property. - /// Initial value of the ExpYear property. - /// Initial value of the ModifiedDate property. - public static CreditCard CreateCreditCard(global::System.Int32 creditCardID, global::System.String cardType, global::System.String cardNumber, global::System.Byte expMonth, global::System.Int16 expYear, global::System.DateTime modifiedDate) - { - CreditCard creditCard = new CreditCard(); - creditCard.CreditCardID = creditCardID; - creditCard.CardType = cardType; - creditCard.CardNumber = cardNumber; - creditCard.ExpMonth = expMonth; - creditCard.ExpYear = expYear; - creditCard.ModifiedDate = modifiedDate; - return creditCard; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CreditCardID - { - get - { - return _CreditCardID; - } - set - { - if (_CreditCardID != value) - { - OnCreditCardIDChanging(value); - _CreditCardID = value; - OnCreditCardIDChanged(); - } - } - } - private global::System.Int32 _CreditCardID; - partial void OnCreditCardIDChanging(global::System.Int32 value); - partial void OnCreditCardIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CardType - { - get - { - return _CardType; - } - set - { - OnCardTypeChanging(value); - _CardType = value; - OnCardTypeChanged(); - } - } - private global::System.String _CardType; - partial void OnCardTypeChanging(global::System.String value); - partial void OnCardTypeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CardNumber - { - get - { - return _CardNumber; - } - set - { - OnCardNumberChanging(value); - _CardNumber = value; - OnCardNumberChanged(); - } - } - private global::System.String _CardNumber; - partial void OnCardNumberChanging(global::System.String value); - partial void OnCardNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte ExpMonth - { - get - { - return _ExpMonth; - } - set - { - OnExpMonthChanging(value); - _ExpMonth = value; - OnExpMonthChanged(); - } - } - private global::System.Byte _ExpMonth; - partial void OnExpMonthChanging(global::System.Byte value); - partial void OnExpMonthChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 ExpYear - { - get - { - return _ExpYear; - } - set - { - OnExpYearChanging(value); - _ExpYear = value; - OnExpYearChanged(); - } - } - private global::System.Int16 _ExpYear; - partial void OnExpYearChanging(global::System.Int16 value); - partial void OnExpYearChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ContactCreditCards - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "ContactCreditCard"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ContactCreditCard_CreditCard_CreditCardID", "ContactCreditCard", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "SalesOrderHeader", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Culture - { - #region Factory Method - - /// - /// Create a new Culture object. - /// - /// Initial value of the CultureID property. - /// Initial value of the Name property. - /// Initial value of the ModifiedDate property. - public static Culture CreateCulture(global::System.String cultureID, global::System.String name, global::System.DateTime modifiedDate) - { - Culture culture = new Culture(); - culture.CultureID = cultureID; - culture.Name = name; - culture.ModifiedDate = modifiedDate; - return culture; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CultureID - { - get - { - return _CultureID; - } - set - { - if (_CultureID != value) - { - OnCultureIDChanging(value); - _CultureID = value; - OnCultureIDChanged(); - } - } - } - private global::System.String _CultureID; - partial void OnCultureIDChanging(global::System.String value); - partial void OnCultureIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductModelProductDescriptionCultures - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "ProductModelProductDescriptionCulture"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "ProductModelProductDescriptionCulture", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Currency - { - #region Factory Method - - /// - /// Create a new Currency object. - /// - /// Initial value of the CurrencyCode property. - /// Initial value of the Name property. - /// Initial value of the ModifiedDate property. - public static Currency CreateCurrency(global::System.String currencyCode, global::System.String name, global::System.DateTime modifiedDate) - { - Currency currency = new Currency(); - currency.CurrencyCode = currencyCode; - currency.Name = name; - currency.ModifiedDate = modifiedDate; - return currency; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CurrencyCode - { - get - { - return _CurrencyCode; - } - set - { - if (_CurrencyCode != value) - { - OnCurrencyCodeChanging(value); - _CurrencyCode = value; - OnCurrencyCodeChanged(); - } - } - } - private global::System.String _CurrencyCode; - partial void OnCurrencyCodeChanging(global::System.String value); - partial void OnCurrencyCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection CountryRegionCurrencies - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "CountryRegionCurrency"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CountryRegionCurrency_Currency_CurrencyCode", "CountryRegionCurrency", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection CurrencyRates - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "CurrencyRate"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "CurrencyRate", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection CurrencyRates1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "CurrencyRate"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "CurrencyRate", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class CurrencyRate - { - #region Factory Method - - /// - /// Create a new CurrencyRate object. - /// - /// Initial value of the CurrencyRateID property. - /// Initial value of the CurrencyRateDate property. - /// Initial value of the FromCurrencyCode property. - /// Initial value of the ToCurrencyCode property. - /// Initial value of the AverageRate property. - /// Initial value of the EndOfDayRate property. - /// Initial value of the ModifiedDate property. - public static CurrencyRate CreateCurrencyRate(global::System.Int32 currencyRateID, global::System.DateTime currencyRateDate, global::System.String fromCurrencyCode, global::System.String toCurrencyCode, global::System.Decimal averageRate, global::System.Decimal endOfDayRate, global::System.DateTime modifiedDate) - { - CurrencyRate currencyRate = new CurrencyRate(); - currencyRate.CurrencyRateID = currencyRateID; - currencyRate.CurrencyRateDate = currencyRateDate; - currencyRate.FromCurrencyCode = fromCurrencyCode; - currencyRate.ToCurrencyCode = toCurrencyCode; - currencyRate.AverageRate = averageRate; - currencyRate.EndOfDayRate = endOfDayRate; - currencyRate.ModifiedDate = modifiedDate; - return currencyRate; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CurrencyRateID - { - get - { - return _CurrencyRateID; - } - set - { - if (_CurrencyRateID != value) - { - OnCurrencyRateIDChanging(value); - _CurrencyRateID = value; - OnCurrencyRateIDChanged(); - } - } - } - private global::System.Int32 _CurrencyRateID; - partial void OnCurrencyRateIDChanging(global::System.Int32 value); - partial void OnCurrencyRateIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime CurrencyRateDate - { - get - { - return _CurrencyRateDate; - } - set - { - OnCurrencyRateDateChanging(value); - _CurrencyRateDate = value; - OnCurrencyRateDateChanged(); - } - } - private global::System.DateTime _CurrencyRateDate; - partial void OnCurrencyRateDateChanging(global::System.DateTime value); - partial void OnCurrencyRateDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String FromCurrencyCode - { - get - { - return _FromCurrencyCode; - } - set - { - OnFromCurrencyCodeChanging(value); - _FromCurrencyCode = value; - OnFromCurrencyCodeChanged(); - } - } - private global::System.String _FromCurrencyCode; - partial void OnFromCurrencyCodeChanging(global::System.String value); - partial void OnFromCurrencyCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ToCurrencyCode - { - get - { - return _ToCurrencyCode; - } - set - { - OnToCurrencyCodeChanging(value); - _ToCurrencyCode = value; - OnToCurrencyCodeChanged(); - } - } - private global::System.String _ToCurrencyCode; - partial void OnToCurrencyCodeChanging(global::System.String value); - partial void OnToCurrencyCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal AverageRate - { - get - { - return _AverageRate; - } - set - { - OnAverageRateChanging(value); - _AverageRate = value; - OnAverageRateChanged(); - } - } - private global::System.Decimal _AverageRate; - partial void OnAverageRateChanging(global::System.Decimal value); - partial void OnAverageRateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal EndOfDayRate - { - get - { - return _EndOfDayRate; - } - set - { - OnEndOfDayRateChanging(value); - _EndOfDayRate = value; - OnEndOfDayRateChanged(); - } - } - private global::System.Decimal _EndOfDayRate; - partial void OnEndOfDayRateChanging(global::System.Decimal value); - partial void OnEndOfDayRateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Currency Currency - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CurrencyReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_FromCurrencyCode", "Currency", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Currency Currency1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference Currency1Reference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CurrencyRate_Currency_ToCurrencyCode", "Currency", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "SalesOrderHeader", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Customer - { - #region Factory Method - - /// - /// Create a new Customer object. - /// - /// Initial value of the CustomerID property. - /// Initial value of the AccountNumber property. - /// Initial value of the CustomerType property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static Customer CreateCustomer(global::System.Int32 customerID, global::System.String accountNumber, global::System.String customerType, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - Customer customer = new Customer(); - customer.CustomerID = customerID; - customer.AccountNumber = accountNumber; - customer.CustomerType = customerType; - customer.rowguid = rowguid; - customer.ModifiedDate = modifiedDate; - return customer; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CustomerID - { - get - { - return _CustomerID; - } - set - { - if (_CustomerID != value) - { - OnCustomerIDChanging(value); - _CustomerID = value; - OnCustomerIDChanged(); - } - } - } - private global::System.Int32 _CustomerID; - partial void OnCustomerIDChanging(global::System.Int32 value); - partial void OnCustomerIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable TerritoryID - { - get - { - return _TerritoryID; - } - set - { - OnTerritoryIDChanging(value); - _TerritoryID = value; - OnTerritoryIDChanged(); - } - } - private Nullable _TerritoryID; - partial void OnTerritoryIDChanging(Nullable value); - partial void OnTerritoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String AccountNumber - { - get - { - return _AccountNumber; - } - set - { - OnAccountNumberChanging(value); - _AccountNumber = value; - OnAccountNumberChanged(); - } - } - private global::System.String _AccountNumber; - partial void OnAccountNumberChanging(global::System.String value); - partial void OnAccountNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CustomerType - { - get - { - return _CustomerType; - } - set - { - OnCustomerTypeChanging(value); - _CustomerType = value; - OnCustomerTypeChanged(); - } - } - private global::System.String _CustomerType; - partial void OnCustomerTypeChanging(global::System.String value); - partial void OnCustomerTypeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesTerritory SalesTerritory - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesTerritoryReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "SalesTerritory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection CustomerAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "CustomerAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "CustomerAddress", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Individual Individual - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference IndividualReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Individual", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Store Store - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference StoreReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Store", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class CustomerAddress - { - #region Factory Method - - /// - /// Create a new CustomerAddress object. - /// - /// Initial value of the CustomerID property. - /// Initial value of the AddressID property. - /// Initial value of the AddressTypeID property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static CustomerAddress CreateCustomerAddress(global::System.Int32 customerID, global::System.Int32 addressID, global::System.Int32 addressTypeID, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - CustomerAddress customerAddress = new CustomerAddress(); - customerAddress.CustomerID = customerID; - customerAddress.AddressID = addressID; - customerAddress.AddressTypeID = addressTypeID; - customerAddress.rowguid = rowguid; - customerAddress.ModifiedDate = modifiedDate; - return customerAddress; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CustomerID - { - get - { - return _CustomerID; - } - set - { - if (_CustomerID != value) - { - OnCustomerIDChanging(value); - _CustomerID = value; - OnCustomerIDChanged(); - } - } - } - private global::System.Int32 _CustomerID; - partial void OnCustomerIDChanging(global::System.Int32 value); - partial void OnCustomerIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AddressID - { - get - { - return _AddressID; - } - set - { - if (_AddressID != value) - { - OnAddressIDChanging(value); - _AddressID = value; - OnAddressIDChanged(); - } - } - } - private global::System.Int32 _AddressID; - partial void OnAddressIDChanging(global::System.Int32 value); - partial void OnAddressIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AddressTypeID - { - get - { - return _AddressTypeID; - } - set - { - OnAddressTypeIDChanging(value); - _AddressTypeID = value; - OnAddressTypeIDChanged(); - } - } - private global::System.Int32 _AddressTypeID; - partial void OnAddressTypeIDChanging(global::System.Int32 value); - partial void OnAddressTypeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Address Address - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference
AddressReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_CustomerAddress_Address_AddressID", "Address", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public AddressType AddressType - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference AddressTypeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CustomerAddress_AddressType_AddressTypeID", "AddressType", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Customer Customer - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CustomerReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_CustomerAddress_Customer_CustomerID", "Customer", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class DatabaseLog - { - #region Factory Method - - /// - /// Create a new DatabaseLog object. - /// - /// Initial value of the DatabaseLogID property. - /// Initial value of the PostTime property. - /// Initial value of the DatabaseUser property. - /// Initial value of the Event property. - /// Initial value of the TSQL property. - /// Initial value of the XmlEvent property. - public static DatabaseLog CreateDatabaseLog(global::System.Int32 databaseLogID, global::System.DateTime postTime, global::System.String databaseUser, global::System.String @event, global::System.String tSQL, global::System.String xmlEvent) - { - DatabaseLog databaseLog = new DatabaseLog(); - databaseLog.DatabaseLogID = databaseLogID; - databaseLog.PostTime = postTime; - databaseLog.DatabaseUser = databaseUser; - databaseLog.Event = @event; - databaseLog.TSQL = tSQL; - databaseLog.XmlEvent = xmlEvent; - return databaseLog; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 DatabaseLogID - { - get - { - return _DatabaseLogID; - } - set - { - if (_DatabaseLogID != value) - { - OnDatabaseLogIDChanging(value); - _DatabaseLogID = value; - OnDatabaseLogIDChanged(); - } - } - } - private global::System.Int32 _DatabaseLogID; - partial void OnDatabaseLogIDChanging(global::System.Int32 value); - partial void OnDatabaseLogIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime PostTime - { - get - { - return _PostTime; - } - set - { - OnPostTimeChanging(value); - _PostTime = value; - OnPostTimeChanged(); - } - } - private global::System.DateTime _PostTime; - partial void OnPostTimeChanging(global::System.DateTime value); - partial void OnPostTimeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String DatabaseUser - { - get - { - return _DatabaseUser; - } - set - { - OnDatabaseUserChanging(value); - _DatabaseUser = value; - OnDatabaseUserChanged(); - } - } - private global::System.String _DatabaseUser; - partial void OnDatabaseUserChanging(global::System.String value); - partial void OnDatabaseUserChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Event - { - get - { - return _Event; - } - set - { - OnEventChanging(value); - _Event = value; - OnEventChanged(); - } - } - private global::System.String _Event; - partial void OnEventChanging(global::System.String value); - partial void OnEventChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Schema - { - get - { - return _Schema; - } - set - { - OnSchemaChanging(value); - _Schema = value; - OnSchemaChanged(); - } - } - private global::System.String _Schema; - partial void OnSchemaChanging(global::System.String value); - partial void OnSchemaChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Object - { - get - { - return _Object; - } - set - { - OnObjectChanging(value); - _Object = value; - OnObjectChanged(); - } - } - private global::System.String _Object; - partial void OnObjectChanging(global::System.String value); - partial void OnObjectChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String TSQL - { - get - { - return _TSQL; - } - set - { - OnTSQLChanging(value); - _TSQL = value; - OnTSQLChanged(); - } - } - private global::System.String _TSQL; - partial void OnTSQLChanging(global::System.String value); - partial void OnTSQLChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String XmlEvent - { - get - { - return _XmlEvent; - } - set - { - OnXmlEventChanging(value); - _XmlEvent = value; - OnXmlEventChanged(); - } - } - private global::System.String _XmlEvent; - partial void OnXmlEventChanging(global::System.String value); - partial void OnXmlEventChanged(); - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Department - { - #region Factory Method - - /// - /// Create a new Department object. - /// - /// Initial value of the DepartmentID property. - /// Initial value of the Name property. - /// Initial value of the GroupName property. - /// Initial value of the ModifiedDate property. - public static Department CreateDepartment(global::System.Int16 departmentID, global::System.String name, global::System.String groupName, global::System.DateTime modifiedDate) - { - Department department = new Department(); - department.DepartmentID = departmentID; - department.Name = name; - department.GroupName = groupName; - department.ModifiedDate = modifiedDate; - return department; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 DepartmentID - { - get - { - return _DepartmentID; - } - set - { - if (_DepartmentID != value) - { - OnDepartmentIDChanging(value); - _DepartmentID = value; - OnDepartmentIDChanged(); - } - } - } - private global::System.Int16 _DepartmentID; - partial void OnDepartmentIDChanging(global::System.Int16 value); - partial void OnDepartmentIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String GroupName - { - get - { - return _GroupName; - } - set - { - OnGroupNameChanging(value); - _GroupName = value; - OnGroupNameChanged(); - } - } - private global::System.String _GroupName; - partial void OnGroupNameChanging(global::System.String value); - partial void OnGroupNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection EmployeeDepartmentHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "EmployeeDepartmentHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "EmployeeDepartmentHistory", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Document - { - #region Factory Method - - /// - /// Create a new Document object. - /// - /// Initial value of the DocumentID property. - /// Initial value of the Title property. - /// Initial value of the FileName property. - /// Initial value of the FileExtension property. - /// Initial value of the Revision property. - /// Initial value of the ChangeNumber property. - /// Initial value of the Status property. - /// Initial value of the ModifiedDate property. - public static Document CreateDocument(global::System.Int32 documentID, global::System.String title, global::System.String fileName, global::System.String fileExtension, global::System.String revision, global::System.Int32 changeNumber, global::System.Byte status, global::System.DateTime modifiedDate) - { - Document document = new Document(); - document.DocumentID = documentID; - document.Title = title; - document.FileName = fileName; - document.FileExtension = fileExtension; - document.Revision = revision; - document.ChangeNumber = changeNumber; - document.Status = status; - document.ModifiedDate = modifiedDate; - return document; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 DocumentID - { - get - { - return _DocumentID; - } - set - { - if (_DocumentID != value) - { - OnDocumentIDChanging(value); - _DocumentID = value; - OnDocumentIDChanged(); - } - } - } - private global::System.Int32 _DocumentID; - partial void OnDocumentIDChanging(global::System.Int32 value); - partial void OnDocumentIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Title - { - get - { - return _Title; - } - set - { - OnTitleChanging(value); - _Title = value; - OnTitleChanged(); - } - } - private global::System.String _Title; - partial void OnTitleChanging(global::System.String value); - partial void OnTitleChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String FileName - { - get - { - return _FileName; - } - set - { - OnFileNameChanging(value); - _FileName = value; - OnFileNameChanged(); - } - } - private global::System.String _FileName; - partial void OnFileNameChanging(global::System.String value); - partial void OnFileNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String FileExtension - { - get - { - return _FileExtension; - } - set - { - OnFileExtensionChanging(value); - _FileExtension = value; - OnFileExtensionChanged(); - } - } - private global::System.String _FileExtension; - partial void OnFileExtensionChanging(global::System.String value); - partial void OnFileExtensionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Revision - { - get - { - return _Revision; - } - set - { - OnRevisionChanging(value); - _Revision = value; - OnRevisionChanged(); - } - } - private global::System.String _Revision; - partial void OnRevisionChanging(global::System.String value); - partial void OnRevisionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ChangeNumber - { - get - { - return _ChangeNumber; - } - set - { - OnChangeNumberChanging(value); - _ChangeNumber = value; - OnChangeNumberChanged(); - } - } - private global::System.Int32 _ChangeNumber; - partial void OnChangeNumberChanging(global::System.Int32 value); - partial void OnChangeNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte Status - { - get - { - return _Status; - } - set - { - OnStatusChanging(value); - _Status = value; - OnStatusChanged(); - } - } - private global::System.Byte _Status; - partial void OnStatusChanging(global::System.Byte value); - partial void OnStatusChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String DocumentSummary - { - get - { - return _DocumentSummary; - } - set - { - OnDocumentSummaryChanging(value); - _DocumentSummary = value; - OnDocumentSummaryChanged(); - } - } - private global::System.String _DocumentSummary; - partial void OnDocumentSummaryChanging(global::System.String value); - partial void OnDocumentSummaryChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte[] Document1 - { - get - { - return value; - } - set - { - OnDocument1Changing(value); - _Document1 = value; - OnDocument1Changed(); - } - } - private global::System.Byte[] _Document1; - partial void OnDocument1Changing(global::System.Byte[] value); - partial void OnDocument1Changed(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductDocuments - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "ProductDocument"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "ProductDocument", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Employee - { - #region Factory Method - - /// - /// Create a new Employee object. - /// - /// Initial value of the EmployeeID property. - /// Initial value of the NationalIDNumber property. - /// Initial value of the ContactID property. - /// Initial value of the LoginID property. - /// Initial value of the Title property. - /// Initial value of the BirthDate property. - /// Initial value of the MaritalStatus property. - /// Initial value of the Gender property. - /// Initial value of the HireDate property. - /// Initial value of the SalariedFlag property. - /// Initial value of the VacationHours property. - /// Initial value of the SickLeaveHours property. - /// Initial value of the CurrentFlag property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static Employee CreateEmployee(global::System.Int32 employeeID, global::System.String nationalIDNumber, global::System.Int32 contactID, global::System.String loginID, global::System.String title, global::System.DateTime birthDate, global::System.String maritalStatus, global::System.String gender, global::System.DateTime hireDate, global::System.Boolean salariedFlag, global::System.Int16 vacationHours, global::System.Int16 sickLeaveHours, global::System.Boolean currentFlag, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - Employee employee = new Employee(); - employee.EmployeeID = employeeID; - employee.NationalIDNumber = nationalIDNumber; - employee.ContactID = contactID; - employee.LoginID = loginID; - employee.Title = title; - employee.BirthDate = birthDate; - employee.MaritalStatus = maritalStatus; - employee.Gender = gender; - employee.HireDate = hireDate; - employee.SalariedFlag = salariedFlag; - employee.VacationHours = vacationHours; - employee.SickLeaveHours = sickLeaveHours; - employee.CurrentFlag = currentFlag; - employee.rowguid = rowguid; - employee.ModifiedDate = modifiedDate; - return employee; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 EmployeeID - { - get - { - return _EmployeeID; - } - set - { - if (_EmployeeID != value) - { - OnEmployeeIDChanging(value); - _EmployeeID = value; - OnEmployeeIDChanged(); - } - } - } - private global::System.Int32 _EmployeeID; - partial void OnEmployeeIDChanging(global::System.Int32 value); - partial void OnEmployeeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String NationalIDNumber - { - get - { - return _NationalIDNumber; - } - set - { - OnNationalIDNumberChanging(value); - _NationalIDNumber = value; - OnNationalIDNumberChanged(); - } - } - private global::System.String _NationalIDNumber; - partial void OnNationalIDNumberChanging(global::System.String value); - partial void OnNationalIDNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactID - { - get - { - return _ContactID; - } - set - { - OnContactIDChanging(value); - _ContactID = value; - OnContactIDChanged(); - } - } - private global::System.Int32 _ContactID; - partial void OnContactIDChanging(global::System.Int32 value); - partial void OnContactIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String LoginID - { - get - { - return _LoginID; - } - set - { - OnLoginIDChanging(value); - _LoginID = value; - OnLoginIDChanged(); - } - } - private global::System.String _LoginID; - partial void OnLoginIDChanging(global::System.String value); - partial void OnLoginIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ManagerID - { - get - { - return _ManagerID; - } - set - { - OnManagerIDChanging(value); - _ManagerID = value; - OnManagerIDChanged(); - } - } - private Nullable _ManagerID; - partial void OnManagerIDChanging(Nullable value); - partial void OnManagerIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Title - { - get - { - return _Title; - } - set - { - OnTitleChanging(value); - _Title = value; - OnTitleChanged(); - } - } - private global::System.String _Title; - partial void OnTitleChanging(global::System.String value); - partial void OnTitleChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime BirthDate - { - get - { - return _BirthDate; - } - set - { - OnBirthDateChanging(value); - _BirthDate = value; - OnBirthDateChanged(); - } - } - private global::System.DateTime _BirthDate; - partial void OnBirthDateChanging(global::System.DateTime value); - partial void OnBirthDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String MaritalStatus - { - get - { - return _MaritalStatus; - } - set - { - OnMaritalStatusChanging(value); - _MaritalStatus = value; - OnMaritalStatusChanged(); - } - } - private global::System.String _MaritalStatus; - partial void OnMaritalStatusChanging(global::System.String value); - partial void OnMaritalStatusChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Gender - { - get - { - return _Gender; - } - set - { - OnGenderChanging(value); - _Gender = value; - OnGenderChanged(); - } - } - private global::System.String _Gender; - partial void OnGenderChanging(global::System.String value); - partial void OnGenderChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime HireDate - { - get - { - return _HireDate; - } - set - { - OnHireDateChanging(value); - _HireDate = value; - OnHireDateChanged(); - } - } - private global::System.DateTime _HireDate; - partial void OnHireDateChanging(global::System.DateTime value); - partial void OnHireDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean SalariedFlag - { - get - { - return _SalariedFlag; - } - set - { - OnSalariedFlagChanging(value); - _SalariedFlag = value; - OnSalariedFlagChanged(); - } - } - private global::System.Boolean _SalariedFlag; - partial void OnSalariedFlagChanging(global::System.Boolean value); - partial void OnSalariedFlagChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 VacationHours - { - get - { - return _VacationHours; - } - set - { - OnVacationHoursChanging(value); - _VacationHours = value; - OnVacationHoursChanged(); - } - } - private global::System.Int16 _VacationHours; - partial void OnVacationHoursChanging(global::System.Int16 value); - partial void OnVacationHoursChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 SickLeaveHours - { - get - { - return _SickLeaveHours; - } - set - { - OnSickLeaveHoursChanging(value); - _SickLeaveHours = value; - OnSickLeaveHoursChanged(); - } - } - private global::System.Int16 _SickLeaveHours; - partial void OnSickLeaveHoursChanging(global::System.Int16 value); - partial void OnSickLeaveHoursChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean CurrentFlag - { - get - { - return _CurrentFlag; - } - set - { - OnCurrentFlagChanging(value); - _CurrentFlag = value; - OnCurrentFlagChanged(); - } - } - private global::System.Boolean _CurrentFlag; - partial void OnCurrentFlagChanging(global::System.Boolean value); - partial void OnCurrentFlagChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Contact Contact - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Employee_Contact_ContactID", "Contact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Reports - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee1"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee1", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Employee Manager - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ManagerReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Employee_Employee_ManagerID", "Employee", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection EmployeeAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "EmployeeAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "EmployeeAddress", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection EmployeeDepartmentHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "EmployeeDepartmentHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "EmployeeDepartmentHistory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection EmployeePayHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "EmployeePayHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "EmployeePayHistory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection JobCandidates - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "JobCandidate"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "JobCandidate", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection PurchaseOrders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "PurchaseOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "PurchaseOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesPerson SalesPerson - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesPersonReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "SalesPerson", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class EmployeeAddress - { - #region Factory Method - - /// - /// Create a new EmployeeAddress object. - /// - /// Initial value of the EmployeeID property. - /// Initial value of the AddressID property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static EmployeeAddress CreateEmployeeAddress(global::System.Int32 employeeID, global::System.Int32 addressID, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - EmployeeAddress employeeAddress = new EmployeeAddress(); - employeeAddress.EmployeeID = employeeID; - employeeAddress.AddressID = addressID; - employeeAddress.rowguid = rowguid; - employeeAddress.ModifiedDate = modifiedDate; - return employeeAddress; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 EmployeeID - { - get - { - return _EmployeeID; - } - set - { - if (_EmployeeID != value) - { - OnEmployeeIDChanging(value); - _EmployeeID = value; - OnEmployeeIDChanged(); - } - } - } - private global::System.Int32 _EmployeeID; - partial void OnEmployeeIDChanging(global::System.Int32 value); - partial void OnEmployeeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AddressID - { - get - { - return _AddressID; - } - set - { - if (_AddressID != value) - { - OnAddressIDChanging(value); - _AddressID = value; - OnAddressIDChanged(); - } - } - } - private global::System.Int32 _AddressID; - partial void OnAddressIDChanging(global::System.Int32 value); - partial void OnAddressIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Employee Employee - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference EmployeeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeAddress_Employee_EmployeeID", "Employee", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Address Address - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference
AddressReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_EmployeeAddress_Address_AddressID", "Address", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class EmployeeDepartmentHistory - { - #region Factory Method - - /// - /// Create a new EmployeeDepartmentHistory object. - /// - /// Initial value of the EmployeeID property. - /// Initial value of the DepartmentID property. - /// Initial value of the ShiftID property. - /// Initial value of the StartDate property. - /// Initial value of the ModifiedDate property. - public static EmployeeDepartmentHistory CreateEmployeeDepartmentHistory(global::System.Int32 employeeID, global::System.Int16 departmentID, global::System.Byte shiftID, global::System.DateTime startDate, global::System.DateTime modifiedDate) - { - EmployeeDepartmentHistory employeeDepartmentHistory = new EmployeeDepartmentHistory(); - employeeDepartmentHistory.EmployeeID = employeeID; - employeeDepartmentHistory.DepartmentID = departmentID; - employeeDepartmentHistory.ShiftID = shiftID; - employeeDepartmentHistory.StartDate = startDate; - employeeDepartmentHistory.ModifiedDate = modifiedDate; - return employeeDepartmentHistory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 EmployeeID - { - get - { - return _EmployeeID; - } - set - { - if (_EmployeeID != value) - { - OnEmployeeIDChanging(value); - _EmployeeID = value; - OnEmployeeIDChanged(); - } - } - } - private global::System.Int32 _EmployeeID; - partial void OnEmployeeIDChanging(global::System.Int32 value); - partial void OnEmployeeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 DepartmentID - { - get - { - return _DepartmentID; - } - set - { - if (_DepartmentID != value) - { - OnDepartmentIDChanging(value); - _DepartmentID = value; - OnDepartmentIDChanged(); - } - } - } - private global::System.Int16 _DepartmentID; - partial void OnDepartmentIDChanging(global::System.Int16 value); - partial void OnDepartmentIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte ShiftID - { - get - { - return _ShiftID; - } - set - { - if (_ShiftID != value) - { - OnShiftIDChanging(value); - _ShiftID = value; - OnShiftIDChanged(); - } - } - } - private global::System.Byte _ShiftID; - partial void OnShiftIDChanging(global::System.Byte value); - partial void OnShiftIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartDate - { - get - { - return _StartDate; - } - set - { - if (_StartDate != value) - { - OnStartDateChanging(value); - _StartDate = value; - OnStartDateChanged(); - } - } - } - private global::System.DateTime _StartDate; - partial void OnStartDateChanging(global::System.DateTime value); - partial void OnStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable EndDate - { - get - { - return _EndDate; - } - set - { - OnEndDateChanging(value); - _EndDate = value; - OnEndDateChanged(); - } - } - private Nullable _EndDate; - partial void OnEndDateChanging(Nullable value); - partial void OnEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Department Department - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference DepartmentReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Department_DepartmentID", "Department", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Employee Employee - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference EmployeeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Employee_EmployeeID", "Employee", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Shift Shift - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ShiftReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "Shift", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class EmployeePayHistory - { - #region Factory Method - - /// - /// Create a new EmployeePayHistory object. - /// - /// Initial value of the EmployeeID property. - /// Initial value of the RateChangeDate property. - /// Initial value of the Rate property. - /// Initial value of the PayFrequency property. - /// Initial value of the ModifiedDate property. - public static EmployeePayHistory CreateEmployeePayHistory(global::System.Int32 employeeID, global::System.DateTime rateChangeDate, global::System.Decimal rate, global::System.Byte payFrequency, global::System.DateTime modifiedDate) - { - EmployeePayHistory employeePayHistory = new EmployeePayHistory(); - employeePayHistory.EmployeeID = employeeID; - employeePayHistory.RateChangeDate = rateChangeDate; - employeePayHistory.Rate = rate; - employeePayHistory.PayFrequency = payFrequency; - employeePayHistory.ModifiedDate = modifiedDate; - return employeePayHistory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 EmployeeID - { - get - { - return _EmployeeID; - } - set - { - if (_EmployeeID != value) - { - OnEmployeeIDChanging(value); - _EmployeeID = value; - OnEmployeeIDChanged(); - } - } - } - private global::System.Int32 _EmployeeID; - partial void OnEmployeeIDChanging(global::System.Int32 value); - partial void OnEmployeeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime RateChangeDate - { - get - { - return _RateChangeDate; - } - set - { - if (_RateChangeDate != value) - { - OnRateChangeDateChanging(value); - _RateChangeDate = value; - OnRateChangeDateChanged(); - } - } - } - private global::System.DateTime _RateChangeDate; - partial void OnRateChangeDateChanging(global::System.DateTime value); - partial void OnRateChangeDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal Rate - { - get - { - return _Rate; - } - set - { - OnRateChanging(value); - _Rate = value; - OnRateChanged(); - } - } - private global::System.Decimal _Rate; - partial void OnRateChanging(global::System.Decimal value); - partial void OnRateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte PayFrequency - { - get - { - return _PayFrequency; - } - set - { - OnPayFrequencyChanging(value); - _PayFrequency = value; - OnPayFrequencyChanged(); - } - } - private global::System.Byte _PayFrequency; - partial void OnPayFrequencyChanging(global::System.Byte value); - partial void OnPayFrequencyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Employee Employee - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference EmployeeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_EmployeePayHistory_Employee_EmployeeID", "Employee", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ErrorLog - { - #region Factory Method - - /// - /// Create a new ErrorLog object. - /// - /// Initial value of the ErrorLogID property. - /// Initial value of the ErrorTime property. - /// Initial value of the UserName property. - /// Initial value of the ErrorNumber property. - /// Initial value of the ErrorMessage property. - public static ErrorLog CreateErrorLog(global::System.Int32 errorLogID, global::System.DateTime errorTime, global::System.String userName, global::System.Int32 errorNumber, global::System.String errorMessage) - { - ErrorLog errorLog = new ErrorLog(); - errorLog.ErrorLogID = errorLogID; - errorLog.ErrorTime = errorTime; - errorLog.UserName = userName; - errorLog.ErrorNumber = errorNumber; - errorLog.ErrorMessage = errorMessage; - return errorLog; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ErrorLogID - { - get - { - return _ErrorLogID; - } - set - { - if (_ErrorLogID != value) - { - OnErrorLogIDChanging(value); - _ErrorLogID = value; - OnErrorLogIDChanged(); - } - } - } - private global::System.Int32 _ErrorLogID; - partial void OnErrorLogIDChanging(global::System.Int32 value); - partial void OnErrorLogIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ErrorTime - { - get - { - return _ErrorTime; - } - set - { - OnErrorTimeChanging(value); - _ErrorTime = value; - OnErrorTimeChanged(); - } - } - private global::System.DateTime _ErrorTime; - partial void OnErrorTimeChanging(global::System.DateTime value); - partial void OnErrorTimeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String UserName - { - get - { - return _UserName; - } - set - { - OnUserNameChanging(value); - _UserName = value; - OnUserNameChanged(); - } - } - private global::System.String _UserName; - partial void OnUserNameChanging(global::System.String value); - partial void OnUserNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ErrorNumber - { - get - { - return _ErrorNumber; - } - set - { - OnErrorNumberChanging(value); - _ErrorNumber = value; - OnErrorNumberChanged(); - } - } - private global::System.Int32 _ErrorNumber; - partial void OnErrorNumberChanging(global::System.Int32 value); - partial void OnErrorNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ErrorSeverity - { - get - { - return _ErrorSeverity; - } - set - { - OnErrorSeverityChanging(value); - _ErrorSeverity = value; - OnErrorSeverityChanged(); - } - } - private Nullable _ErrorSeverity; - partial void OnErrorSeverityChanging(Nullable value); - partial void OnErrorSeverityChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ErrorState - { - get - { - return _ErrorState; - } - set - { - OnErrorStateChanging(value); - _ErrorState = value; - OnErrorStateChanged(); - } - } - private Nullable _ErrorState; - partial void OnErrorStateChanging(Nullable value); - partial void OnErrorStateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ErrorProcedure - { - get - { - return _ErrorProcedure; - } - set - { - OnErrorProcedureChanging(value); - _ErrorProcedure = value; - OnErrorProcedureChanged(); - } - } - private global::System.String _ErrorProcedure; - partial void OnErrorProcedureChanging(global::System.String value); - partial void OnErrorProcedureChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ErrorLine - { - get - { - return _ErrorLine; - } - set - { - OnErrorLineChanging(value); - _ErrorLine = value; - OnErrorLineChanged(); - } - } - private Nullable _ErrorLine; - partial void OnErrorLineChanging(Nullable value); - partial void OnErrorLineChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ErrorMessage - { - get - { - return _ErrorMessage; - } - set - { - OnErrorMessageChanging(value); - _ErrorMessage = value; - OnErrorMessageChanged(); - } - } - private global::System.String _ErrorMessage; - partial void OnErrorMessageChanging(global::System.String value); - partial void OnErrorMessageChanged(); - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Illustration - { - #region Factory Method - - /// - /// Create a new Illustration object. - /// - /// Initial value of the IllustrationID property. - /// Initial value of the ModifiedDate property. - public static Illustration CreateIllustration(global::System.Int32 illustrationID, global::System.DateTime modifiedDate) - { - Illustration illustration = new Illustration(); - illustration.IllustrationID = illustrationID; - illustration.ModifiedDate = modifiedDate; - return illustration; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 IllustrationID - { - get - { - return _IllustrationID; - } - set - { - if (_IllustrationID != value) - { - OnIllustrationIDChanging(value); - _IllustrationID = value; - OnIllustrationIDChanged(); - } - } - } - private global::System.Int32 _IllustrationID; - partial void OnIllustrationIDChanging(global::System.Int32 value); - partial void OnIllustrationIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Diagram - { - get - { - return _Diagram; - } - set - { - OnDiagramChanging(value); - _Diagram = value; - OnDiagramChanged(); - } - } - private global::System.String _Diagram; - partial void OnDiagramChanging(global::System.String value); - partial void OnDiagramChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductModelIllustrations - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "ProductModelIllustration"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "ProductModelIllustration", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Individual - { - #region Factory Method - - /// - /// Create a new Individual object. - /// - /// Initial value of the CustomerID property. - /// Initial value of the ContactID property. - /// Initial value of the ModifiedDate property. - public static Individual CreateIndividual(global::System.Int32 customerID, global::System.Int32 contactID, global::System.DateTime modifiedDate) - { - Individual individual = new Individual(); - individual.CustomerID = customerID; - individual.ContactID = contactID; - individual.ModifiedDate = modifiedDate; - return individual; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CustomerID - { - get - { - return _CustomerID; - } - set - { - if (_CustomerID != value) - { - OnCustomerIDChanging(value); - _CustomerID = value; - OnCustomerIDChanged(); - } - } - } - private global::System.Int32 _CustomerID; - partial void OnCustomerIDChanging(global::System.Int32 value); - partial void OnCustomerIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactID - { - get - { - return _ContactID; - } - set - { - OnContactIDChanging(value); - _ContactID = value; - OnContactIDChanged(); - } - } - private global::System.Int32 _ContactID; - partial void OnContactIDChanging(global::System.Int32 value); - partial void OnContactIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Demographics - { - get - { - return _Demographics; - } - set - { - OnDemographicsChanging(value); - _Demographics = value; - OnDemographicsChanged(); - } - } - private global::System.String _Demographics; - partial void OnDemographicsChanging(global::System.String value); - partial void OnDemographicsChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Contact Contact - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Individual_Contact_ContactID", "Contact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Customer Customer - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CustomerReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Individual_Customer_CustomerID", "Customer", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class JobCandidate - { - #region Factory Method - - /// - /// Create a new JobCandidate object. - /// - /// Initial value of the JobCandidateID property. - /// Initial value of the ModifiedDate property. - public static JobCandidate CreateJobCandidate(global::System.Int32 jobCandidateID, global::System.DateTime modifiedDate) - { - JobCandidate jobCandidate = new JobCandidate(); - jobCandidate.JobCandidateID = jobCandidateID; - jobCandidate.ModifiedDate = modifiedDate; - return jobCandidate; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 JobCandidateID - { - get - { - return _JobCandidateID; - } - set - { - if (_JobCandidateID != value) - { - OnJobCandidateIDChanging(value); - _JobCandidateID = value; - OnJobCandidateIDChanged(); - } - } - } - private global::System.Int32 _JobCandidateID; - partial void OnJobCandidateIDChanging(global::System.Int32 value); - partial void OnJobCandidateIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable EmployeeID - { - get - { - return _EmployeeID; - } - set - { - OnEmployeeIDChanging(value); - _EmployeeID = value; - OnEmployeeIDChanged(); - } - } - private Nullable _EmployeeID; - partial void OnEmployeeIDChanging(Nullable value); - partial void OnEmployeeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Resume - { - get - { - return _Resume; - } - set - { - OnResumeChanging(value); - _Resume = value; - OnResumeChanged(); - } - } - private global::System.String _Resume; - partial void OnResumeChanging(global::System.String value); - partial void OnResumeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Employee Employee - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference EmployeeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_JobCandidate_Employee_EmployeeID", "Employee", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Location - { - #region Factory Method - - /// - /// Create a new Location object. - /// - /// Initial value of the LocationID property. - /// Initial value of the Name property. - /// Initial value of the CostRate property. - /// Initial value of the Availability property. - /// Initial value of the ModifiedDate property. - public static Location CreateLocation(global::System.Int16 locationID, global::System.String name, global::System.Decimal costRate, global::System.Decimal availability, global::System.DateTime modifiedDate) - { - Location location = new Location(); - location.LocationID = locationID; - location.Name = name; - location.CostRate = costRate; - location.Availability = availability; - location.ModifiedDate = modifiedDate; - return location; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 LocationID - { - get - { - return _LocationID; - } - set - { - if (_LocationID != value) - { - OnLocationIDChanging(value); - _LocationID = value; - OnLocationIDChanged(); - } - } - } - private global::System.Int16 _LocationID; - partial void OnLocationIDChanging(global::System.Int16 value); - partial void OnLocationIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal CostRate - { - get - { - return _CostRate; - } - set - { - OnCostRateChanging(value); - _CostRate = value; - OnCostRateChanged(); - } - } - private global::System.Decimal _CostRate; - partial void OnCostRateChanging(global::System.Decimal value); - partial void OnCostRateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal Availability - { - get - { - return _Availability; - } - set - { - OnAvailabilityChanging(value); - _Availability = value; - OnAvailabilityChanged(); - } - } - private global::System.Decimal _Availability; - partial void OnAvailabilityChanging(global::System.Decimal value); - partial void OnAvailabilityChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductInventories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "ProductInventory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "ProductInventory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection WorkOrderRoutings - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "WorkOrderRouting"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "WorkOrderRouting", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Product - { - #region Factory Method - - /// - /// Create a new Product object. - /// - /// Initial value of the ProductID property. - /// Initial value of the Name property. - /// Initial value of the ProductNumber property. - /// Initial value of the MakeFlag property. - /// Initial value of the FinishedGoodsFlag property. - /// Initial value of the SafetyStockLevel property. - /// Initial value of the ReorderPoint property. - /// Initial value of the StandardCost property. - /// Initial value of the ListPrice property. - /// Initial value of the DaysToManufacture property. - /// Initial value of the SellStartDate property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static Product CreateProduct(global::System.Int32 productID, global::System.String name, global::System.String productNumber, global::System.Boolean makeFlag, global::System.Boolean finishedGoodsFlag, global::System.Int16 safetyStockLevel, global::System.Int16 reorderPoint, global::System.Decimal standardCost, global::System.Decimal listPrice, global::System.Int32 daysToManufacture, global::System.DateTime sellStartDate, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - Product product = new Product(); - product.ProductID = productID; - product.Name = name; - product.ProductNumber = productNumber; - product.MakeFlag = makeFlag; - product.FinishedGoodsFlag = finishedGoodsFlag; - product.SafetyStockLevel = safetyStockLevel; - product.ReorderPoint = reorderPoint; - product.StandardCost = standardCost; - product.ListPrice = listPrice; - product.DaysToManufacture = daysToManufacture; - product.SellStartDate = sellStartDate; - product.rowguid = rowguid; - product.ModifiedDate = modifiedDate; - return product; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ProductNumber - { - get - { - return _ProductNumber; - } - set - { - OnProductNumberChanging(value); - _ProductNumber = value; - OnProductNumberChanged(); - } - } - private global::System.String _ProductNumber; - partial void OnProductNumberChanging(global::System.String value); - partial void OnProductNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean MakeFlag - { - get - { - return _MakeFlag; - } - set - { - OnMakeFlagChanging(value); - _MakeFlag = value; - OnMakeFlagChanged(); - } - } - private global::System.Boolean _MakeFlag; - partial void OnMakeFlagChanging(global::System.Boolean value); - partial void OnMakeFlagChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean FinishedGoodsFlag - { - get - { - return _FinishedGoodsFlag; - } - set - { - OnFinishedGoodsFlagChanging(value); - _FinishedGoodsFlag = value; - OnFinishedGoodsFlagChanged(); - } - } - private global::System.Boolean _FinishedGoodsFlag; - partial void OnFinishedGoodsFlagChanging(global::System.Boolean value); - partial void OnFinishedGoodsFlagChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Color - { - get - { - return _Color; - } - set - { - OnColorChanging(value); - _Color = value; - OnColorChanged(); - } - } - private global::System.String _Color; - partial void OnColorChanging(global::System.String value); - partial void OnColorChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 SafetyStockLevel - { - get - { - return _SafetyStockLevel; - } - set - { - OnSafetyStockLevelChanging(value); - _SafetyStockLevel = value; - OnSafetyStockLevelChanged(); - } - } - private global::System.Int16 _SafetyStockLevel; - partial void OnSafetyStockLevelChanging(global::System.Int16 value); - partial void OnSafetyStockLevelChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 ReorderPoint - { - get - { - return _ReorderPoint; - } - set - { - OnReorderPointChanging(value); - _ReorderPoint = value; - OnReorderPointChanged(); - } - } - private global::System.Int16 _ReorderPoint; - partial void OnReorderPointChanging(global::System.Int16 value); - partial void OnReorderPointChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal StandardCost - { - get - { - return _StandardCost; - } - set - { - OnStandardCostChanging(value); - _StandardCost = value; - OnStandardCostChanged(); - } - } - private global::System.Decimal _StandardCost; - partial void OnStandardCostChanging(global::System.Decimal value); - partial void OnStandardCostChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal ListPrice - { - get - { - return _ListPrice; - } - set - { - OnListPriceChanging(value); - _ListPrice = value; - OnListPriceChanged(); - } - } - private global::System.Decimal _ListPrice; - partial void OnListPriceChanging(global::System.Decimal value); - partial void OnListPriceChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Size - { - get - { - return _Size; - } - set - { - OnSizeChanging(value); - _Size = value; - OnSizeChanged(); - } - } - private global::System.String _Size; - partial void OnSizeChanging(global::System.String value); - partial void OnSizeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String SizeUnitMeasureCode - { - get - { - return _SizeUnitMeasureCode; - } - set - { - OnSizeUnitMeasureCodeChanging(value); - _SizeUnitMeasureCode = value; - OnSizeUnitMeasureCodeChanged(); - } - } - private global::System.String _SizeUnitMeasureCode; - partial void OnSizeUnitMeasureCodeChanging(global::System.String value); - partial void OnSizeUnitMeasureCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String WeightUnitMeasureCode - { - get - { - return _WeightUnitMeasureCode; - } - set - { - OnWeightUnitMeasureCodeChanging(value); - _WeightUnitMeasureCode = value; - OnWeightUnitMeasureCodeChanged(); - } - } - private global::System.String _WeightUnitMeasureCode; - partial void OnWeightUnitMeasureCodeChanging(global::System.String value); - partial void OnWeightUnitMeasureCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable Weight - { - get - { - return _Weight; - } - set - { - OnWeightChanging(value); - _Weight = value; - OnWeightChanged(); - } - } - private Nullable _Weight; - partial void OnWeightChanging(Nullable value); - partial void OnWeightChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 DaysToManufacture - { - get - { - return _DaysToManufacture; - } - set - { - OnDaysToManufactureChanging(value); - _DaysToManufacture = value; - OnDaysToManufactureChanged(); - } - } - private global::System.Int32 _DaysToManufacture; - partial void OnDaysToManufactureChanging(global::System.Int32 value); - partial void OnDaysToManufactureChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ProductLine - { - get - { - return _ProductLine; - } - set - { - OnProductLineChanging(value); - _ProductLine = value; - OnProductLineChanged(); - } - } - private global::System.String _ProductLine; - partial void OnProductLineChanging(global::System.String value); - partial void OnProductLineChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Class - { - get - { - return _Class; - } - set - { - OnClassChanging(value); - _Class = value; - OnClassChanged(); - } - } - private global::System.String _Class; - partial void OnClassChanging(global::System.String value); - partial void OnClassChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Style - { - get - { - return _Style; - } - set - { - OnStyleChanging(value); - _Style = value; - OnStyleChanged(); - } - } - private global::System.String _Style; - partial void OnStyleChanging(global::System.String value); - partial void OnStyleChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ProductSubcategoryID - { - get - { - return _ProductSubcategoryID; - } - set - { - OnProductSubcategoryIDChanging(value); - _ProductSubcategoryID = value; - OnProductSubcategoryIDChanged(); - } - } - private Nullable _ProductSubcategoryID; - partial void OnProductSubcategoryIDChanging(Nullable value); - partial void OnProductSubcategoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ProductModelID - { - get - { - return _ProductModelID; - } - set - { - OnProductModelIDChanging(value); - _ProductModelID = value; - OnProductModelIDChanged(); - } - } - private Nullable _ProductModelID; - partial void OnProductModelIDChanging(Nullable value); - partial void OnProductModelIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime SellStartDate - { - get - { - return _SellStartDate; - } - set - { - OnSellStartDateChanging(value); - _SellStartDate = value; - OnSellStartDateChanged(); - } - } - private global::System.DateTime _SellStartDate; - partial void OnSellStartDateChanging(global::System.DateTime value); - partial void OnSellStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable SellEndDate - { - get - { - return _SellEndDate; - } - set - { - OnSellEndDateChanging(value); - _SellEndDate = value; - OnSellEndDateChanged(); - } - } - private Nullable _SellEndDate; - partial void OnSellEndDateChanging(Nullable value); - partial void OnSellEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable DiscontinuedDate - { - get - { - return _DiscontinuedDate; - } - set - { - OnDiscontinuedDateChanging(value); - _DiscontinuedDate = value; - OnDiscontinuedDateChanged(); - } - } - private Nullable _DiscontinuedDate; - partial void OnDiscontinuedDateChanging(Nullable value); - partial void OnDiscontinuedDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection BillOfMaterials - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "BillOfMaterials"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ComponentID", "BillOfMaterials", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection BillOfMaterials1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "BillOfMaterials"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_Product_ProductAssemblyID", "BillOfMaterials", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ProductModel ProductModel - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductModelReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "ProductModel", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ProductSubcategory ProductSubcategory - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductSubcategoryReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "ProductSubcategory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public UnitMeasure UnitMeasure - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference UnitMeasureReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "UnitMeasure", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public UnitMeasure UnitMeasure1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference UnitMeasure1Reference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "UnitMeasure", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductCostHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "ProductCostHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "ProductCostHistory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductDocuments - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "ProductDocument"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "ProductDocument", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductInventories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "ProductInventory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "ProductInventory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductListPriceHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "ProductListPriceHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "ProductListPriceHistory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductProductPhotoes - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "ProductProductPhoto"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "ProductProductPhoto", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductReviews - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductReview_Product_ProductID", "ProductReview"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductReview_Product_ProductID", "ProductReview", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductVendors - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "ProductVendor"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "ProductVendor", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection PurchaseOrderDetails - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "PurchaseOrderDetail"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "PurchaseOrderDetail", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ShoppingCartItems - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "ShoppingCartItem"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "ShoppingCartItem", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SpecialOfferProducts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "SpecialOfferProduct"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "SpecialOfferProduct", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection TransactionHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "TransactionHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "TransactionHistory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection WorkOrders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "WorkOrder"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "WorkOrder", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductCategory - { - #region Factory Method - - /// - /// Create a new ProductCategory object. - /// - /// Initial value of the ProductCategoryID property. - /// Initial value of the Name property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static ProductCategory CreateProductCategory(global::System.Int32 productCategoryID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - ProductCategory productCategory = new ProductCategory(); - productCategory.ProductCategoryID = productCategoryID; - productCategory.Name = name; - productCategory.rowguid = rowguid; - productCategory.ModifiedDate = modifiedDate; - return productCategory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductCategoryID - { - get - { - return _ProductCategoryID; - } - set - { - if (_ProductCategoryID != value) - { - OnProductCategoryIDChanging(value); - _ProductCategoryID = value; - OnProductCategoryIDChanged(); - } - } - } - private global::System.Int32 _ProductCategoryID; - partial void OnProductCategoryIDChanging(global::System.Int32 value); - partial void OnProductCategoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductSubcategories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductSubcategory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductSubcategory", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductCostHistory - { - #region Factory Method - - /// - /// Create a new ProductCostHistory object. - /// - /// Initial value of the ProductID property. - /// Initial value of the StartDate property. - /// Initial value of the StandardCost property. - /// Initial value of the ModifiedDate property. - public static ProductCostHistory CreateProductCostHistory(global::System.Int32 productID, global::System.DateTime startDate, global::System.Decimal standardCost, global::System.DateTime modifiedDate) - { - ProductCostHistory productCostHistory = new ProductCostHistory(); - productCostHistory.ProductID = productID; - productCostHistory.StartDate = startDate; - productCostHistory.StandardCost = standardCost; - productCostHistory.ModifiedDate = modifiedDate; - return productCostHistory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartDate - { - get - { - return _StartDate; - } - set - { - if (_StartDate != value) - { - OnStartDateChanging(value); - _StartDate = value; - OnStartDateChanged(); - } - } - } - private global::System.DateTime _StartDate; - partial void OnStartDateChanging(global::System.DateTime value); - partial void OnStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable EndDate - { - get - { - return _EndDate; - } - set - { - OnEndDateChanging(value); - _EndDate = value; - OnEndDateChanged(); - } - } - private Nullable _EndDate; - partial void OnEndDateChanging(Nullable value); - partial void OnEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal StandardCost - { - get - { - return _StandardCost; - } - set - { - OnStandardCostChanging(value); - _StandardCost = value; - OnStandardCostChanged(); - } - } - private global::System.Decimal _StandardCost; - partial void OnStandardCostChanging(global::System.Decimal value); - partial void OnStandardCostChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductCostHistory_Product_ProductID", "Product", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductDescription - { - #region Factory Method - - /// - /// Create a new ProductDescription object. - /// - /// Initial value of the ProductDescriptionID property. - /// Initial value of the Description property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static ProductDescription CreateProductDescription(global::System.Int32 productDescriptionID, global::System.String description, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - ProductDescription productDescription = new ProductDescription(); - productDescription.ProductDescriptionID = productDescriptionID; - productDescription.Description = description; - productDescription.rowguid = rowguid; - productDescription.ModifiedDate = modifiedDate; - return productDescription; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductDescriptionID - { - get - { - return _ProductDescriptionID; - } - set - { - if (_ProductDescriptionID != value) - { - OnProductDescriptionIDChanging(value); - _ProductDescriptionID = value; - OnProductDescriptionIDChanged(); - } - } - } - private global::System.Int32 _ProductDescriptionID; - partial void OnProductDescriptionIDChanging(global::System.Int32 value); - partial void OnProductDescriptionIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Description - { - get - { - return _Description; - } - set - { - OnDescriptionChanging(value); - _Description = value; - OnDescriptionChanged(); - } - } - private global::System.String _Description; - partial void OnDescriptionChanging(global::System.String value); - partial void OnDescriptionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductModelProductDescriptionCultures - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductModelProductDescriptionCulture"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductModelProductDescriptionCulture", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductDocument - { - #region Factory Method - - /// - /// Create a new ProductDocument object. - /// - /// Initial value of the ProductID property. - /// Initial value of the DocumentID property. - /// Initial value of the ModifiedDate property. - public static ProductDocument CreateProductDocument(global::System.Int32 productID, global::System.Int32 documentID, global::System.DateTime modifiedDate) - { - ProductDocument productDocument = new ProductDocument(); - productDocument.ProductID = productID; - productDocument.DocumentID = documentID; - productDocument.ModifiedDate = modifiedDate; - return productDocument; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 DocumentID - { - get - { - return _DocumentID; - } - set - { - if (_DocumentID != value) - { - OnDocumentIDChanging(value); - _DocumentID = value; - OnDocumentIDChanged(); - } - } - } - private global::System.Int32 _DocumentID; - partial void OnDocumentIDChanging(global::System.Int32 value); - partial void OnDocumentIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Document Document - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference DocumentReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductDocument_Document_DocumentID", "Document", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductDocument_Product_ProductID", "Product", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductInventory - { - #region Factory Method - - /// - /// Create a new ProductInventory object. - /// - /// Initial value of the ProductID property. - /// Initial value of the LocationID property. - /// Initial value of the Shelf property. - /// Initial value of the Bin property. - /// Initial value of the Quantity property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static ProductInventory CreateProductInventory(global::System.Int32 productID, global::System.Int16 locationID, global::System.String shelf, global::System.Byte bin, global::System.Int16 quantity, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - ProductInventory productInventory = new ProductInventory(); - productInventory.ProductID = productID; - productInventory.LocationID = locationID; - productInventory.Shelf = shelf; - productInventory.Bin = bin; - productInventory.Quantity = quantity; - productInventory.rowguid = rowguid; - productInventory.ModifiedDate = modifiedDate; - return productInventory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 LocationID - { - get - { - return _LocationID; - } - set - { - if (_LocationID != value) - { - OnLocationIDChanging(value); - _LocationID = value; - OnLocationIDChanged(); - } - } - } - private global::System.Int16 _LocationID; - partial void OnLocationIDChanging(global::System.Int16 value); - partial void OnLocationIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Shelf - { - get - { - return _Shelf; - } - set - { - OnShelfChanging(value); - _Shelf = value; - OnShelfChanged(); - } - } - private global::System.String _Shelf; - partial void OnShelfChanging(global::System.String value); - partial void OnShelfChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte Bin - { - get - { - return _Bin; - } - set - { - OnBinChanging(value); - _Bin = value; - OnBinChanged(); - } - } - private global::System.Byte _Bin; - partial void OnBinChanging(global::System.Byte value); - partial void OnBinChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 Quantity - { - get - { - return _Quantity; - } - set - { - OnQuantityChanging(value); - _Quantity = value; - OnQuantityChanged(); - } - } - private global::System.Int16 _Quantity; - partial void OnQuantityChanging(global::System.Int16 value); - partial void OnQuantityChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Location Location - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference LocationReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductInventory_Location_LocationID", "Location", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductInventory_Product_ProductID", "Product", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductListPriceHistory - { - #region Factory Method - - /// - /// Create a new ProductListPriceHistory object. - /// - /// Initial value of the ProductID property. - /// Initial value of the StartDate property. - /// Initial value of the ListPrice property. - /// Initial value of the ModifiedDate property. - public static ProductListPriceHistory CreateProductListPriceHistory(global::System.Int32 productID, global::System.DateTime startDate, global::System.Decimal listPrice, global::System.DateTime modifiedDate) - { - ProductListPriceHistory productListPriceHistory = new ProductListPriceHistory(); - productListPriceHistory.ProductID = productID; - productListPriceHistory.StartDate = startDate; - productListPriceHistory.ListPrice = listPrice; - productListPriceHistory.ModifiedDate = modifiedDate; - return productListPriceHistory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartDate - { - get - { - return _StartDate; - } - set - { - if (_StartDate != value) - { - OnStartDateChanging(value); - _StartDate = value; - OnStartDateChanged(); - } - } - } - private global::System.DateTime _StartDate; - partial void OnStartDateChanging(global::System.DateTime value); - partial void OnStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable EndDate - { - get - { - return _EndDate; - } - set - { - OnEndDateChanging(value); - _EndDate = value; - OnEndDateChanged(); - } - } - private Nullable _EndDate; - partial void OnEndDateChanging(Nullable value); - partial void OnEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal ListPrice - { - get - { - return _ListPrice; - } - set - { - OnListPriceChanging(value); - _ListPrice = value; - OnListPriceChanged(); - } - } - private global::System.Decimal _ListPrice; - partial void OnListPriceChanging(global::System.Decimal value); - partial void OnListPriceChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductListPriceHistory_Product_ProductID", "Product", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductModel - { - #region Factory Method - - /// - /// Create a new ProductModel object. - /// - /// Initial value of the ProductModelID property. - /// Initial value of the Name property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static ProductModel CreateProductModel(global::System.Int32 productModelID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - ProductModel productModel = new ProductModel(); - productModel.ProductModelID = productModelID; - productModel.Name = name; - productModel.rowguid = rowguid; - productModel.ModifiedDate = modifiedDate; - return productModel; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductModelID - { - get - { - return _ProductModelID; - } - set - { - if (_ProductModelID != value) - { - OnProductModelIDChanging(value); - _ProductModelID = value; - OnProductModelIDChanged(); - } - } - } - private global::System.Int32 _ProductModelID; - partial void OnProductModelIDChanging(global::System.Int32 value); - partial void OnProductModelIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CatalogDescription - { - get - { - return _CatalogDescription; - } - set - { - OnCatalogDescriptionChanging(value); - _CatalogDescription = value; - OnCatalogDescriptionChanged(); - } - } - private global::System.String _CatalogDescription; - partial void OnCatalogDescriptionChanging(global::System.String value); - partial void OnCatalogDescriptionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Instructions - { - get - { - return _Instructions; - } - set - { - OnInstructionsChanging(value); - _Instructions = value; - OnInstructionsChanged(); - } - } - private global::System.String _Instructions; - partial void OnInstructionsChanging(global::System.String value); - partial void OnInstructionsChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Products - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_ProductModel_ProductModelID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductModelIllustrations - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModelIllustration"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModelIllustration", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductModelProductDescriptionCultures - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModelProductDescriptionCulture"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModelProductDescriptionCulture", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductModelIllustration - { - #region Factory Method - - /// - /// Create a new ProductModelIllustration object. - /// - /// Initial value of the ProductModelID property. - /// Initial value of the IllustrationID property. - /// Initial value of the ModifiedDate property. - public static ProductModelIllustration CreateProductModelIllustration(global::System.Int32 productModelID, global::System.Int32 illustrationID, global::System.DateTime modifiedDate) - { - ProductModelIllustration productModelIllustration = new ProductModelIllustration(); - productModelIllustration.ProductModelID = productModelID; - productModelIllustration.IllustrationID = illustrationID; - productModelIllustration.ModifiedDate = modifiedDate; - return productModelIllustration; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductModelID - { - get - { - return _ProductModelID; - } - set - { - if (_ProductModelID != value) - { - OnProductModelIDChanging(value); - _ProductModelID = value; - OnProductModelIDChanged(); - } - } - } - private global::System.Int32 _ProductModelID; - partial void OnProductModelIDChanging(global::System.Int32 value); - partial void OnProductModelIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 IllustrationID - { - get - { - return _IllustrationID; - } - set - { - if (_IllustrationID != value) - { - OnIllustrationIDChanging(value); - _IllustrationID = value; - OnIllustrationIDChanged(); - } - } - } - private global::System.Int32 _IllustrationID; - partial void OnIllustrationIDChanging(global::System.Int32 value); - partial void OnIllustrationIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Illustration Illustration - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference IllustrationReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_Illustration_IllustrationID", "Illustration", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ProductModel ProductModel - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductModelReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelIllustration_ProductModel_ProductModelID", "ProductModel", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductModelProductDescriptionCulture - { - #region Factory Method - - /// - /// Create a new ProductModelProductDescriptionCulture object. - /// - /// Initial value of the ProductModelID property. - /// Initial value of the ProductDescriptionID property. - /// Initial value of the CultureID property. - /// Initial value of the ModifiedDate property. - public static ProductModelProductDescriptionCulture CreateProductModelProductDescriptionCulture(global::System.Int32 productModelID, global::System.Int32 productDescriptionID, global::System.String cultureID, global::System.DateTime modifiedDate) - { - ProductModelProductDescriptionCulture productModelProductDescriptionCulture = new ProductModelProductDescriptionCulture(); - productModelProductDescriptionCulture.ProductModelID = productModelID; - productModelProductDescriptionCulture.ProductDescriptionID = productDescriptionID; - productModelProductDescriptionCulture.CultureID = cultureID; - productModelProductDescriptionCulture.ModifiedDate = modifiedDate; - return productModelProductDescriptionCulture; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductModelID - { - get - { - return _ProductModelID; - } - set - { - if (_ProductModelID != value) - { - OnProductModelIDChanging(value); - _ProductModelID = value; - OnProductModelIDChanged(); - } - } - } - private global::System.Int32 _ProductModelID; - partial void OnProductModelIDChanging(global::System.Int32 value); - partial void OnProductModelIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductDescriptionID - { - get - { - return _ProductDescriptionID; - } - set - { - if (_ProductDescriptionID != value) - { - OnProductDescriptionIDChanging(value); - _ProductDescriptionID = value; - OnProductDescriptionIDChanged(); - } - } - } - private global::System.Int32 _ProductDescriptionID; - partial void OnProductDescriptionIDChanging(global::System.Int32 value); - partial void OnProductDescriptionIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CultureID - { - get - { - return _CultureID; - } - set - { - if (_CultureID != value) - { - OnCultureIDChanging(value); - _CultureID = value; - OnCultureIDChanged(); - } - } - } - private global::System.String _CultureID; - partial void OnCultureIDChanging(global::System.String value); - partial void OnCultureIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Culture Culture - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CultureReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_Culture_CultureID", "Culture", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ProductDescription ProductDescription - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductDescriptionReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductDescription_ProductDescriptionID", "ProductDescription", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ProductModel ProductModel - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductModelReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductModelProductDescriptionCulture_ProductModel_ProductModelID", "ProductModel", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductPhoto - { - #region Factory Method - - /// - /// Create a new ProductPhoto object. - /// - /// Initial value of the ProductPhotoID property. - /// Initial value of the ModifiedDate property. - public static ProductPhoto CreateProductPhoto(global::System.Int32 productPhotoID, global::System.DateTime modifiedDate) - { - ProductPhoto productPhoto = new ProductPhoto(); - productPhoto.ProductPhotoID = productPhotoID; - productPhoto.ModifiedDate = modifiedDate; - return productPhoto; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductPhotoID - { - get - { - return _ProductPhotoID; - } - set - { - if (_ProductPhotoID != value) - { - OnProductPhotoIDChanging(value); - _ProductPhotoID = value; - OnProductPhotoIDChanged(); - } - } - } - private global::System.Int32 _ProductPhotoID; - partial void OnProductPhotoIDChanging(global::System.Int32 value); - partial void OnProductPhotoIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte[] ThumbNailPhoto - { - get - { - return value; - } - set - { - OnThumbNailPhotoChanging(value); - _ThumbNailPhoto = value; - OnThumbNailPhotoChanged(); - } - } - private global::System.Byte[] _ThumbNailPhoto; - partial void OnThumbNailPhotoChanging(global::System.Byte[] value); - partial void OnThumbNailPhotoChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ThumbnailPhotoFileName - { - get - { - return _ThumbnailPhotoFileName; - } - set - { - OnThumbnailPhotoFileNameChanging(value); - _ThumbnailPhotoFileName = value; - OnThumbnailPhotoFileNameChanged(); - } - } - private global::System.String _ThumbnailPhotoFileName; - partial void OnThumbnailPhotoFileNameChanging(global::System.String value); - partial void OnThumbnailPhotoFileNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte[] LargePhoto - { - get - { - return value; - } - set - { - OnLargePhotoChanging(value); - _LargePhoto = value; - OnLargePhotoChanged(); - } - } - private global::System.Byte[] _LargePhoto; - partial void OnLargePhotoChanging(global::System.Byte[] value); - partial void OnLargePhotoChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String LargePhotoFileName - { - get - { - return _LargePhotoFileName; - } - set - { - OnLargePhotoFileNameChanging(value); - _LargePhotoFileName = value; - OnLargePhotoFileNameChanged(); - } - } - private global::System.String _LargePhotoFileName; - partial void OnLargePhotoFileNameChanging(global::System.String value); - partial void OnLargePhotoFileNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductProductPhotoes - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductProductPhoto"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductProductPhoto", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductProductPhoto - { - #region Factory Method - - /// - /// Create a new ProductProductPhoto object. - /// - /// Initial value of the ProductID property. - /// Initial value of the ProductPhotoID property. - /// Initial value of the Primary property. - /// Initial value of the ModifiedDate property. - public static ProductProductPhoto CreateProductProductPhoto(global::System.Int32 productID, global::System.Int32 productPhotoID, global::System.Boolean primary, global::System.DateTime modifiedDate) - { - ProductProductPhoto productProductPhoto = new ProductProductPhoto(); - productProductPhoto.ProductID = productID; - productProductPhoto.ProductPhotoID = productPhotoID; - productProductPhoto.Primary = primary; - productProductPhoto.ModifiedDate = modifiedDate; - return productProductPhoto; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductPhotoID - { - get - { - return _ProductPhotoID; - } - set - { - if (_ProductPhotoID != value) - { - OnProductPhotoIDChanging(value); - _ProductPhotoID = value; - OnProductPhotoIDChanged(); - } - } - } - private global::System.Int32 _ProductPhotoID; - partial void OnProductPhotoIDChanging(global::System.Int32 value); - partial void OnProductPhotoIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean Primary - { - get - { - return _Primary; - } - set - { - OnPrimaryChanging(value); - _Primary = value; - OnPrimaryChanged(); - } - } - private global::System.Boolean _Primary; - partial void OnPrimaryChanging(global::System.Boolean value); - partial void OnPrimaryChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_Product_ProductID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ProductPhoto ProductPhoto - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductPhotoReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductProductPhoto_ProductPhoto_ProductPhotoID", "ProductPhoto", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductReview - { - #region Factory Method - - /// - /// Create a new ProductReview object. - /// - /// Initial value of the ProductReviewID property. - /// Initial value of the ProductID property. - /// Initial value of the ReviewerName property. - /// Initial value of the ReviewDate property. - /// Initial value of the EmailAddress property. - /// Initial value of the Rating property. - /// Initial value of the ModifiedDate property. - public static ProductReview CreateProductReview(global::System.Int32 productReviewID, global::System.Int32 productID, global::System.String reviewerName, global::System.DateTime reviewDate, global::System.String emailAddress, global::System.Int32 rating, global::System.DateTime modifiedDate) - { - ProductReview productReview = new ProductReview(); - productReview.ProductReviewID = productReviewID; - productReview.ProductID = productID; - productReview.ReviewerName = reviewerName; - productReview.ReviewDate = reviewDate; - productReview.EmailAddress = emailAddress; - productReview.Rating = rating; - productReview.ModifiedDate = modifiedDate; - return productReview; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductReviewID - { - get - { - return _ProductReviewID; - } - set - { - if (_ProductReviewID != value) - { - OnProductReviewIDChanging(value); - _ProductReviewID = value; - OnProductReviewIDChanged(); - } - } - } - private global::System.Int32 _ProductReviewID; - partial void OnProductReviewIDChanging(global::System.Int32 value); - partial void OnProductReviewIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ReviewerName - { - get - { - return _ReviewerName; - } - set - { - OnReviewerNameChanging(value); - _ReviewerName = value; - OnReviewerNameChanged(); - } - } - private global::System.String _ReviewerName; - partial void OnReviewerNameChanging(global::System.String value); - partial void OnReviewerNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ReviewDate - { - get - { - return _ReviewDate; - } - set - { - OnReviewDateChanging(value); - _ReviewDate = value; - OnReviewDateChanged(); - } - } - private global::System.DateTime _ReviewDate; - partial void OnReviewDateChanging(global::System.DateTime value); - partial void OnReviewDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String EmailAddress - { - get - { - return _EmailAddress; - } - set - { - OnEmailAddressChanging(value); - _EmailAddress = value; - OnEmailAddressChanged(); - } - } - private global::System.String _EmailAddress; - partial void OnEmailAddressChanging(global::System.String value); - partial void OnEmailAddressChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 Rating - { - get - { - return _Rating; - } - set - { - OnRatingChanging(value); - _Rating = value; - OnRatingChanged(); - } - } - private global::System.Int32 _Rating; - partial void OnRatingChanging(global::System.Int32 value); - partial void OnRatingChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Comments - { - get - { - return _Comments; - } - set - { - OnCommentsChanging(value); - _Comments = value; - OnCommentsChanged(); - } - } - private global::System.String _Comments; - partial void OnCommentsChanging(global::System.String value); - partial void OnCommentsChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductReview_Product_ProductID", "Product", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductSubcategory - { - #region Factory Method - - /// - /// Create a new ProductSubcategory object. - /// - /// Initial value of the ProductSubcategoryID property. - /// Initial value of the ProductCategoryID property. - /// Initial value of the Name property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static ProductSubcategory CreateProductSubcategory(global::System.Int32 productSubcategoryID, global::System.Int32 productCategoryID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - ProductSubcategory productSubcategory = new ProductSubcategory(); - productSubcategory.ProductSubcategoryID = productSubcategoryID; - productSubcategory.ProductCategoryID = productCategoryID; - productSubcategory.Name = name; - productSubcategory.rowguid = rowguid; - productSubcategory.ModifiedDate = modifiedDate; - return productSubcategory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductSubcategoryID - { - get - { - return _ProductSubcategoryID; - } - set - { - if (_ProductSubcategoryID != value) - { - OnProductSubcategoryIDChanging(value); - _ProductSubcategoryID = value; - OnProductSubcategoryIDChanged(); - } - } - } - private global::System.Int32 _ProductSubcategoryID; - partial void OnProductSubcategoryIDChanging(global::System.Int32 value); - partial void OnProductSubcategoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductCategoryID - { - get - { - return _ProductCategoryID; - } - set - { - OnProductCategoryIDChanging(value); - _ProductCategoryID = value; - OnProductCategoryIDChanged(); - } - } - private global::System.Int32 _ProductCategoryID; - partial void OnProductCategoryIDChanging(global::System.Int32 value); - partial void OnProductCategoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Products - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_ProductSubcategory_ProductSubcategoryID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ProductCategory ProductCategory - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductCategoryReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductSubcategory_ProductCategory_ProductCategoryID", "ProductCategory", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ProductVendor - { - #region Factory Method - - /// - /// Create a new ProductVendor object. - /// - /// Initial value of the ProductID property. - /// Initial value of the VendorID property. - /// Initial value of the AverageLeadTime property. - /// Initial value of the StandardPrice property. - /// Initial value of the MinOrderQty property. - /// Initial value of the MaxOrderQty property. - /// Initial value of the UnitMeasureCode property. - /// Initial value of the ModifiedDate property. - public static ProductVendor CreateProductVendor(global::System.Int32 productID, global::System.Int32 vendorID, global::System.Int32 averageLeadTime, global::System.Decimal standardPrice, global::System.Int32 minOrderQty, global::System.Int32 maxOrderQty, global::System.String unitMeasureCode, global::System.DateTime modifiedDate) - { - ProductVendor productVendor = new ProductVendor(); - productVendor.ProductID = productID; - productVendor.VendorID = vendorID; - productVendor.AverageLeadTime = averageLeadTime; - productVendor.StandardPrice = standardPrice; - productVendor.MinOrderQty = minOrderQty; - productVendor.MaxOrderQty = maxOrderQty; - productVendor.UnitMeasureCode = unitMeasureCode; - productVendor.ModifiedDate = modifiedDate; - return productVendor; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 VendorID - { - get - { - return _VendorID; - } - set - { - if (_VendorID != value) - { - OnVendorIDChanging(value); - _VendorID = value; - OnVendorIDChanged(); - } - } - } - private global::System.Int32 _VendorID; - partial void OnVendorIDChanging(global::System.Int32 value); - partial void OnVendorIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AverageLeadTime - { - get - { - return _AverageLeadTime; - } - set - { - OnAverageLeadTimeChanging(value); - _AverageLeadTime = value; - OnAverageLeadTimeChanged(); - } - } - private global::System.Int32 _AverageLeadTime; - partial void OnAverageLeadTimeChanging(global::System.Int32 value); - partial void OnAverageLeadTimeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal StandardPrice - { - get - { - return _StandardPrice; - } - set - { - OnStandardPriceChanging(value); - _StandardPrice = value; - OnStandardPriceChanged(); - } - } - private global::System.Decimal _StandardPrice; - partial void OnStandardPriceChanging(global::System.Decimal value); - partial void OnStandardPriceChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable LastReceiptCost - { - get - { - return _LastReceiptCost; - } - set - { - OnLastReceiptCostChanging(value); - _LastReceiptCost = value; - OnLastReceiptCostChanged(); - } - } - private Nullable _LastReceiptCost; - partial void OnLastReceiptCostChanging(Nullable value); - partial void OnLastReceiptCostChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable LastReceiptDate - { - get - { - return _LastReceiptDate; - } - set - { - OnLastReceiptDateChanging(value); - _LastReceiptDate = value; - OnLastReceiptDateChanged(); - } - } - private Nullable _LastReceiptDate; - partial void OnLastReceiptDateChanging(Nullable value); - partial void OnLastReceiptDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 MinOrderQty - { - get - { - return _MinOrderQty; - } - set - { - OnMinOrderQtyChanging(value); - _MinOrderQty = value; - OnMinOrderQtyChanged(); - } - } - private global::System.Int32 _MinOrderQty; - partial void OnMinOrderQtyChanging(global::System.Int32 value); - partial void OnMinOrderQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 MaxOrderQty - { - get - { - return _MaxOrderQty; - } - set - { - OnMaxOrderQtyChanging(value); - _MaxOrderQty = value; - OnMaxOrderQtyChanged(); - } - } - private global::System.Int32 _MaxOrderQty; - partial void OnMaxOrderQtyChanging(global::System.Int32 value); - partial void OnMaxOrderQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable OnOrderQty - { - get - { - return _OnOrderQty; - } - set - { - OnOnOrderQtyChanging(value); - _OnOrderQty = value; - OnOnOrderQtyChanged(); - } - } - private Nullable _OnOrderQty; - partial void OnOnOrderQtyChanging(Nullable value); - partial void OnOnOrderQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String UnitMeasureCode - { - get - { - return _UnitMeasureCode; - } - set - { - OnUnitMeasureCodeChanging(value); - _UnitMeasureCode = value; - OnUnitMeasureCodeChanged(); - } - } - private global::System.String _UnitMeasureCode; - partial void OnUnitMeasureCodeChanging(global::System.String value); - partial void OnUnitMeasureCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductVendor_Product_ProductID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public UnitMeasure UnitMeasure - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference UnitMeasureReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "UnitMeasure", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Vendor Vendor - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference VendorReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "Vendor", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class PurchaseOrder - { - #region Factory Method - - /// - /// Create a new PurchaseOrder object. - /// - /// Initial value of the PurchaseOrderID property. - /// Initial value of the RevisionNumber property. - /// Initial value of the Status property. - /// Initial value of the EmployeeID property. - /// Initial value of the VendorID property. - /// Initial value of the ShipMethodID property. - /// Initial value of the OrderDate property. - /// Initial value of the SubTotal property. - /// Initial value of the TaxAmt property. - /// Initial value of the Freight property. - /// Initial value of the TotalDue property. - /// Initial value of the ModifiedDate property. - public static PurchaseOrder CreatePurchaseOrder(global::System.Int32 purchaseOrderID, global::System.Byte revisionNumber, global::System.Byte status, global::System.Int32 employeeID, global::System.Int32 vendorID, global::System.Int32 shipMethodID, global::System.DateTime orderDate, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.DateTime modifiedDate) - { - PurchaseOrder purchaseOrder = new PurchaseOrder(); - purchaseOrder.PurchaseOrderID = purchaseOrderID; - purchaseOrder.RevisionNumber = revisionNumber; - purchaseOrder.Status = status; - purchaseOrder.EmployeeID = employeeID; - purchaseOrder.VendorID = vendorID; - purchaseOrder.ShipMethodID = shipMethodID; - purchaseOrder.OrderDate = orderDate; - purchaseOrder.SubTotal = subTotal; - purchaseOrder.TaxAmt = taxAmt; - purchaseOrder.Freight = freight; - purchaseOrder.TotalDue = totalDue; - purchaseOrder.ModifiedDate = modifiedDate; - return purchaseOrder; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 PurchaseOrderID - { - get - { - return _PurchaseOrderID; - } - set - { - if (_PurchaseOrderID != value) - { - OnPurchaseOrderIDChanging(value); - _PurchaseOrderID = value; - OnPurchaseOrderIDChanged(); - } - } - } - private global::System.Int32 _PurchaseOrderID; - partial void OnPurchaseOrderIDChanging(global::System.Int32 value); - partial void OnPurchaseOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte RevisionNumber - { - get - { - return _RevisionNumber; - } - set - { - OnRevisionNumberChanging(value); - _RevisionNumber = value; - OnRevisionNumberChanged(); - } - } - private global::System.Byte _RevisionNumber; - partial void OnRevisionNumberChanging(global::System.Byte value); - partial void OnRevisionNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte Status - { - get - { - return _Status; - } - set - { - OnStatusChanging(value); - _Status = value; - OnStatusChanged(); - } - } - private global::System.Byte _Status; - partial void OnStatusChanging(global::System.Byte value); - partial void OnStatusChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 EmployeeID - { - get - { - return _EmployeeID; - } - set - { - OnEmployeeIDChanging(value); - _EmployeeID = value; - OnEmployeeIDChanged(); - } - } - private global::System.Int32 _EmployeeID; - partial void OnEmployeeIDChanging(global::System.Int32 value); - partial void OnEmployeeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 VendorID - { - get - { - return _VendorID; - } - set - { - OnVendorIDChanging(value); - _VendorID = value; - OnVendorIDChanged(); - } - } - private global::System.Int32 _VendorID; - partial void OnVendorIDChanging(global::System.Int32 value); - partial void OnVendorIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ShipMethodID - { - get - { - return _ShipMethodID; - } - set - { - OnShipMethodIDChanging(value); - _ShipMethodID = value; - OnShipMethodIDChanged(); - } - } - private global::System.Int32 _ShipMethodID; - partial void OnShipMethodIDChanging(global::System.Int32 value); - partial void OnShipMethodIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime OrderDate - { - get - { - return _OrderDate; - } - set - { - OnOrderDateChanging(value); - _OrderDate = value; - OnOrderDateChanged(); - } - } - private global::System.DateTime _OrderDate; - partial void OnOrderDateChanging(global::System.DateTime value); - partial void OnOrderDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ShipDate - { - get - { - return _ShipDate; - } - set - { - OnShipDateChanging(value); - _ShipDate = value; - OnShipDateChanged(); - } - } - private Nullable _ShipDate; - partial void OnShipDateChanging(Nullable value); - partial void OnShipDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal SubTotal - { - get - { - return _SubTotal; - } - set - { - OnSubTotalChanging(value); - _SubTotal = value; - OnSubTotalChanged(); - } - } - private global::System.Decimal _SubTotal; - partial void OnSubTotalChanging(global::System.Decimal value); - partial void OnSubTotalChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal TaxAmt - { - get - { - return _TaxAmt; - } - set - { - OnTaxAmtChanging(value); - _TaxAmt = value; - OnTaxAmtChanged(); - } - } - private global::System.Decimal _TaxAmt; - partial void OnTaxAmtChanging(global::System.Decimal value); - partial void OnTaxAmtChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal Freight - { - get - { - return _Freight; - } - set - { - OnFreightChanging(value); - _Freight = value; - OnFreightChanged(); - } - } - private global::System.Decimal _Freight; - partial void OnFreightChanging(global::System.Decimal value); - partial void OnFreightChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal TotalDue - { - get - { - return _TotalDue; - } - set - { - OnTotalDueChanging(value); - _TotalDue = value; - OnTotalDueChanged(); - } - } - private global::System.Decimal _TotalDue; - partial void OnTotalDueChanging(global::System.Decimal value); - partial void OnTotalDueChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Employee Employee - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference EmployeeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Employee_EmployeeID", "Employee", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection PurchaseOrderDetails - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderDetail"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderDetail", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ShipMethod ShipMethod - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ShipMethodReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Vendor Vendor - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference VendorReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "Vendor", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class PurchaseOrderDetail - { - #region Factory Method - - /// - /// Create a new PurchaseOrderDetail object. - /// - /// Initial value of the PurchaseOrderID property. - /// Initial value of the PurchaseOrderDetailID property. - /// Initial value of the DueDate property. - /// Initial value of the OrderQty property. - /// Initial value of the ProductID property. - /// Initial value of the UnitPrice property. - /// Initial value of the LineTotal property. - /// Initial value of the ReceivedQty property. - /// Initial value of the RejectedQty property. - /// Initial value of the StockedQty property. - /// Initial value of the ModifiedDate property. - public static PurchaseOrderDetail CreatePurchaseOrderDetail(global::System.Int32 purchaseOrderID, global::System.Int32 purchaseOrderDetailID, global::System.DateTime dueDate, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Decimal unitPrice, global::System.Decimal lineTotal, global::System.Decimal receivedQty, global::System.Decimal rejectedQty, global::System.Decimal stockedQty, global::System.DateTime modifiedDate) - { - PurchaseOrderDetail purchaseOrderDetail = new PurchaseOrderDetail(); - purchaseOrderDetail.PurchaseOrderID = purchaseOrderID; - purchaseOrderDetail.PurchaseOrderDetailID = purchaseOrderDetailID; - purchaseOrderDetail.DueDate = dueDate; - purchaseOrderDetail.OrderQty = orderQty; - purchaseOrderDetail.ProductID = productID; - purchaseOrderDetail.UnitPrice = unitPrice; - purchaseOrderDetail.LineTotal = lineTotal; - purchaseOrderDetail.ReceivedQty = receivedQty; - purchaseOrderDetail.RejectedQty = rejectedQty; - purchaseOrderDetail.StockedQty = stockedQty; - purchaseOrderDetail.ModifiedDate = modifiedDate; - return purchaseOrderDetail; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 PurchaseOrderID - { - get - { - return _PurchaseOrderID; - } - set - { - if (_PurchaseOrderID != value) - { - OnPurchaseOrderIDChanging(value); - _PurchaseOrderID = value; - OnPurchaseOrderIDChanged(); - } - } - } - private global::System.Int32 _PurchaseOrderID; - partial void OnPurchaseOrderIDChanging(global::System.Int32 value); - partial void OnPurchaseOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 PurchaseOrderDetailID - { - get - { - return _PurchaseOrderDetailID; - } - set - { - if (_PurchaseOrderDetailID != value) - { - OnPurchaseOrderDetailIDChanging(value); - _PurchaseOrderDetailID = value; - OnPurchaseOrderDetailIDChanged(); - } - } - } - private global::System.Int32 _PurchaseOrderDetailID; - partial void OnPurchaseOrderDetailIDChanging(global::System.Int32 value); - partial void OnPurchaseOrderDetailIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime DueDate - { - get - { - return _DueDate; - } - set - { - OnDueDateChanging(value); - _DueDate = value; - OnDueDateChanged(); - } - } - private global::System.DateTime _DueDate; - partial void OnDueDateChanging(global::System.DateTime value); - partial void OnDueDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 OrderQty - { - get - { - return _OrderQty; - } - set - { - OnOrderQtyChanging(value); - _OrderQty = value; - OnOrderQtyChanged(); - } - } - private global::System.Int16 _OrderQty; - partial void OnOrderQtyChanging(global::System.Int16 value); - partial void OnOrderQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal UnitPrice - { - get - { - return _UnitPrice; - } - set - { - OnUnitPriceChanging(value); - _UnitPrice = value; - OnUnitPriceChanged(); - } - } - private global::System.Decimal _UnitPrice; - partial void OnUnitPriceChanging(global::System.Decimal value); - partial void OnUnitPriceChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal LineTotal - { - get - { - return _LineTotal; - } - set - { - OnLineTotalChanging(value); - _LineTotal = value; - OnLineTotalChanged(); - } - } - private global::System.Decimal _LineTotal; - partial void OnLineTotalChanging(global::System.Decimal value); - partial void OnLineTotalChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal ReceivedQty - { - get - { - return _ReceivedQty; - } - set - { - OnReceivedQtyChanging(value); - _ReceivedQty = value; - OnReceivedQtyChanged(); - } - } - private global::System.Decimal _ReceivedQty; - partial void OnReceivedQtyChanging(global::System.Decimal value); - partial void OnReceivedQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal RejectedQty - { - get - { - return _RejectedQty; - } - set - { - OnRejectedQtyChanging(value); - _RejectedQty = value; - OnRejectedQtyChanged(); - } - } - private global::System.Decimal _RejectedQty; - partial void OnRejectedQtyChanging(global::System.Decimal value); - partial void OnRejectedQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal StockedQty - { - get - { - return _StockedQty; - } - set - { - OnStockedQtyChanging(value); - _StockedQty = value; - OnStockedQtyChanged(); - } - } - private global::System.Decimal _StockedQty; - partial void OnStockedQtyChanging(global::System.Decimal value); - partial void OnStockedQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_Product_ProductID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public PurchaseOrder PurchaseOrder - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference PurchaseOrderReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderHeader", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesOrderDetail - { - #region Factory Method - - /// - /// Create a new SalesOrderDetail object. - /// - /// Initial value of the SalesOrderID property. - /// Initial value of the SalesOrderDetailID property. - /// Initial value of the OrderQty property. - /// Initial value of the ProductID property. - /// Initial value of the SpecialOfferID property. - /// Initial value of the UnitPrice property. - /// Initial value of the UnitPriceDiscount property. - /// Initial value of the LineTotal property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SalesOrderDetail CreateSalesOrderDetail(global::System.Int32 salesOrderID, global::System.Int32 salesOrderDetailID, global::System.Int16 orderQty, global::System.Int32 productID, global::System.Int32 specialOfferID, global::System.Decimal unitPrice, global::System.Decimal unitPriceDiscount, global::System.Decimal lineTotal, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SalesOrderDetail salesOrderDetail = new SalesOrderDetail(); - salesOrderDetail.SalesOrderID = salesOrderID; - salesOrderDetail.SalesOrderDetailID = salesOrderDetailID; - salesOrderDetail.OrderQty = orderQty; - salesOrderDetail.ProductID = productID; - salesOrderDetail.SpecialOfferID = specialOfferID; - salesOrderDetail.UnitPrice = unitPrice; - salesOrderDetail.UnitPriceDiscount = unitPriceDiscount; - salesOrderDetail.LineTotal = lineTotal; - salesOrderDetail.rowguid = rowguid; - salesOrderDetail.ModifiedDate = modifiedDate; - return salesOrderDetail; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesOrderID - { - get - { - return _SalesOrderID; - } - set - { - if (_SalesOrderID != value) - { - OnSalesOrderIDChanging(value); - _SalesOrderID = value; - OnSalesOrderIDChanged(); - } - } - } - private global::System.Int32 _SalesOrderID; - partial void OnSalesOrderIDChanging(global::System.Int32 value); - partial void OnSalesOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesOrderDetailID - { - get - { - return _SalesOrderDetailID; - } - set - { - if (_SalesOrderDetailID != value) - { - OnSalesOrderDetailIDChanging(value); - _SalesOrderDetailID = value; - OnSalesOrderDetailIDChanged(); - } - } - } - private global::System.Int32 _SalesOrderDetailID; - partial void OnSalesOrderDetailIDChanging(global::System.Int32 value); - partial void OnSalesOrderDetailIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CarrierTrackingNumber - { - get - { - return _CarrierTrackingNumber; - } - set - { - OnCarrierTrackingNumberChanging(value); - _CarrierTrackingNumber = value; - OnCarrierTrackingNumberChanged(); - } - } - private global::System.String _CarrierTrackingNumber; - partial void OnCarrierTrackingNumberChanging(global::System.String value); - partial void OnCarrierTrackingNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 OrderQty - { - get - { - return _OrderQty; - } - set - { - OnOrderQtyChanging(value); - _OrderQty = value; - OnOrderQtyChanged(); - } - } - private global::System.Int16 _OrderQty; - partial void OnOrderQtyChanging(global::System.Int16 value); - partial void OnOrderQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SpecialOfferID - { - get - { - return _SpecialOfferID; - } - set - { - OnSpecialOfferIDChanging(value); - _SpecialOfferID = value; - OnSpecialOfferIDChanged(); - } - } - private global::System.Int32 _SpecialOfferID; - partial void OnSpecialOfferIDChanging(global::System.Int32 value); - partial void OnSpecialOfferIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal UnitPrice - { - get - { - return _UnitPrice; - } - set - { - OnUnitPriceChanging(value); - _UnitPrice = value; - OnUnitPriceChanged(); - } - } - private global::System.Decimal _UnitPrice; - partial void OnUnitPriceChanging(global::System.Decimal value); - partial void OnUnitPriceChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal UnitPriceDiscount - { - get - { - return _UnitPriceDiscount; - } - set - { - OnUnitPriceDiscountChanging(value); - _UnitPriceDiscount = value; - OnUnitPriceDiscountChanged(); - } - } - private global::System.Decimal _UnitPriceDiscount; - partial void OnUnitPriceDiscountChanging(global::System.Decimal value); - partial void OnUnitPriceDiscountChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal LineTotal - { - get - { - return _LineTotal; - } - set - { - OnLineTotalChanging(value); - _LineTotal = value; - OnLineTotalChanged(); - } - } - private global::System.Decimal _LineTotal; - partial void OnLineTotalChanging(global::System.Decimal value); - partial void OnLineTotalChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesOrderHeader SalesOrderHeader - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesOrderHeaderReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SpecialOfferProduct SpecialOfferProduct - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SpecialOfferProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SpecialOfferProduct", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesOrderHeader - { - #region Factory Method - - /// - /// Create a new SalesOrderHeader object. - /// - /// Initial value of the SalesOrderID property. - /// Initial value of the RevisionNumber property. - /// Initial value of the OrderDate property. - /// Initial value of the DueDate property. - /// Initial value of the Status property. - /// Initial value of the OnlineOrderFlag property. - /// Initial value of the SalesOrderNumber property. - /// Initial value of the CustomerID property. - /// Initial value of the ContactID property. - /// Initial value of the BillToAddressID property. - /// Initial value of the ShipToAddressID property. - /// Initial value of the ShipMethodID property. - /// Initial value of the SubTotal property. - /// Initial value of the TaxAmt property. - /// Initial value of the Freight property. - /// Initial value of the TotalDue property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SalesOrderHeader CreateSalesOrderHeader(global::System.Int32 salesOrderID, global::System.Byte revisionNumber, global::System.DateTime orderDate, global::System.DateTime dueDate, global::System.Byte status, global::System.Boolean onlineOrderFlag, global::System.String salesOrderNumber, global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 billToAddressID, global::System.Int32 shipToAddressID, global::System.Int32 shipMethodID, global::System.Decimal subTotal, global::System.Decimal taxAmt, global::System.Decimal freight, global::System.Decimal totalDue, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SalesOrderHeader salesOrderHeader = new SalesOrderHeader(); - salesOrderHeader.SalesOrderID = salesOrderID; - salesOrderHeader.RevisionNumber = revisionNumber; - salesOrderHeader.OrderDate = orderDate; - salesOrderHeader.DueDate = dueDate; - salesOrderHeader.Status = status; - salesOrderHeader.OnlineOrderFlag = onlineOrderFlag; - salesOrderHeader.SalesOrderNumber = salesOrderNumber; - salesOrderHeader.CustomerID = customerID; - salesOrderHeader.ContactID = contactID; - salesOrderHeader.BillToAddressID = billToAddressID; - salesOrderHeader.ShipToAddressID = shipToAddressID; - salesOrderHeader.ShipMethodID = shipMethodID; - salesOrderHeader.SubTotal = subTotal; - salesOrderHeader.TaxAmt = taxAmt; - salesOrderHeader.Freight = freight; - salesOrderHeader.TotalDue = totalDue; - salesOrderHeader.rowguid = rowguid; - salesOrderHeader.ModifiedDate = modifiedDate; - return salesOrderHeader; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesOrderID - { - get - { - return _SalesOrderID; - } - set - { - if (_SalesOrderID != value) - { - OnSalesOrderIDChanging(value); - _SalesOrderID = value; - OnSalesOrderIDChanged(); - } - } - } - private global::System.Int32 _SalesOrderID; - partial void OnSalesOrderIDChanging(global::System.Int32 value); - partial void OnSalesOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte RevisionNumber - { - get - { - return _RevisionNumber; - } - set - { - OnRevisionNumberChanging(value); - _RevisionNumber = value; - OnRevisionNumberChanged(); - } - } - private global::System.Byte _RevisionNumber; - partial void OnRevisionNumberChanging(global::System.Byte value); - partial void OnRevisionNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime OrderDate - { - get - { - return _OrderDate; - } - set - { - OnOrderDateChanging(value); - _OrderDate = value; - OnOrderDateChanged(); - } - } - private global::System.DateTime _OrderDate; - partial void OnOrderDateChanging(global::System.DateTime value); - partial void OnOrderDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime DueDate - { - get - { - return _DueDate; - } - set - { - OnDueDateChanging(value); - _DueDate = value; - OnDueDateChanged(); - } - } - private global::System.DateTime _DueDate; - partial void OnDueDateChanging(global::System.DateTime value); - partial void OnDueDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ShipDate - { - get - { - return _ShipDate; - } - set - { - OnShipDateChanging(value); - _ShipDate = value; - OnShipDateChanged(); - } - } - private Nullable _ShipDate; - partial void OnShipDateChanging(Nullable value); - partial void OnShipDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte Status - { - get - { - return _Status; - } - set - { - OnStatusChanging(value); - _Status = value; - OnStatusChanged(); - } - } - private global::System.Byte _Status; - partial void OnStatusChanging(global::System.Byte value); - partial void OnStatusChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean OnlineOrderFlag - { - get - { - return _OnlineOrderFlag; - } - set - { - OnOnlineOrderFlagChanging(value); - _OnlineOrderFlag = value; - OnOnlineOrderFlagChanged(); - } - } - private global::System.Boolean _OnlineOrderFlag; - partial void OnOnlineOrderFlagChanging(global::System.Boolean value); - partial void OnOnlineOrderFlagChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String SalesOrderNumber - { - get - { - return _SalesOrderNumber; - } - set - { - OnSalesOrderNumberChanging(value); - _SalesOrderNumber = value; - OnSalesOrderNumberChanged(); - } - } - private global::System.String _SalesOrderNumber; - partial void OnSalesOrderNumberChanging(global::System.String value); - partial void OnSalesOrderNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String PurchaseOrderNumber - { - get - { - return _PurchaseOrderNumber; - } - set - { - OnPurchaseOrderNumberChanging(value); - _PurchaseOrderNumber = value; - OnPurchaseOrderNumberChanged(); - } - } - private global::System.String _PurchaseOrderNumber; - partial void OnPurchaseOrderNumberChanging(global::System.String value); - partial void OnPurchaseOrderNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String AccountNumber - { - get - { - return _AccountNumber; - } - set - { - OnAccountNumberChanging(value); - _AccountNumber = value; - OnAccountNumberChanged(); - } - } - private global::System.String _AccountNumber; - partial void OnAccountNumberChanging(global::System.String value); - partial void OnAccountNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CustomerID - { - get - { - return _CustomerID; - } - set - { - OnCustomerIDChanging(value); - _CustomerID = value; - OnCustomerIDChanged(); - } - } - private global::System.Int32 _CustomerID; - partial void OnCustomerIDChanging(global::System.Int32 value); - partial void OnCustomerIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactID - { - get - { - return _ContactID; - } - set - { - OnContactIDChanging(value); - _ContactID = value; - OnContactIDChanged(); - } - } - private global::System.Int32 _ContactID; - partial void OnContactIDChanging(global::System.Int32 value); - partial void OnContactIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable SalesPersonID - { - get - { - return _SalesPersonID; - } - set - { - OnSalesPersonIDChanging(value); - _SalesPersonID = value; - OnSalesPersonIDChanged(); - } - } - private Nullable _SalesPersonID; - partial void OnSalesPersonIDChanging(Nullable value); - partial void OnSalesPersonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable TerritoryID - { - get - { - return _TerritoryID; - } - set - { - OnTerritoryIDChanging(value); - _TerritoryID = value; - OnTerritoryIDChanged(); - } - } - private Nullable _TerritoryID; - partial void OnTerritoryIDChanging(Nullable value); - partial void OnTerritoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 BillToAddressID - { - get - { - return _BillToAddressID; - } - set - { - OnBillToAddressIDChanging(value); - _BillToAddressID = value; - OnBillToAddressIDChanged(); - } - } - private global::System.Int32 _BillToAddressID; - partial void OnBillToAddressIDChanging(global::System.Int32 value); - partial void OnBillToAddressIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ShipToAddressID - { - get - { - return _ShipToAddressID; - } - set - { - OnShipToAddressIDChanging(value); - _ShipToAddressID = value; - OnShipToAddressIDChanged(); - } - } - private global::System.Int32 _ShipToAddressID; - partial void OnShipToAddressIDChanging(global::System.Int32 value); - partial void OnShipToAddressIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ShipMethodID - { - get - { - return _ShipMethodID; - } - set - { - OnShipMethodIDChanging(value); - _ShipMethodID = value; - OnShipMethodIDChanged(); - } - } - private global::System.Int32 _ShipMethodID; - partial void OnShipMethodIDChanging(global::System.Int32 value); - partial void OnShipMethodIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable CreditCardID - { - get - { - return _CreditCardID; - } - set - { - OnCreditCardIDChanging(value); - _CreditCardID = value; - OnCreditCardIDChanged(); - } - } - private Nullable _CreditCardID; - partial void OnCreditCardIDChanging(Nullable value); - partial void OnCreditCardIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CreditCardApprovalCode - { - get - { - return _CreditCardApprovalCode; - } - set - { - OnCreditCardApprovalCodeChanging(value); - _CreditCardApprovalCode = value; - OnCreditCardApprovalCodeChanged(); - } - } - private global::System.String _CreditCardApprovalCode; - partial void OnCreditCardApprovalCodeChanging(global::System.String value); - partial void OnCreditCardApprovalCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable CurrencyRateID - { - get - { - return _CurrencyRateID; - } - set - { - OnCurrencyRateIDChanging(value); - _CurrencyRateID = value; - OnCurrencyRateIDChanged(); - } - } - private Nullable _CurrencyRateID; - partial void OnCurrencyRateIDChanging(Nullable value); - partial void OnCurrencyRateIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal SubTotal - { - get - { - return _SubTotal; - } - set - { - OnSubTotalChanging(value); - _SubTotal = value; - OnSubTotalChanged(); - } - } - private global::System.Decimal _SubTotal; - partial void OnSubTotalChanging(global::System.Decimal value); - partial void OnSubTotalChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal TaxAmt - { - get - { - return _TaxAmt; - } - set - { - OnTaxAmtChanging(value); - _TaxAmt = value; - OnTaxAmtChanged(); - } - } - private global::System.Decimal _TaxAmt; - partial void OnTaxAmtChanging(global::System.Decimal value); - partial void OnTaxAmtChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal Freight - { - get - { - return _Freight; - } - set - { - OnFreightChanging(value); - _Freight = value; - OnFreightChanged(); - } - } - private global::System.Decimal _Freight; - partial void OnFreightChanging(global::System.Decimal value); - partial void OnFreightChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal TotalDue - { - get - { - return _TotalDue; - } - set - { - OnTotalDueChanging(value); - _TotalDue = value; - OnTotalDueChanged(); - } - } - private global::System.Decimal _TotalDue; - partial void OnTotalDueChanging(global::System.Decimal value); - partial void OnTotalDueChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Comment - { - get - { - return _Comment; - } - set - { - OnCommentChanging(value); - _Comment = value; - OnCommentChanged(); - } - } - private global::System.String _Comment; - partial void OnCommentChanging(global::System.String value); - partial void OnCommentChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Address Address - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference
AddressReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_BillToAddressID", "Address", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Address Address1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference
Address1Reference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_SalesOrderHeader_Address_ShipToAddressID", "Address", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Contact Contact - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Contact_ContactID", "Contact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ShipMethod ShipMethod - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ShipMethodReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "ShipMethod", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public CreditCard CreditCard - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CreditCardReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CreditCard_CreditCardID", "CreditCard", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public CurrencyRate CurrencyRate - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CurrencyRateReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_CurrencyRate_CurrencyRateID", "CurrencyRate", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Customer Customer - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CustomerReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_Customer_CustomerID", "Customer", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderDetails - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID", "SalesOrderDetail", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesPerson SalesPerson - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesPersonReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesPerson", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesTerritory SalesTerritory - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesTerritoryReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesTerritory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaderSalesReasons - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeaderSalesReason"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeaderSalesReason", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesOrderHeaderSalesReason - { - #region Factory Method - - /// - /// Create a new SalesOrderHeaderSalesReason object. - /// - /// Initial value of the SalesOrderID property. - /// Initial value of the SalesReasonID property. - /// Initial value of the ModifiedDate property. - public static SalesOrderHeaderSalesReason CreateSalesOrderHeaderSalesReason(global::System.Int32 salesOrderID, global::System.Int32 salesReasonID, global::System.DateTime modifiedDate) - { - SalesOrderHeaderSalesReason salesOrderHeaderSalesReason = new SalesOrderHeaderSalesReason(); - salesOrderHeaderSalesReason.SalesOrderID = salesOrderID; - salesOrderHeaderSalesReason.SalesReasonID = salesReasonID; - salesOrderHeaderSalesReason.ModifiedDate = modifiedDate; - return salesOrderHeaderSalesReason; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesOrderID - { - get - { - return _SalesOrderID; - } - set - { - if (_SalesOrderID != value) - { - OnSalesOrderIDChanging(value); - _SalesOrderID = value; - OnSalesOrderIDChanged(); - } - } - } - private global::System.Int32 _SalesOrderID; - partial void OnSalesOrderIDChanging(global::System.Int32 value); - partial void OnSalesOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesReasonID - { - get - { - return _SalesReasonID; - } - set - { - if (_SalesReasonID != value) - { - OnSalesReasonIDChanging(value); - _SalesReasonID = value; - OnSalesReasonIDChanged(); - } - } - } - private global::System.Int32 _SalesReasonID; - partial void OnSalesReasonIDChanging(global::System.Int32 value); - partial void OnSalesReasonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesOrderHeader SalesOrderHeader - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesOrderHeaderReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesOrderHeader_SalesOrderID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesReason SalesReason - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesReasonReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesReason", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesPerson - { - #region Factory Method - - /// - /// Create a new SalesPerson object. - /// - /// Initial value of the SalesPersonID property. - /// Initial value of the Bonus property. - /// Initial value of the CommissionPct property. - /// Initial value of the SalesYTD property. - /// Initial value of the SalesLastYear property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SalesPerson CreateSalesPerson(global::System.Int32 salesPersonID, global::System.Decimal bonus, global::System.Decimal commissionPct, global::System.Decimal salesYTD, global::System.Decimal salesLastYear, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SalesPerson salesPerson = new SalesPerson(); - salesPerson.SalesPersonID = salesPersonID; - salesPerson.Bonus = bonus; - salesPerson.CommissionPct = commissionPct; - salesPerson.SalesYTD = salesYTD; - salesPerson.SalesLastYear = salesLastYear; - salesPerson.rowguid = rowguid; - salesPerson.ModifiedDate = modifiedDate; - return salesPerson; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesPersonID - { - get - { - return _SalesPersonID; - } - set - { - if (_SalesPersonID != value) - { - OnSalesPersonIDChanging(value); - _SalesPersonID = value; - OnSalesPersonIDChanged(); - } - } - } - private global::System.Int32 _SalesPersonID; - partial void OnSalesPersonIDChanging(global::System.Int32 value); - partial void OnSalesPersonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable TerritoryID - { - get - { - return _TerritoryID; - } - set - { - OnTerritoryIDChanging(value); - _TerritoryID = value; - OnTerritoryIDChanged(); - } - } - private Nullable _TerritoryID; - partial void OnTerritoryIDChanging(Nullable value); - partial void OnTerritoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable SalesQuota - { - get - { - return _SalesQuota; - } - set - { - OnSalesQuotaChanging(value); - _SalesQuota = value; - OnSalesQuotaChanged(); - } - } - private Nullable _SalesQuota; - partial void OnSalesQuotaChanging(Nullable value); - partial void OnSalesQuotaChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal Bonus - { - get - { - return _Bonus; - } - set - { - OnBonusChanging(value); - _Bonus = value; - OnBonusChanged(); - } - } - private global::System.Decimal _Bonus; - partial void OnBonusChanging(global::System.Decimal value); - partial void OnBonusChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal CommissionPct - { - get - { - return _CommissionPct; - } - set - { - OnCommissionPctChanging(value); - _CommissionPct = value; - OnCommissionPctChanged(); - } - } - private global::System.Decimal _CommissionPct; - partial void OnCommissionPctChanging(global::System.Decimal value); - partial void OnCommissionPctChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal SalesYTD - { - get - { - return _SalesYTD; - } - set - { - OnSalesYTDChanging(value); - _SalesYTD = value; - OnSalesYTDChanged(); - } - } - private global::System.Decimal _SalesYTD; - partial void OnSalesYTDChanging(global::System.Decimal value); - partial void OnSalesYTDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal SalesLastYear - { - get - { - return _SalesLastYear; - } - set - { - OnSalesLastYearChanging(value); - _SalesLastYear = value; - OnSalesLastYearChanged(); - } - } - private global::System.Decimal _SalesLastYear; - partial void OnSalesLastYearChanging(global::System.Decimal value); - partial void OnSalesLastYearChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Employee Employee - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference EmployeeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPerson_Employee_SalesPersonID", "Employee", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesPerson_SalesPersonID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesTerritory SalesTerritory - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesTerritoryReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesTerritory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesPersonQuotaHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPersonQuotaHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPersonQuotaHistory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesTerritoryHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesTerritoryHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesTerritoryHistory", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Stores - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "Store"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "Store", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesPersonQuotaHistory - { - #region Factory Method - - /// - /// Create a new SalesPersonQuotaHistory object. - /// - /// Initial value of the SalesPersonID property. - /// Initial value of the QuotaDate property. - /// Initial value of the SalesQuota property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SalesPersonQuotaHistory CreateSalesPersonQuotaHistory(global::System.Int32 salesPersonID, global::System.DateTime quotaDate, global::System.Decimal salesQuota, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SalesPersonQuotaHistory salesPersonQuotaHistory = new SalesPersonQuotaHistory(); - salesPersonQuotaHistory.SalesPersonID = salesPersonID; - salesPersonQuotaHistory.QuotaDate = quotaDate; - salesPersonQuotaHistory.SalesQuota = salesQuota; - salesPersonQuotaHistory.rowguid = rowguid; - salesPersonQuotaHistory.ModifiedDate = modifiedDate; - return salesPersonQuotaHistory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesPersonID - { - get - { - return _SalesPersonID; - } - set - { - if (_SalesPersonID != value) - { - OnSalesPersonIDChanging(value); - _SalesPersonID = value; - OnSalesPersonIDChanged(); - } - } - } - private global::System.Int32 _SalesPersonID; - partial void OnSalesPersonIDChanging(global::System.Int32 value); - partial void OnSalesPersonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime QuotaDate - { - get - { - return _QuotaDate; - } - set - { - if (_QuotaDate != value) - { - OnQuotaDateChanging(value); - _QuotaDate = value; - OnQuotaDateChanged(); - } - } - } - private global::System.DateTime _QuotaDate; - partial void OnQuotaDateChanging(global::System.DateTime value); - partial void OnQuotaDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal SalesQuota - { - get - { - return _SalesQuota; - } - set - { - OnSalesQuotaChanging(value); - _SalesQuota = value; - OnSalesQuotaChanged(); - } - } - private global::System.Decimal _SalesQuota; - partial void OnSalesQuotaChanging(global::System.Decimal value); - partial void OnSalesQuotaChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesPerson SalesPerson - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesPersonReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesPersonQuotaHistory_SalesPerson_SalesPersonID", "SalesPerson", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesReason - { - #region Factory Method - - /// - /// Create a new SalesReason object. - /// - /// Initial value of the SalesReasonID property. - /// Initial value of the Name property. - /// Initial value of the ReasonType property. - /// Initial value of the ModifiedDate property. - public static SalesReason CreateSalesReason(global::System.Int32 salesReasonID, global::System.String name, global::System.String reasonType, global::System.DateTime modifiedDate) - { - SalesReason salesReason = new SalesReason(); - salesReason.SalesReasonID = salesReasonID; - salesReason.Name = name; - salesReason.ReasonType = reasonType; - salesReason.ModifiedDate = modifiedDate; - return salesReason; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesReasonID - { - get - { - return _SalesReasonID; - } - set - { - if (_SalesReasonID != value) - { - OnSalesReasonIDChanging(value); - _SalesReasonID = value; - OnSalesReasonIDChanged(); - } - } - } - private global::System.Int32 _SalesReasonID; - partial void OnSalesReasonIDChanging(global::System.Int32 value); - partial void OnSalesReasonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ReasonType - { - get - { - return _ReasonType; - } - set - { - OnReasonTypeChanging(value); - _ReasonType = value; - OnReasonTypeChanged(); - } - } - private global::System.String _ReasonType; - partial void OnReasonTypeChanging(global::System.String value); - partial void OnReasonTypeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaderSalesReasons - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesOrderHeaderSalesReason"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID", "SalesOrderHeaderSalesReason", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesTaxRate - { - #region Factory Method - - /// - /// Create a new SalesTaxRate object. - /// - /// Initial value of the SalesTaxRateID property. - /// Initial value of the StateProvinceID property. - /// Initial value of the TaxType property. - /// Initial value of the TaxRate property. - /// Initial value of the Name property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SalesTaxRate CreateSalesTaxRate(global::System.Int32 salesTaxRateID, global::System.Int32 stateProvinceID, global::System.Byte taxType, global::System.Decimal taxRate, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SalesTaxRate salesTaxRate = new SalesTaxRate(); - salesTaxRate.SalesTaxRateID = salesTaxRateID; - salesTaxRate.StateProvinceID = stateProvinceID; - salesTaxRate.TaxType = taxType; - salesTaxRate.TaxRate = taxRate; - salesTaxRate.Name = name; - salesTaxRate.rowguid = rowguid; - salesTaxRate.ModifiedDate = modifiedDate; - return salesTaxRate; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesTaxRateID - { - get - { - return _SalesTaxRateID; - } - set - { - if (_SalesTaxRateID != value) - { - OnSalesTaxRateIDChanging(value); - _SalesTaxRateID = value; - OnSalesTaxRateIDChanged(); - } - } - } - private global::System.Int32 _SalesTaxRateID; - partial void OnSalesTaxRateIDChanging(global::System.Int32 value); - partial void OnSalesTaxRateIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 StateProvinceID - { - get - { - return _StateProvinceID; - } - set - { - OnStateProvinceIDChanging(value); - _StateProvinceID = value; - OnStateProvinceIDChanged(); - } - } - private global::System.Int32 _StateProvinceID; - partial void OnStateProvinceIDChanging(global::System.Int32 value); - partial void OnStateProvinceIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte TaxType - { - get - { - return _TaxType; - } - set - { - OnTaxTypeChanging(value); - _TaxType = value; - OnTaxTypeChanged(); - } - } - private global::System.Byte _TaxType; - partial void OnTaxTypeChanging(global::System.Byte value); - partial void OnTaxTypeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal TaxRate - { - get - { - return _TaxRate; - } - set - { - OnTaxRateChanging(value); - _TaxRate = value; - OnTaxRateChanged(); - } - } - private global::System.Decimal _TaxRate; - partial void OnTaxRateChanging(global::System.Decimal value); - partial void OnTaxRateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public StateProvince StateProvince - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference StateProvinceReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "StateProvince", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesTerritory - { - #region Factory Method - - /// - /// Create a new SalesTerritory object. - /// - /// Initial value of the TerritoryID property. - /// Initial value of the Name property. - /// Initial value of the CountryRegionCode property. - /// Initial value of the Group property. - /// Initial value of the SalesYTD property. - /// Initial value of the SalesLastYear property. - /// Initial value of the CostYTD property. - /// Initial value of the CostLastYear property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SalesTerritory CreateSalesTerritory(global::System.Int32 territoryID, global::System.String name, global::System.String countryRegionCode, global::System.String group, global::System.Decimal salesYTD, global::System.Decimal salesLastYear, global::System.Decimal costYTD, global::System.Decimal costLastYear, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SalesTerritory salesTerritory = new SalesTerritory(); - salesTerritory.TerritoryID = territoryID; - salesTerritory.Name = name; - salesTerritory.CountryRegionCode = countryRegionCode; - salesTerritory.Group = group; - salesTerritory.SalesYTD = salesYTD; - salesTerritory.SalesLastYear = salesLastYear; - salesTerritory.CostYTD = costYTD; - salesTerritory.CostLastYear = costLastYear; - salesTerritory.rowguid = rowguid; - salesTerritory.ModifiedDate = modifiedDate; - return salesTerritory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 TerritoryID - { - get - { - return _TerritoryID; - } - set - { - if (_TerritoryID != value) - { - OnTerritoryIDChanging(value); - _TerritoryID = value; - OnTerritoryIDChanged(); - } - } - } - private global::System.Int32 _TerritoryID; - partial void OnTerritoryIDChanging(global::System.Int32 value); - partial void OnTerritoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CountryRegionCode - { - get - { - return _CountryRegionCode; - } - set - { - OnCountryRegionCodeChanging(value); - _CountryRegionCode = value; - OnCountryRegionCodeChanged(); - } - } - private global::System.String _CountryRegionCode; - partial void OnCountryRegionCodeChanging(global::System.String value); - partial void OnCountryRegionCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Group - { - get - { - return _Group; - } - set - { - OnGroupChanging(value); - _Group = value; - OnGroupChanged(); - } - } - private global::System.String _Group; - partial void OnGroupChanging(global::System.String value); - partial void OnGroupChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal SalesYTD - { - get - { - return _SalesYTD; - } - set - { - OnSalesYTDChanging(value); - _SalesYTD = value; - OnSalesYTDChanged(); - } - } - private global::System.Decimal _SalesYTD; - partial void OnSalesYTDChanging(global::System.Decimal value); - partial void OnSalesYTDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal SalesLastYear - { - get - { - return _SalesLastYear; - } - set - { - OnSalesLastYearChanging(value); - _SalesLastYear = value; - OnSalesLastYearChanged(); - } - } - private global::System.Decimal _SalesLastYear; - partial void OnSalesLastYearChanging(global::System.Decimal value); - partial void OnSalesLastYearChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal CostYTD - { - get - { - return _CostYTD; - } - set - { - OnCostYTDChanging(value); - _CostYTD = value; - OnCostYTDChanged(); - } - } - private global::System.Decimal _CostYTD; - partial void OnCostYTDChanging(global::System.Decimal value); - partial void OnCostYTDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal CostLastYear - { - get - { - return _CostLastYear; - } - set - { - OnCostLastYearChanging(value); - _CostLastYear = value; - OnCostLastYearChanged(); - } - } - private global::System.Decimal _CostLastYear; - partial void OnCostLastYearChanging(global::System.Decimal value); - partial void OnCostLastYearChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection StateProvinces - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "StateProvince"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "StateProvince", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Customers - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "Customer"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Customer_SalesTerritory_TerritoryID", "Customer", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_SalesTerritory_TerritoryID", "SalesOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesPersons - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesPerson"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesPerson_SalesTerritory_TerritoryID", "SalesPerson", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesTerritoryHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritoryHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritoryHistory", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SalesTerritoryHistory - { - #region Factory Method - - /// - /// Create a new SalesTerritoryHistory object. - /// - /// Initial value of the SalesPersonID property. - /// Initial value of the TerritoryID property. - /// Initial value of the StartDate property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SalesTerritoryHistory CreateSalesTerritoryHistory(global::System.Int32 salesPersonID, global::System.Int32 territoryID, global::System.DateTime startDate, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SalesTerritoryHistory salesTerritoryHistory = new SalesTerritoryHistory(); - salesTerritoryHistory.SalesPersonID = salesPersonID; - salesTerritoryHistory.TerritoryID = territoryID; - salesTerritoryHistory.StartDate = startDate; - salesTerritoryHistory.rowguid = rowguid; - salesTerritoryHistory.ModifiedDate = modifiedDate; - return salesTerritoryHistory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SalesPersonID - { - get - { - return _SalesPersonID; - } - set - { - if (_SalesPersonID != value) - { - OnSalesPersonIDChanging(value); - _SalesPersonID = value; - OnSalesPersonIDChanged(); - } - } - } - private global::System.Int32 _SalesPersonID; - partial void OnSalesPersonIDChanging(global::System.Int32 value); - partial void OnSalesPersonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 TerritoryID - { - get - { - return _TerritoryID; - } - set - { - if (_TerritoryID != value) - { - OnTerritoryIDChanging(value); - _TerritoryID = value; - OnTerritoryIDChanged(); - } - } - } - private global::System.Int32 _TerritoryID; - partial void OnTerritoryIDChanging(global::System.Int32 value); - partial void OnTerritoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartDate - { - get - { - return _StartDate; - } - set - { - if (_StartDate != value) - { - OnStartDateChanging(value); - _StartDate = value; - OnStartDateChanged(); - } - } - } - private global::System.DateTime _StartDate; - partial void OnStartDateChanging(global::System.DateTime value); - partial void OnStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable EndDate - { - get - { - return _EndDate; - } - set - { - OnEndDateChanging(value); - _EndDate = value; - OnEndDateChanged(); - } - } - private Nullable _EndDate; - partial void OnEndDateChanging(Nullable value); - partial void OnEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesPerson SalesPerson - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesPersonReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesPerson_SalesPersonID", "SalesPerson", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesTerritory SalesTerritory - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesTerritoryReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SalesTerritoryHistory_SalesTerritory_TerritoryID", "SalesTerritory", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ScrapReason - { - #region Factory Method - - /// - /// Create a new ScrapReason object. - /// - /// Initial value of the ScrapReasonID property. - /// Initial value of the Name property. - /// Initial value of the ModifiedDate property. - public static ScrapReason CreateScrapReason(global::System.Int16 scrapReasonID, global::System.String name, global::System.DateTime modifiedDate) - { - ScrapReason scrapReason = new ScrapReason(); - scrapReason.ScrapReasonID = scrapReasonID; - scrapReason.Name = name; - scrapReason.ModifiedDate = modifiedDate; - return scrapReason; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 ScrapReasonID - { - get - { - return _ScrapReasonID; - } - set - { - if (_ScrapReasonID != value) - { - OnScrapReasonIDChanging(value); - _ScrapReasonID = value; - OnScrapReasonIDChanged(); - } - } - } - private global::System.Int16 _ScrapReasonID; - partial void OnScrapReasonIDChanging(global::System.Int16 value); - partial void OnScrapReasonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection WorkOrders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "WorkOrder"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "WorkOrder", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Shift - { - #region Factory Method - - /// - /// Create a new Shift object. - /// - /// Initial value of the ShiftID property. - /// Initial value of the Name property. - /// Initial value of the StartTime property. - /// Initial value of the EndTime property. - /// Initial value of the ModifiedDate property. - public static Shift CreateShift(global::System.Byte shiftID, global::System.String name, global::System.DateTime startTime, global::System.DateTime endTime, global::System.DateTime modifiedDate) - { - Shift shift = new Shift(); - shift.ShiftID = shiftID; - shift.Name = name; - shift.StartTime = startTime; - shift.EndTime = endTime; - shift.ModifiedDate = modifiedDate; - return shift; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte ShiftID - { - get - { - return _ShiftID; - } - set - { - if (_ShiftID != value) - { - OnShiftIDChanging(value); - _ShiftID = value; - OnShiftIDChanged(); - } - } - } - private global::System.Byte _ShiftID; - partial void OnShiftIDChanging(global::System.Byte value); - partial void OnShiftIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartTime - { - get - { - return _StartTime; - } - set - { - OnStartTimeChanging(value); - _StartTime = value; - OnStartTimeChanged(); - } - } - private global::System.DateTime _StartTime; - partial void OnStartTimeChanging(global::System.DateTime value); - partial void OnStartTimeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime EndTime - { - get - { - return _EndTime; - } - set - { - OnEndTimeChanging(value); - _EndTime = value; - OnEndTimeChanged(); - } - } - private global::System.DateTime _EndTime; - partial void OnEndTimeChanging(global::System.DateTime value); - partial void OnEndTimeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection EmployeeDepartmentHistories - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "EmployeeDepartmentHistory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_EmployeeDepartmentHistory_Shift_ShiftID", "EmployeeDepartmentHistory", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ShipMethod - { - #region Factory Method - - /// - /// Create a new ShipMethod object. - /// - /// Initial value of the ShipMethodID property. - /// Initial value of the Name property. - /// Initial value of the ShipBase property. - /// Initial value of the ShipRate property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static ShipMethod CreateShipMethod(global::System.Int32 shipMethodID, global::System.String name, global::System.Decimal shipBase, global::System.Decimal shipRate, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - ShipMethod shipMethod = new ShipMethod(); - shipMethod.ShipMethodID = shipMethodID; - shipMethod.Name = name; - shipMethod.ShipBase = shipBase; - shipMethod.ShipRate = shipRate; - shipMethod.rowguid = rowguid; - shipMethod.ModifiedDate = modifiedDate; - return shipMethod; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ShipMethodID - { - get - { - return _ShipMethodID; - } - set - { - if (_ShipMethodID != value) - { - OnShipMethodIDChanging(value); - _ShipMethodID = value; - OnShipMethodIDChanged(); - } - } - } - private global::System.Int32 _ShipMethodID; - partial void OnShipMethodIDChanging(global::System.Int32 value); - partial void OnShipMethodIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal ShipBase - { - get - { - return _ShipBase; - } - set - { - OnShipBaseChanging(value); - _ShipBase = value; - OnShipBaseChanged(); - } - } - private global::System.Decimal _ShipBase; - partial void OnShipBaseChanging(global::System.Decimal value); - partial void OnShipBaseChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal ShipRate - { - get - { - return _ShipRate; - } - set - { - OnShipRateChanging(value); - _ShipRate = value; - OnShipRateChanged(); - } - } - private global::System.Decimal _ShipRate; - partial void OnShipRateChanging(global::System.Decimal value); - partial void OnShipRateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection PurchaseOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "PurchaseOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_ShipMethod_ShipMethodID", "PurchaseOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "SalesOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderHeader_ShipMethod_ShipMethodID", "SalesOrderHeader", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class ShoppingCartItem - { - #region Factory Method - - /// - /// Create a new ShoppingCartItem object. - /// - /// Initial value of the ShoppingCartItemID property. - /// Initial value of the ShoppingCartID property. - /// Initial value of the Quantity property. - /// Initial value of the ProductID property. - /// Initial value of the DateCreated property. - /// Initial value of the ModifiedDate property. - public static ShoppingCartItem CreateShoppingCartItem(global::System.Int32 shoppingCartItemID, global::System.String shoppingCartID, global::System.Int32 quantity, global::System.Int32 productID, global::System.DateTime dateCreated, global::System.DateTime modifiedDate) - { - ShoppingCartItem shoppingCartItem = new ShoppingCartItem(); - shoppingCartItem.ShoppingCartItemID = shoppingCartItemID; - shoppingCartItem.ShoppingCartID = shoppingCartID; - shoppingCartItem.Quantity = quantity; - shoppingCartItem.ProductID = productID; - shoppingCartItem.DateCreated = dateCreated; - shoppingCartItem.ModifiedDate = modifiedDate; - return shoppingCartItem; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ShoppingCartItemID - { - get - { - return _ShoppingCartItemID; - } - set - { - if (_ShoppingCartItemID != value) - { - OnShoppingCartItemIDChanging(value); - _ShoppingCartItemID = value; - OnShoppingCartItemIDChanged(); - } - } - } - private global::System.Int32 _ShoppingCartItemID; - partial void OnShoppingCartItemIDChanging(global::System.Int32 value); - partial void OnShoppingCartItemIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String ShoppingCartID - { - get - { - return _ShoppingCartID; - } - set - { - OnShoppingCartIDChanging(value); - _ShoppingCartID = value; - OnShoppingCartIDChanged(); - } - } - private global::System.String _ShoppingCartID; - partial void OnShoppingCartIDChanging(global::System.String value); - partial void OnShoppingCartIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 Quantity - { - get - { - return _Quantity; - } - set - { - OnQuantityChanging(value); - _Quantity = value; - OnQuantityChanged(); - } - } - private global::System.Int32 _Quantity; - partial void OnQuantityChanging(global::System.Int32 value); - partial void OnQuantityChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime DateCreated - { - get - { - return _DateCreated; - } - set - { - OnDateCreatedChanging(value); - _DateCreated = value; - OnDateCreatedChanged(); - } - } - private global::System.DateTime _DateCreated; - partial void OnDateCreatedChanging(global::System.DateTime value); - partial void OnDateCreatedChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_ShoppingCartItem_Product_ProductID", "Product", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SpecialOffer - { - #region Factory Method - - /// - /// Create a new SpecialOffer object. - /// - /// Initial value of the SpecialOfferID property. - /// Initial value of the Description property. - /// Initial value of the DiscountPct property. - /// Initial value of the Type property. - /// Initial value of the Category property. - /// Initial value of the StartDate property. - /// Initial value of the EndDate property. - /// Initial value of the MinQty property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SpecialOffer CreateSpecialOffer(global::System.Int32 specialOfferID, global::System.String description, global::System.Decimal discountPct, global::System.String type, global::System.String category, global::System.DateTime startDate, global::System.DateTime endDate, global::System.Int32 minQty, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SpecialOffer specialOffer = new SpecialOffer(); - specialOffer.SpecialOfferID = specialOfferID; - specialOffer.Description = description; - specialOffer.DiscountPct = discountPct; - specialOffer.Type = type; - specialOffer.Category = category; - specialOffer.StartDate = startDate; - specialOffer.EndDate = endDate; - specialOffer.MinQty = minQty; - specialOffer.rowguid = rowguid; - specialOffer.ModifiedDate = modifiedDate; - return specialOffer; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SpecialOfferID - { - get - { - return _SpecialOfferID; - } - set - { - if (_SpecialOfferID != value) - { - OnSpecialOfferIDChanging(value); - _SpecialOfferID = value; - OnSpecialOfferIDChanged(); - } - } - } - private global::System.Int32 _SpecialOfferID; - partial void OnSpecialOfferIDChanging(global::System.Int32 value); - partial void OnSpecialOfferIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Description - { - get - { - return _Description; - } - set - { - OnDescriptionChanging(value); - _Description = value; - OnDescriptionChanged(); - } - } - private global::System.String _Description; - partial void OnDescriptionChanging(global::System.String value); - partial void OnDescriptionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal DiscountPct - { - get - { - return _DiscountPct; - } - set - { - OnDiscountPctChanging(value); - _DiscountPct = value; - OnDiscountPctChanged(); - } - } - private global::System.Decimal _DiscountPct; - partial void OnDiscountPctChanging(global::System.Decimal value); - partial void OnDiscountPctChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Type - { - get - { - return _Type; - } - set - { - OnTypeChanging(value); - _Type = value; - OnTypeChanged(); - } - } - private global::System.String _Type; - partial void OnTypeChanging(global::System.String value); - partial void OnTypeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Category - { - get - { - return _Category; - } - set - { - OnCategoryChanging(value); - _Category = value; - OnCategoryChanged(); - } - } - private global::System.String _Category; - partial void OnCategoryChanging(global::System.String value); - partial void OnCategoryChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartDate - { - get - { - return _StartDate; - } - set - { - OnStartDateChanging(value); - _StartDate = value; - OnStartDateChanged(); - } - } - private global::System.DateTime _StartDate; - partial void OnStartDateChanging(global::System.DateTime value); - partial void OnStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime EndDate - { - get - { - return _EndDate; - } - set - { - OnEndDateChanging(value); - _EndDate = value; - OnEndDateChanged(); - } - } - private global::System.DateTime _EndDate; - partial void OnEndDateChanging(global::System.DateTime value); - partial void OnEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 MinQty - { - get - { - return _MinQty; - } - set - { - OnMinQtyChanging(value); - _MinQty = value; - OnMinQtyChanged(); - } - } - private global::System.Int32 _MinQty; - partial void OnMinQtyChanging(global::System.Int32 value); - partial void OnMinQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable MaxQty - { - get - { - return _MaxQty; - } - set - { - OnMaxQtyChanging(value); - _MaxQty = value; - OnMaxQtyChanged(); - } - } - private Nullable _MaxQty; - partial void OnMaxQtyChanging(Nullable value); - partial void OnMaxQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SpecialOfferProducts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOfferProduct"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOfferProduct", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class SpecialOfferProduct - { - #region Factory Method - - /// - /// Create a new SpecialOfferProduct object. - /// - /// Initial value of the SpecialOfferID property. - /// Initial value of the ProductID property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static SpecialOfferProduct CreateSpecialOfferProduct(global::System.Int32 specialOfferID, global::System.Int32 productID, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - SpecialOfferProduct specialOfferProduct = new SpecialOfferProduct(); - specialOfferProduct.SpecialOfferID = specialOfferID; - specialOfferProduct.ProductID = productID; - specialOfferProduct.rowguid = rowguid; - specialOfferProduct.ModifiedDate = modifiedDate; - return specialOfferProduct; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 SpecialOfferID - { - get - { - return _SpecialOfferID; - } - set - { - if (_SpecialOfferID != value) - { - OnSpecialOfferIDChanging(value); - _SpecialOfferID = value; - OnSpecialOfferIDChanged(); - } - } - } - private global::System.Int32 _SpecialOfferID; - partial void OnSpecialOfferIDChanging(global::System.Int32 value); - partial void OnSpecialOfferIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_Product_ProductID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesOrderDetails - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SalesOrderDetail"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesOrderDetail_SpecialOfferProduct_SpecialOfferIDProductID", "SalesOrderDetail", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SpecialOffer SpecialOffer - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SpecialOfferReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_SpecialOfferProduct_SpecialOffer_SpecialOfferID", "SpecialOffer", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class StateProvince - { - #region Factory Method - - /// - /// Create a new StateProvince object. - /// - /// Initial value of the StateProvinceID property. - /// Initial value of the StateProvinceCode property. - /// Initial value of the CountryRegionCode property. - /// Initial value of the IsOnlyStateProvinceFlag property. - /// Initial value of the Name property. - /// Initial value of the TerritoryID property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static StateProvince CreateStateProvince(global::System.Int32 stateProvinceID, global::System.String stateProvinceCode, global::System.String countryRegionCode, global::System.Boolean isOnlyStateProvinceFlag, global::System.String name, global::System.Int32 territoryID, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - StateProvince stateProvince = new StateProvince(); - stateProvince.StateProvinceID = stateProvinceID; - stateProvince.StateProvinceCode = stateProvinceCode; - stateProvince.CountryRegionCode = countryRegionCode; - stateProvince.IsOnlyStateProvinceFlag = isOnlyStateProvinceFlag; - stateProvince.Name = name; - stateProvince.TerritoryID = territoryID; - stateProvince.rowguid = rowguid; - stateProvince.ModifiedDate = modifiedDate; - return stateProvince; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 StateProvinceID - { - get - { - return _StateProvinceID; - } - set - { - if (_StateProvinceID != value) - { - OnStateProvinceIDChanging(value); - _StateProvinceID = value; - OnStateProvinceIDChanged(); - } - } - } - private global::System.Int32 _StateProvinceID; - partial void OnStateProvinceIDChanging(global::System.Int32 value); - partial void OnStateProvinceIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String StateProvinceCode - { - get - { - return _StateProvinceCode; - } - set - { - OnStateProvinceCodeChanging(value); - _StateProvinceCode = value; - OnStateProvinceCodeChanged(); - } - } - private global::System.String _StateProvinceCode; - partial void OnStateProvinceCodeChanging(global::System.String value); - partial void OnStateProvinceCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String CountryRegionCode - { - get - { - return _CountryRegionCode; - } - set - { - OnCountryRegionCodeChanging(value); - _CountryRegionCode = value; - OnCountryRegionCodeChanged(); - } - } - private global::System.String _CountryRegionCode; - partial void OnCountryRegionCodeChanging(global::System.String value); - partial void OnCountryRegionCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean IsOnlyStateProvinceFlag - { - get - { - return _IsOnlyStateProvinceFlag; - } - set - { - OnIsOnlyStateProvinceFlagChanging(value); - _IsOnlyStateProvinceFlag = value; - OnIsOnlyStateProvinceFlagChanged(); - } - } - private global::System.Boolean _IsOnlyStateProvinceFlag; - partial void OnIsOnlyStateProvinceFlagChanging(global::System.Boolean value); - partial void OnIsOnlyStateProvinceFlagChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 TerritoryID - { - get - { - return _TerritoryID; - } - set - { - OnTerritoryIDChanging(value); - _TerritoryID = value; - OnTerritoryIDChanged(); - } - } - private global::System.Int32 _TerritoryID; - partial void OnTerritoryIDChanging(global::System.Int32 value); - partial void OnTerritoryIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection
Addresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection
("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "Address"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection
("AdventureWorksModel.FK_Address_StateProvince_StateProvinceID", "Address", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public CountryRegion CountryRegion - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CountryRegionReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StateProvince_CountryRegion_CountryRegionCode", "CountryRegion", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection SalesTaxRates - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "SalesTaxRate"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_SalesTaxRate_StateProvince_StateProvinceID", "SalesTaxRate", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesTerritory SalesTerritory - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesTerritoryReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StateProvince_SalesTerritory_TerritoryID", "SalesTerritory", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Store - { - #region Factory Method - - /// - /// Create a new Store object. - /// - /// Initial value of the CustomerID property. - /// Initial value of the Name property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static Store CreateStore(global::System.Int32 customerID, global::System.String name, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - Store store = new Store(); - store.CustomerID = customerID; - store.Name = name; - store.rowguid = rowguid; - store.ModifiedDate = modifiedDate; - return store; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CustomerID - { - get - { - return _CustomerID; - } - set - { - if (_CustomerID != value) - { - OnCustomerIDChanging(value); - _CustomerID = value; - OnCustomerIDChanged(); - } - } - } - private global::System.Int32 _CustomerID; - partial void OnCustomerIDChanging(global::System.Int32 value); - partial void OnCustomerIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable SalesPersonID - { - get - { - return _SalesPersonID; - } - set - { - OnSalesPersonIDChanging(value); - _SalesPersonID = value; - OnSalesPersonIDChanged(); - } - } - private Nullable _SalesPersonID; - partial void OnSalesPersonIDChanging(Nullable value); - partial void OnSalesPersonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Demographics - { - get - { - return _Demographics; - } - set - { - OnDemographicsChanging(value); - _Demographics = value; - OnDemographicsChanged(); - } - } - private global::System.String _Demographics; - partial void OnDemographicsChanging(global::System.String value); - partial void OnDemographicsChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Customer Customer - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference CustomerReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Store_Customer_CustomerID", "Customer", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public SalesPerson SalesPerson - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference SalesPersonReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_Store_SalesPerson_SalesPersonID", "SalesPerson", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection StoreContacts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "StoreContact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "StoreContact", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class StoreContact - { - #region Factory Method - - /// - /// Create a new StoreContact object. - /// - /// Initial value of the CustomerID property. - /// Initial value of the ContactID property. - /// Initial value of the ContactTypeID property. - /// Initial value of the rowguid property. - /// Initial value of the ModifiedDate property. - public static StoreContact CreateStoreContact(global::System.Int32 customerID, global::System.Int32 contactID, global::System.Int32 contactTypeID, global::System.Guid rowguid, global::System.DateTime modifiedDate) - { - StoreContact storeContact = new StoreContact(); - storeContact.CustomerID = customerID; - storeContact.ContactID = contactID; - storeContact.ContactTypeID = contactTypeID; - storeContact.rowguid = rowguid; - storeContact.ModifiedDate = modifiedDate; - return storeContact; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 CustomerID - { - get - { - return _CustomerID; - } - set - { - if (_CustomerID != value) - { - OnCustomerIDChanging(value); - _CustomerID = value; - OnCustomerIDChanged(); - } - } - } - private global::System.Int32 _CustomerID; - partial void OnCustomerIDChanging(global::System.Int32 value); - partial void OnCustomerIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactID - { - get - { - return _ContactID; - } - set - { - if (_ContactID != value) - { - OnContactIDChanging(value); - _ContactID = value; - OnContactIDChanged(); - } - } - } - private global::System.Int32 _ContactID; - partial void OnContactIDChanging(global::System.Int32 value); - partial void OnContactIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactTypeID - { - get - { - return _ContactTypeID; - } - set - { - OnContactTypeIDChanging(value); - _ContactTypeID = value; - OnContactTypeIDChanged(); - } - } - private global::System.Int32 _ContactTypeID; - partial void OnContactTypeIDChanging(global::System.Int32 value); - partial void OnContactTypeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Guid rowguid - { - get - { - return _rowguid; - } - set - { - OnrowguidChanging(value); - _rowguid = value; - OnrowguidChanged(); - } - } - private global::System.Guid _rowguid; - partial void OnrowguidChanging(global::System.Guid value); - partial void OnrowguidChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Contact Contact - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StoreContact_Contact_ContactID", "Contact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ContactType ContactType - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactTypeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StoreContact_ContactType_ContactTypeID", "ContactType", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Store Store - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference StoreReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_StoreContact_Store_CustomerID", "Store", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class sysdiagram - { - #region Factory Method - - /// - /// Create a new sysdiagram object. - /// - /// Initial value of the name property. - /// Initial value of the principal_id property. - /// Initial value of the diagram_id property. - public static sysdiagram Createsysdiagram(global::System.String name, global::System.Int32 principal_id, global::System.Int32 diagram_id) - { - sysdiagram sysdiagram = new sysdiagram(); - sysdiagram.name = name; - sysdiagram.principal_id = principal_id; - sysdiagram.diagram_id = diagram_id; - return sysdiagram; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String name - { - get - { - return _name; - } - set - { - OnnameChanging(value); - _name = value; - OnnameChanged(); - } - } - private global::System.String _name; - partial void OnnameChanging(global::System.String value); - partial void OnnameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 principal_id - { - get - { - return _principal_id; - } - set - { - Onprincipal_idChanging(value); - _principal_id = value; - Onprincipal_idChanged(); - } - } - private global::System.Int32 _principal_id; - partial void Onprincipal_idChanging(global::System.Int32 value); - partial void Onprincipal_idChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 diagram_id - { - get - { - return _diagram_id; - } - set - { - if (_diagram_id != value) - { - Ondiagram_idChanging(value); - _diagram_id = value; - Ondiagram_idChanged(); - } - } - } - private global::System.Int32 _diagram_id; - partial void Ondiagram_idChanging(global::System.Int32 value); - partial void Ondiagram_idChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable version - { - get - { - return _version; - } - set - { - OnversionChanging(value); - _version = value; - OnversionChanged(); - } - } - private Nullable _version; - partial void OnversionChanging(Nullable value); - partial void OnversionChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte[] definition - { - get - { - return value; - } - set - { - OndefinitionChanging(value); - _definition = value; - OndefinitionChanged(); - } - } - private global::System.Byte[] _definition; - partial void OndefinitionChanging(global::System.Byte[] value); - partial void OndefinitionChanged(); - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class TransactionHistory - { - #region Factory Method - - /// - /// Create a new TransactionHistory object. - /// - /// Initial value of the TransactionID property. - /// Initial value of the ProductID property. - /// Initial value of the ReferenceOrderID property. - /// Initial value of the ReferenceOrderLineID property. - /// Initial value of the TransactionDate property. - /// Initial value of the TransactionType property. - /// Initial value of the Quantity property. - /// Initial value of the ActualCost property. - /// Initial value of the ModifiedDate property. - public static TransactionHistory CreateTransactionHistory(global::System.Int32 transactionID, global::System.Int32 productID, global::System.Int32 referenceOrderID, global::System.Int32 referenceOrderLineID, global::System.DateTime transactionDate, global::System.String transactionType, global::System.Int32 quantity, global::System.Decimal actualCost, global::System.DateTime modifiedDate) - { - TransactionHistory transactionHistory = new TransactionHistory(); - transactionHistory.TransactionID = transactionID; - transactionHistory.ProductID = productID; - transactionHistory.ReferenceOrderID = referenceOrderID; - transactionHistory.ReferenceOrderLineID = referenceOrderLineID; - transactionHistory.TransactionDate = transactionDate; - transactionHistory.TransactionType = transactionType; - transactionHistory.Quantity = quantity; - transactionHistory.ActualCost = actualCost; - transactionHistory.ModifiedDate = modifiedDate; - return transactionHistory; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 TransactionID - { - get - { - return _TransactionID; - } - set - { - if (_TransactionID != value) - { - OnTransactionIDChanging(value); - _TransactionID = value; - OnTransactionIDChanged(); - } - } - } - private global::System.Int32 _TransactionID; - partial void OnTransactionIDChanging(global::System.Int32 value); - partial void OnTransactionIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ReferenceOrderID - { - get - { - return _ReferenceOrderID; - } - set - { - OnReferenceOrderIDChanging(value); - _ReferenceOrderID = value; - OnReferenceOrderIDChanged(); - } - } - private global::System.Int32 _ReferenceOrderID; - partial void OnReferenceOrderIDChanging(global::System.Int32 value); - partial void OnReferenceOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ReferenceOrderLineID - { - get - { - return _ReferenceOrderLineID; - } - set - { - OnReferenceOrderLineIDChanging(value); - _ReferenceOrderLineID = value; - OnReferenceOrderLineIDChanged(); - } - } - private global::System.Int32 _ReferenceOrderLineID; - partial void OnReferenceOrderLineIDChanging(global::System.Int32 value); - partial void OnReferenceOrderLineIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime TransactionDate - { - get - { - return _TransactionDate; - } - set - { - OnTransactionDateChanging(value); - _TransactionDate = value; - OnTransactionDateChanged(); - } - } - private global::System.DateTime _TransactionDate; - partial void OnTransactionDateChanging(global::System.DateTime value); - partial void OnTransactionDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String TransactionType - { - get - { - return _TransactionType; - } - set - { - OnTransactionTypeChanging(value); - _TransactionType = value; - OnTransactionTypeChanged(); - } - } - private global::System.String _TransactionType; - partial void OnTransactionTypeChanging(global::System.String value); - partial void OnTransactionTypeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 Quantity - { - get - { - return _Quantity; - } - set - { - OnQuantityChanging(value); - _Quantity = value; - OnQuantityChanged(); - } - } - private global::System.Int32 _Quantity; - partial void OnQuantityChanging(global::System.Int32 value); - partial void OnQuantityChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal ActualCost - { - get - { - return _ActualCost; - } - set - { - OnActualCostChanging(value); - _ActualCost = value; - OnActualCostChanged(); - } - } - private global::System.Decimal _ActualCost; - partial void OnActualCostChanging(global::System.Decimal value); - partial void OnActualCostChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_TransactionHistory_Product_ProductID", "Product", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class TransactionHistoryArchive - { - #region Factory Method - - /// - /// Create a new TransactionHistoryArchive object. - /// - /// Initial value of the TransactionID property. - /// Initial value of the ProductID property. - /// Initial value of the ReferenceOrderID property. - /// Initial value of the ReferenceOrderLineID property. - /// Initial value of the TransactionDate property. - /// Initial value of the TransactionType property. - /// Initial value of the Quantity property. - /// Initial value of the ActualCost property. - /// Initial value of the ModifiedDate property. - public static TransactionHistoryArchive CreateTransactionHistoryArchive(global::System.Int32 transactionID, global::System.Int32 productID, global::System.Int32 referenceOrderID, global::System.Int32 referenceOrderLineID, global::System.DateTime transactionDate, global::System.String transactionType, global::System.Int32 quantity, global::System.Decimal actualCost, global::System.DateTime modifiedDate) - { - TransactionHistoryArchive transactionHistoryArchive = new TransactionHistoryArchive(); - transactionHistoryArchive.TransactionID = transactionID; - transactionHistoryArchive.ProductID = productID; - transactionHistoryArchive.ReferenceOrderID = referenceOrderID; - transactionHistoryArchive.ReferenceOrderLineID = referenceOrderLineID; - transactionHistoryArchive.TransactionDate = transactionDate; - transactionHistoryArchive.TransactionType = transactionType; - transactionHistoryArchive.Quantity = quantity; - transactionHistoryArchive.ActualCost = actualCost; - transactionHistoryArchive.ModifiedDate = modifiedDate; - return transactionHistoryArchive; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 TransactionID - { - get - { - return _TransactionID; - } - set - { - if (_TransactionID != value) - { - OnTransactionIDChanging(value); - _TransactionID = value; - OnTransactionIDChanged(); - } - } - } - private global::System.Int32 _TransactionID; - partial void OnTransactionIDChanging(global::System.Int32 value); - partial void OnTransactionIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ReferenceOrderID - { - get - { - return _ReferenceOrderID; - } - set - { - OnReferenceOrderIDChanging(value); - _ReferenceOrderID = value; - OnReferenceOrderIDChanged(); - } - } - private global::System.Int32 _ReferenceOrderID; - partial void OnReferenceOrderIDChanging(global::System.Int32 value); - partial void OnReferenceOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ReferenceOrderLineID - { - get - { - return _ReferenceOrderLineID; - } - set - { - OnReferenceOrderLineIDChanging(value); - _ReferenceOrderLineID = value; - OnReferenceOrderLineIDChanged(); - } - } - private global::System.Int32 _ReferenceOrderLineID; - partial void OnReferenceOrderLineIDChanging(global::System.Int32 value); - partial void OnReferenceOrderLineIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime TransactionDate - { - get - { - return _TransactionDate; - } - set - { - OnTransactionDateChanging(value); - _TransactionDate = value; - OnTransactionDateChanged(); - } - } - private global::System.DateTime _TransactionDate; - partial void OnTransactionDateChanging(global::System.DateTime value); - partial void OnTransactionDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String TransactionType - { - get - { - return _TransactionType; - } - set - { - OnTransactionTypeChanging(value); - _TransactionType = value; - OnTransactionTypeChanged(); - } - } - private global::System.String _TransactionType; - partial void OnTransactionTypeChanging(global::System.String value); - partial void OnTransactionTypeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 Quantity - { - get - { - return _Quantity; - } - set - { - OnQuantityChanging(value); - _Quantity = value; - OnQuantityChanged(); - } - } - private global::System.Int32 _Quantity; - partial void OnQuantityChanging(global::System.Int32 value); - partial void OnQuantityChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal ActualCost - { - get - { - return _ActualCost; - } - set - { - OnActualCostChanging(value); - _ActualCost = value; - OnActualCostChanged(); - } - } - private global::System.Decimal _ActualCost; - partial void OnActualCostChanging(global::System.Decimal value); - partial void OnActualCostChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class UnitMeasure - { - #region Factory Method - - /// - /// Create a new UnitMeasure object. - /// - /// Initial value of the UnitMeasureCode property. - /// Initial value of the Name property. - /// Initial value of the ModifiedDate property. - public static UnitMeasure CreateUnitMeasure(global::System.String unitMeasureCode, global::System.String name, global::System.DateTime modifiedDate) - { - UnitMeasure unitMeasure = new UnitMeasure(); - unitMeasure.UnitMeasureCode = unitMeasureCode; - unitMeasure.Name = name; - unitMeasure.ModifiedDate = modifiedDate; - return unitMeasure; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String UnitMeasureCode - { - get - { - return _UnitMeasureCode; - } - set - { - if (_UnitMeasureCode != value) - { - OnUnitMeasureCodeChanging(value); - _UnitMeasureCode = value; - OnUnitMeasureCodeChanged(); - } - } - } - private global::System.String _UnitMeasureCode; - partial void OnUnitMeasureCodeChanging(global::System.String value); - partial void OnUnitMeasureCodeChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection BillOfMaterials - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "BillOfMaterials"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_BillOfMaterials_UnitMeasure_UnitMeasureCode", "BillOfMaterials", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Products - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_SizeUnitMeasureCode", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection Products1 - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_Product_UnitMeasure_WeightUnitMeasureCode", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductVendors - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "ProductVendor"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductVendor_UnitMeasure_UnitMeasureCode", "ProductVendor", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class Vendor - { - #region Factory Method - - /// - /// Create a new Vendor object. - /// - /// Initial value of the VendorID property. - /// Initial value of the AccountNumber property. - /// Initial value of the Name property. - /// Initial value of the CreditRating property. - /// Initial value of the PreferredVendorStatus property. - /// Initial value of the ActiveFlag property. - /// Initial value of the ModifiedDate property. - public static Vendor CreateVendor(global::System.Int32 vendorID, global::System.String accountNumber, global::System.String name, global::System.Byte creditRating, global::System.Boolean preferredVendorStatus, global::System.Boolean activeFlag, global::System.DateTime modifiedDate) - { - Vendor vendor = new Vendor(); - vendor.VendorID = vendorID; - vendor.AccountNumber = accountNumber; - vendor.Name = name; - vendor.CreditRating = creditRating; - vendor.PreferredVendorStatus = preferredVendorStatus; - vendor.ActiveFlag = activeFlag; - vendor.ModifiedDate = modifiedDate; - return vendor; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 VendorID - { - get - { - return _VendorID; - } - set - { - if (_VendorID != value) - { - OnVendorIDChanging(value); - _VendorID = value; - OnVendorIDChanged(); - } - } - } - private global::System.Int32 _VendorID; - partial void OnVendorIDChanging(global::System.Int32 value); - partial void OnVendorIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String AccountNumber - { - get - { - return _AccountNumber; - } - set - { - OnAccountNumberChanging(value); - _AccountNumber = value; - OnAccountNumberChanged(); - } - } - private global::System.String _AccountNumber; - partial void OnAccountNumberChanging(global::System.String value); - partial void OnAccountNumberChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String Name - { - get - { - return _Name; - } - set - { - OnNameChanging(value); - _Name = value; - OnNameChanged(); - } - } - private global::System.String _Name; - partial void OnNameChanging(global::System.String value); - partial void OnNameChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Byte CreditRating - { - get - { - return _CreditRating; - } - set - { - OnCreditRatingChanging(value); - _CreditRating = value; - OnCreditRatingChanged(); - } - } - private global::System.Byte _CreditRating; - partial void OnCreditRatingChanging(global::System.Byte value); - partial void OnCreditRatingChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean PreferredVendorStatus - { - get - { - return _PreferredVendorStatus; - } - set - { - OnPreferredVendorStatusChanging(value); - _PreferredVendorStatus = value; - OnPreferredVendorStatusChanged(); - } - } - private global::System.Boolean _PreferredVendorStatus; - partial void OnPreferredVendorStatusChanging(global::System.Boolean value); - partial void OnPreferredVendorStatusChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Boolean ActiveFlag - { - get - { - return _ActiveFlag; - } - set - { - OnActiveFlagChanging(value); - _ActiveFlag = value; - OnActiveFlagChanged(); - } - } - private global::System.Boolean _ActiveFlag; - partial void OnActiveFlagChanging(global::System.Boolean value); - partial void OnActiveFlagChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.String PurchasingWebServiceURL - { - get - { - return _PurchasingWebServiceURL; - } - set - { - OnPurchasingWebServiceURLChanging(value); - _PurchasingWebServiceURL = value; - OnPurchasingWebServiceURLChanged(); - } - } - private global::System.String _PurchasingWebServiceURL; - partial void OnPurchasingWebServiceURLChanging(global::System.String value); - partial void OnPurchasingWebServiceURLChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection ProductVendors - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "ProductVendor"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_ProductVendor_Vendor_VendorID", "ProductVendor", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection PurchaseOrderHeaders - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "PurchaseOrderHeader"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_PurchaseOrderHeader_Vendor_VendorID", "PurchaseOrderHeader", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection VendorAddresses - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "VendorAddress"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "VendorAddress", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection VendorContacts - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "VendorContact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "VendorContact", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class VendorAddress - { - #region Factory Method - - /// - /// Create a new VendorAddress object. - /// - /// Initial value of the VendorID property. - /// Initial value of the AddressID property. - /// Initial value of the AddressTypeID property. - /// Initial value of the ModifiedDate property. - public static VendorAddress CreateVendorAddress(global::System.Int32 vendorID, global::System.Int32 addressID, global::System.Int32 addressTypeID, global::System.DateTime modifiedDate) - { - VendorAddress vendorAddress = new VendorAddress(); - vendorAddress.VendorID = vendorID; - vendorAddress.AddressID = addressID; - vendorAddress.AddressTypeID = addressTypeID; - vendorAddress.ModifiedDate = modifiedDate; - return vendorAddress; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 VendorID - { - get - { - return _VendorID; - } - set - { - if (_VendorID != value) - { - OnVendorIDChanging(value); - _VendorID = value; - OnVendorIDChanged(); - } - } - } - private global::System.Int32 _VendorID; - partial void OnVendorIDChanging(global::System.Int32 value); - partial void OnVendorIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AddressID - { - get - { - return _AddressID; - } - set - { - if (_AddressID != value) - { - OnAddressIDChanging(value); - _AddressID = value; - OnAddressIDChanged(); - } - } - } - private global::System.Int32 _AddressID; - partial void OnAddressIDChanging(global::System.Int32 value); - partial void OnAddressIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 AddressTypeID - { - get - { - return _AddressTypeID; - } - set - { - OnAddressTypeIDChanging(value); - _AddressTypeID = value; - OnAddressTypeIDChanged(); - } - } - private global::System.Int32 _AddressTypeID; - partial void OnAddressTypeIDChanging(global::System.Int32 value); - partial void OnAddressTypeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Address Address - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference
AddressReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference
("AdventureWorksModel.FK_VendorAddress_Address_AddressID", "Address", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public AddressType AddressType - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference AddressTypeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorAddress_AddressType_AddressTypeID", "AddressType", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Vendor Vendor - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference VendorReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorAddress_Vendor_VendorID", "Vendor", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class VendorContact - { - #region Factory Method - - /// - /// Create a new VendorContact object. - /// - /// Initial value of the VendorID property. - /// Initial value of the ContactID property. - /// Initial value of the ContactTypeID property. - /// Initial value of the ModifiedDate property. - public static VendorContact CreateVendorContact(global::System.Int32 vendorID, global::System.Int32 contactID, global::System.Int32 contactTypeID, global::System.DateTime modifiedDate) - { - VendorContact vendorContact = new VendorContact(); - vendorContact.VendorID = vendorID; - vendorContact.ContactID = contactID; - vendorContact.ContactTypeID = contactTypeID; - vendorContact.ModifiedDate = modifiedDate; - return vendorContact; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 VendorID - { - get - { - return _VendorID; - } - set - { - if (_VendorID != value) - { - OnVendorIDChanging(value); - _VendorID = value; - OnVendorIDChanged(); - } - } - } - private global::System.Int32 _VendorID; - partial void OnVendorIDChanging(global::System.Int32 value); - partial void OnVendorIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactID - { - get - { - return _ContactID; - } - set - { - if (_ContactID != value) - { - OnContactIDChanging(value); - _ContactID = value; - OnContactIDChanged(); - } - } - } - private global::System.Int32 _ContactID; - partial void OnContactIDChanging(global::System.Int32 value); - partial void OnContactIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ContactTypeID - { - get - { - return _ContactTypeID; - } - set - { - OnContactTypeIDChanging(value); - _ContactTypeID = value; - OnContactTypeIDChanged(); - } - } - private global::System.Int32 _ContactTypeID; - partial void OnContactTypeIDChanging(global::System.Int32 value); - partial void OnContactTypeIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Contact Contact - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorContact_Contact_ContactID", "Contact", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ContactType ContactType - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ContactTypeReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorContact_ContactType_ContactTypeID", "ContactType", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Vendor Vendor - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference VendorReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_VendorContact_Vendor_VendorID", "Vendor", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class WorkOrder - { - #region Factory Method - - /// - /// Create a new WorkOrder object. - /// - /// Initial value of the WorkOrderID property. - /// Initial value of the ProductID property. - /// Initial value of the OrderQty property. - /// Initial value of the StockedQty property. - /// Initial value of the ScrappedQty property. - /// Initial value of the StartDate property. - /// Initial value of the DueDate property. - /// Initial value of the ModifiedDate property. - public static WorkOrder CreateWorkOrder(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int32 orderQty, global::System.Int32 stockedQty, global::System.Int16 scrappedQty, global::System.DateTime startDate, global::System.DateTime dueDate, global::System.DateTime modifiedDate) - { - WorkOrder workOrder = new WorkOrder(); - workOrder.WorkOrderID = workOrderID; - workOrder.ProductID = productID; - workOrder.OrderQty = orderQty; - workOrder.StockedQty = stockedQty; - workOrder.ScrappedQty = scrappedQty; - workOrder.StartDate = startDate; - workOrder.DueDate = dueDate; - workOrder.ModifiedDate = modifiedDate; - return workOrder; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 WorkOrderID - { - get - { - return _WorkOrderID; - } - set - { - if (_WorkOrderID != value) - { - OnWorkOrderIDChanging(value); - _WorkOrderID = value; - OnWorkOrderIDChanged(); - } - } - } - private global::System.Int32 _WorkOrderID; - partial void OnWorkOrderIDChanging(global::System.Int32 value); - partial void OnWorkOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 OrderQty - { - get - { - return _OrderQty; - } - set - { - OnOrderQtyChanging(value); - _OrderQty = value; - OnOrderQtyChanged(); - } - } - private global::System.Int32 _OrderQty; - partial void OnOrderQtyChanging(global::System.Int32 value); - partial void OnOrderQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 StockedQty - { - get - { - return _StockedQty; - } - set - { - OnStockedQtyChanging(value); - _StockedQty = value; - OnStockedQtyChanged(); - } - } - private global::System.Int32 _StockedQty; - partial void OnStockedQtyChanging(global::System.Int32 value); - partial void OnStockedQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 ScrappedQty - { - get - { - return _ScrappedQty; - } - set - { - OnScrappedQtyChanging(value); - _ScrappedQty = value; - OnScrappedQtyChanged(); - } - } - private global::System.Int16 _ScrappedQty; - partial void OnScrappedQtyChanging(global::System.Int16 value); - partial void OnScrappedQtyChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime StartDate - { - get - { - return _StartDate; - } - set - { - OnStartDateChanging(value); - _StartDate = value; - OnStartDateChanged(); - } - } - private global::System.DateTime _StartDate; - partial void OnStartDateChanging(global::System.DateTime value); - partial void OnStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable EndDate - { - get - { - return _EndDate; - } - set - { - OnEndDateChanging(value); - _EndDate = value; - OnEndDateChanged(); - } - } - private Nullable _EndDate; - partial void OnEndDateChanging(Nullable value); - partial void OnEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime DueDate - { - get - { - return _DueDate; - } - set - { - OnDueDateChanging(value); - _DueDate = value; - OnDueDateChanged(); - } - } - private global::System.DateTime _DueDate; - partial void OnDueDateChanging(global::System.DateTime value); - partial void OnDueDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ScrapReasonID - { - get - { - return _ScrapReasonID; - } - set - { - OnScrapReasonIDChanging(value); - _ScrapReasonID = value; - OnScrapReasonIDChanged(); - } - } - private Nullable _ScrapReasonID; - partial void OnScrapReasonIDChanging(Nullable value); - partial void OnScrapReasonIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Product Product - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ProductReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrder_Product_ProductID", "Product", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public ScrapReason ScrapReason - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference ScrapReasonReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrder_ScrapReason_ScrapReasonID", "ScrapReason", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public EntityCollection WorkOrderRoutings - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrderRouting"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrderRouting", value); - } - } - } - - #endregion - - } - - /// - /// No Metadata Documentation available. - /// - [Serializable()] - [DataContractAttribute(IsReference = true)] - public partial class WorkOrderRouting - { - #region Factory Method - - /// - /// Create a new WorkOrderRouting object. - /// - /// Initial value of the WorkOrderID property. - /// Initial value of the ProductID property. - /// Initial value of the OperationSequence property. - /// Initial value of the LocationID property. - /// Initial value of the ScheduledStartDate property. - /// Initial value of the ScheduledEndDate property. - /// Initial value of the PlannedCost property. - /// Initial value of the ModifiedDate property. - public static WorkOrderRouting CreateWorkOrderRouting(global::System.Int32 workOrderID, global::System.Int32 productID, global::System.Int16 operationSequence, global::System.Int16 locationID, global::System.DateTime scheduledStartDate, global::System.DateTime scheduledEndDate, global::System.Decimal plannedCost, global::System.DateTime modifiedDate) - { - WorkOrderRouting workOrderRouting = new WorkOrderRouting(); - workOrderRouting.WorkOrderID = workOrderID; - workOrderRouting.ProductID = productID; - workOrderRouting.OperationSequence = operationSequence; - workOrderRouting.LocationID = locationID; - workOrderRouting.ScheduledStartDate = scheduledStartDate; - workOrderRouting.ScheduledEndDate = scheduledEndDate; - workOrderRouting.PlannedCost = plannedCost; - workOrderRouting.ModifiedDate = modifiedDate; - return workOrderRouting; - } - - #endregion - - #region Simple Properties - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 WorkOrderID - { - get - { - return _WorkOrderID; - } - set - { - if (_WorkOrderID != value) - { - OnWorkOrderIDChanging(value); - _WorkOrderID = value; - OnWorkOrderIDChanged(); - } - } - } - private global::System.Int32 _WorkOrderID; - partial void OnWorkOrderIDChanging(global::System.Int32 value); - partial void OnWorkOrderIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int32 ProductID - { - get - { - return _ProductID; - } - set - { - if (_ProductID != value) - { - OnProductIDChanging(value); - _ProductID = value; - OnProductIDChanged(); - } - } - } - private global::System.Int32 _ProductID; - partial void OnProductIDChanging(global::System.Int32 value); - partial void OnProductIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 OperationSequence - { - get - { - return _OperationSequence; - } - set - { - if (_OperationSequence != value) - { - OnOperationSequenceChanging(value); - _OperationSequence = value; - OnOperationSequenceChanged(); - } - } - } - private global::System.Int16 _OperationSequence; - partial void OnOperationSequenceChanging(global::System.Int16 value); - partial void OnOperationSequenceChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Int16 LocationID - { - get - { - return _LocationID; - } - set - { - OnLocationIDChanging(value); - _LocationID = value; - OnLocationIDChanged(); - } - } - private global::System.Int16 _LocationID; - partial void OnLocationIDChanging(global::System.Int16 value); - partial void OnLocationIDChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ScheduledStartDate - { - get - { - return _ScheduledStartDate; - } - set - { - OnScheduledStartDateChanging(value); - _ScheduledStartDate = value; - OnScheduledStartDateChanged(); - } - } - private global::System.DateTime _ScheduledStartDate; - partial void OnScheduledStartDateChanging(global::System.DateTime value); - partial void OnScheduledStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ScheduledEndDate - { - get - { - return _ScheduledEndDate; - } - set - { - OnScheduledEndDateChanging(value); - _ScheduledEndDate = value; - OnScheduledEndDateChanged(); - } - } - private global::System.DateTime _ScheduledEndDate; - partial void OnScheduledEndDateChanging(global::System.DateTime value); - partial void OnScheduledEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ActualStartDate - { - get - { - return _ActualStartDate; - } - set - { - OnActualStartDateChanging(value); - _ActualStartDate = value; - OnActualStartDateChanged(); - } - } - private Nullable _ActualStartDate; - partial void OnActualStartDateChanging(Nullable value); - partial void OnActualStartDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ActualEndDate - { - get - { - return _ActualEndDate; - } - set - { - OnActualEndDateChanging(value); - _ActualEndDate = value; - OnActualEndDateChanged(); - } - } - private Nullable _ActualEndDate; - partial void OnActualEndDateChanging(Nullable value); - partial void OnActualEndDateChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ActualResourceHrs - { - get - { - return _ActualResourceHrs; - } - set - { - OnActualResourceHrsChanging(value); - _ActualResourceHrs = value; - OnActualResourceHrsChanged(); - } - } - private Nullable _ActualResourceHrs; - partial void OnActualResourceHrsChanging(Nullable value); - partial void OnActualResourceHrsChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.Decimal PlannedCost - { - get - { - return _PlannedCost; - } - set - { - OnPlannedCostChanging(value); - _PlannedCost = value; - OnPlannedCostChanged(); - } - } - private global::System.Decimal _PlannedCost; - partial void OnPlannedCostChanging(global::System.Decimal value); - partial void OnPlannedCostChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public Nullable ActualCost - { - get - { - return _ActualCost; - } - set - { - OnActualCostChanging(value); - _ActualCost = value; - OnActualCostChanged(); - } - } - private Nullable _ActualCost; - partial void OnActualCostChanging(Nullable value); - partial void OnActualCostChanged(); - - /// - /// No Metadata Documentation available. - /// - [DataMemberAttribute()] - public global::System.DateTime ModifiedDate - { - get - { - return _ModifiedDate; - } - set - { - OnModifiedDateChanging(value); - _ModifiedDate = value; - OnModifiedDateChanged(); - } - } - private global::System.DateTime _ModifiedDate; - partial void OnModifiedDateChanging(global::System.DateTime value); - partial void OnModifiedDateChanged(); - - #endregion - - #region Navigation Properties - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public Location Location - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference LocationReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_Location_LocationID", "Location", value); - } - } - } - - /// - /// No Metadata Documentation available. - /// - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - public WorkOrder WorkOrder - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder").Value; - } - set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder").Value = value; - } - } - /// - /// No Metadata Documentation available. - /// - [BrowsableAttribute(false)] - [DataMemberAttribute()] - public EntityReference WorkOrderReference - { - get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder"); - } - set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference("AdventureWorksModel.FK_WorkOrderRouting_WorkOrder_WorkOrderID", "WorkOrder", value); - } - } - } - - #endregion - - } - - #endregion - -} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt deleted file mode 100644 index f37bd524e..000000000 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/DataModels/AdventureWorksEFCore.tt +++ /dev/null @@ -1,1298 +0,0 @@ -<# -// You can use this text template to customize object layer code generation for -// applications that use the Entity Framework. The template generates code based on an .edmx file. -// Before using this template, note the following: -// -// *The name of the text template file will determine the name of the code file it generates. -// For example, if the text template is named TextTemplate.tt, the generated file will be named -// TextTemplate.vb or TextTemplate.cs. -// *The Custom Tool property of the targeted .edmx file must be empty. For more information, -// see .edmx File Properties (http://go.microsoft.com/fwlink/?LinkId=139299). -// *The SourceCsdlPath initialization below must be set to one of the following: -// 1) the path of the targeted .edmx or .csdl file -// 2) the path of the targeted .edmx or .csdl file relative to the template path -// -// For more detailed information about using this template, see -// How to: Customize Object Layer Code Generation (http://go.microsoft.com/fwlink/?LinkId=139297). -// For general information about text templates, see -// Generating Artifacts by Using Text Templates (http://go.microsoft.com/fwlink/?LinkId=139298) -#> -<#@ template language="C#" debug="false" hostspecific="true"#> -<#@ include file="EF.Utility.CS.ttinclude"#><#@ - output extension=".cs"#><# - -DefineMetadata(); - -UserSettings userSettings = - new UserSettings - { - SourceCsdlPath = @"AdventureWorks.edmx", - ReferenceCsdlPaths = new string[] {}, - FullyQualifySystemTypes = true, - CreateContextAddToMethods = true, - CamelCaseFields = false, - }; - -ApplyUserSettings(userSettings); -if(Errors.HasErrors) -{ - return String.Empty; -} - -MetadataLoader loader = new MetadataLoader(this); -MetadataTools ef = new MetadataTools(this); -CodeRegion region = new CodeRegion(this); -CodeGenerationTools code = new CodeGenerationTools(this){FullyQualifySystemTypes = userSettings.FullyQualifySystemTypes, CamelCaseFields = userSettings.CamelCaseFields}; - -ItemCollection = loader.CreateEdmItemCollection(SourceCsdlPath, ReferenceCsdlPaths.ToArray()); -ModelNamespace = loader.GetModelNamespace(SourceCsdlPath); -string namespaceName = GetNamespaceName(code); - namespaceName = "AdventureWorksModel"; - -UpdateObjectNamespaceMap(namespaceName); - -#> -//------------------------------------------------------------------------------ -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine1")#> -// -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine2")#> -// <#=CodeGenerationTools.GetResourceString("Template_GeneratedCodeCommentLine3")#> -// -//------------------------------------------------------------------------------ - -using System; -using System.ComponentModel; -using System.Data.Entity.Core.EntityClient; -using System.Data.Entity.Core.Objects; -using System.Data.Entity.Core.Objects.DataClasses; -using System.Linq; -using System.Runtime.Serialization; -using System.Xml.Serialization; - -[assembly: EdmSchemaAttribute()] -<# - //////// - //////// Write Relationship Attributes - //////// - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionRelationships")); - bool first = true; - foreach (AssociationType association in GetSourceSchemaTypes()) - { - if (first) - { - WriteLine(string.Empty); - first = false; - } -#> -[assembly: EdmRelationshipAttribute("<#=association.NamespaceName#>", "<#=association.Name#>", "<#=EndName(association, 0)#>", <#=EndMultiplicity(association, 0, code)#>, typeof(<#=EscapeEndTypeName(association, 0, code)#>), "<#=EndName(association, 1)#>", <#=EndMultiplicity(association, 1, code)#>, typeof(<#=EscapeEndTypeName(association, 1, code)#>)<#=code.StringBefore(", ", association.IsForeignKey ? "true" : null)#>)] -<# - } - region.End(); - - if (!String.IsNullOrEmpty(namespaceName)) - { -#> -namespace <#=namespaceName#> -{ -<# - PushIndent(CodeRegion.GetIndent(1)); - } - - //////// - //////// Write EntityContainer and ObjectContext classes. - //////// - - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionContexts")); - foreach (EntityContainer container in GetSourceSchemaTypes()) - { -#> - -/// -/// <#=SummaryComment(container)#> -/// <#=LongDescriptionCommentElement(container, region.CurrentIndentLevel)#> -<#=Accessibility.ForType(container)#> partial class <#=code.Escape(container)#> : ObjectContext -{ - #region <#=CodeGenerationTools.GetResourceString("Template_RegionConstructors")#> - - /// - /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_ContextDefaultCtorComment"), container.Name, container.Name)#> - /// - public <#=code.Escape(container)#>() : base("name=<#=container.Name#>", "<#=container.Name#>") - { -<# - WriteLazyLoadingEnabled(container); -#> - OnContextCreated(); - } - - /// - /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_ContextCommonCtorComment"), container.Name)#> - /// - public <#=code.Escape(container)#>(string connectionString) : base(connectionString, "<#=container.Name#>") - { -<# - WriteLazyLoadingEnabled(container); -#> - OnContextCreated(); - } - - /// - /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_ContextCommonCtorComment"), container.Name)#> - /// - public <#=code.Escape(container)#>(EntityConnection connection) : base(connection, "<#=container.Name#>") - { -<# - WriteLazyLoadingEnabled(container); -#> - OnContextCreated(); - } - - #endregion - - #region <#=CodeGenerationTools.GetResourceString("Template_RegionPartialMethods")#> - - partial void OnContextCreated(); - - #endregion - -<# - //////// - //////// Write EntityContainer and ObjectContext ObjectSet properties. - //////// - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionObjectSetProperties")); - foreach (EntitySet set in container.BaseEntitySets.OfType()) - { - VerifyEntityTypeAndSetAccessibilityCompatability(set); -#> - - /// - /// <#=SummaryComment(set)#> - /// <#=LongDescriptionCommentElement(set, region.CurrentIndentLevel)#> - <#=code.SpaceAfter(NewModifier(set))#><#=Accessibility.ForReadOnlyProperty(set)#> ObjectSet<<#=MultiSchemaEscape(set.ElementType, code)#>> <#=code.Escape(set)#> - { - get - { - if ((<#=code.FieldName(set)#> == null)) - { - <#=code.FieldName(set)#> = base.CreateObjectSet<<#=MultiSchemaEscape(set.ElementType, code)#>>("<#=set.Name#>"); - } - return <#=code.FieldName(set)#>; - } - } - private ObjectSet<<#=MultiSchemaEscape(set.ElementType, code)#>> <#=code.FieldName(set)#>; -<# - } - region.End(); - - //////// - //////// Write EntityContainer and ObjectContext AddTo<EntitySet> methods. - //////// - //////// AddTo methods are no longer necessary since the EntitySet properties return - //////// an ObjectSet<T> object, which has already has an Add method. - //////// - //////// AddTo methods are generated here for backwards compatibility reasons only. - //////// Set the CreateContextAddToMethods property of the UserSettings object to false - //////// to turn off generation of the AddTo methods. - //////// - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionAddToMethods")); - IEnumerable addToMethods = CreateContextAddToMethods.Value ? container.BaseEntitySets.OfType() : Enumerable.Empty(); - foreach (EntitySet set in addToMethods) - { - string parameterName = code.Escape(FixParameterName(set.ElementType.Name, code)); -#> - - /// - /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_GenCommentAddToMethodCs"), set.Name)#> - /// - <#=Accessibility.ForType(set.ElementType)#> void AddTo<#=set.Name#>(<#=MultiSchemaEscape(set.ElementType, code)#> <#=parameterName#>) - { - base.AddObject("<#=set.Name#>", <#=parameterName#>); - } -<# - } - region.End(); - - //////// - //////// Write EntityContainer and ObjectContext Function Import methods. - //////// - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionFunctionImports")); - foreach (EdmFunction edmFunction in container.FunctionImports) - { - - IEnumerable parameters = FunctionImportParameter.Create(edmFunction.Parameters, code, ef); - - // Fixup namespaces for types in EF6 assemblies - foreach(var parameter in parameters.Where(p => p.FunctionParameterType == "global::System.Data.Spatial.DbGeography" || p.FunctionParameterType == "global::System.Data.Spatial.DbGeometry")) - { - parameter.FunctionParameterType = parameter.FunctionParameterType.Replace("global::System.Data.Spatial", "global::System.Data.Entity.Spatial"); - parameter.RawClrTypeName = parameter.RawClrTypeName.Replace("global::System.Data.Spatial", "global::System.Data.Entity.Spatial"); - }; - - string paramList = string.Join(", ", parameters.Select(p => p.FunctionParameterType + " " + p.FunctionParameterName).ToArray()); - TypeUsage returnType = edmFunction.ReturnParameters.Count == 0 ? null : ef.GetElementType(edmFunction.ReturnParameters[0].TypeUsage); - if (edmFunction.IsComposableAttribute) - { -#> - - /// - /// <#=SummaryComment(edmFunction)#> - /// <#=LongDescriptionCommentElement(edmFunction, region.CurrentIndentLevel)#><#=ParameterComments(parameters.Select(p => new Tuple(p.RawFunctionParameterName, SummaryComment(p.Source))), region.CurrentIndentLevel)#> - [EdmFunction("<#=edmFunction.NamespaceName#>", "<#=edmFunction.Name#>")] - <#=code.SpaceAfter(NewModifier(edmFunction))#><#=Accessibility.ForMethod(edmFunction)#> <#="IQueryable<" + MultiSchemaEscape(returnType, code) + ">"#> <#=code.Escape(edmFunction)#>(<#=paramList#>) - { -<# - WriteFunctionParameters(parameters); -#> - return base.CreateQuery<<#=MultiSchemaEscape(returnType, code)#>>("[<#=edmFunction.NamespaceName#>].[<#=edmFunction.Name#>](<#=string.Join(", ", parameters.Select(p => "@" + p.EsqlParameterName).ToArray())#>)"<#=code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))#>); - } -<# - } - else - { -#> - - /// - /// <#=SummaryComment(edmFunction)#> - /// <#=LongDescriptionCommentElement(edmFunction, region.CurrentIndentLevel)#><#=ParameterComments(parameters.Select(p => new Tuple(p.RawFunctionParameterName, SummaryComment(p.Source))), region.CurrentIndentLevel)#> - <#=code.SpaceAfter(NewModifier(edmFunction))#><#=Accessibility.ForMethod(edmFunction)#> <#=returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType, code) + ">"#> <#=code.Escape(edmFunction)#>(<#=paramList#>) - { -<# - WriteFunctionParameters(parameters); -#> - return base.ExecuteFunction<#=returnType == null ? "" : "<" + MultiSchemaEscape(returnType, code) + ">"#>("<#=edmFunction.Name#>"<#=code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))#>); - } -<# - if(returnType != null && returnType.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) - { -#> - /// - /// <#=SummaryComment(edmFunction)#> - /// <#=LongDescriptionCommentElement(edmFunction, region.CurrentIndentLevel)#> - /// <#=ParameterComments(parameters.Select(p => new Tuple(p.RawFunctionParameterName, SummaryComment(p.Source))), region.CurrentIndentLevel)#> - <#=code.SpaceAfter(NewModifier(edmFunction))#><#=Accessibility.ForMethod(edmFunction)#> <#=returnType == null ? "int" : "ObjectResult<" + MultiSchemaEscape(returnType, code) + ">"#> <#=code.Escape(edmFunction)#>(<#=code.StringAfter(paramList, ", ")#>MergeOption mergeOption) - { -<# - WriteFunctionParameters(parameters); -#> - return base.<#=returnType == null ? "ExecuteFunction" : "ExecuteFunction<" + MultiSchemaEscape(returnType, code) + ">"#>("<#=edmFunction.Name#>", mergeOption<#=code.StringBefore(", ", string.Join(", ", parameters.Select(p => p.ExecuteParameterName).ToArray()))#>); - } -<# - } - } - } - region.End(); -#> -} -<# - } - region.End(); - - //////// - //////// Write EntityType classes. - //////// - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionEntities")); - foreach (EntityType entity in GetSourceSchemaTypes().OrderBy(e => e.Name)) - { -#> - -/// -/// <#=SummaryComment(entity)#> -/// <#=LongDescriptionCommentElement(entity, region.CurrentIndentLevel)#> -[EdmEntityTypeAttribute(NamespaceName="<#=entity.NamespaceName#>", Name="<#=entity.Name#>")] -[Serializable()] -[DataContractAttribute(IsReference=true)] -<# - foreach (EntityType subType in ItemCollection.GetItems().Where(b => b.BaseType == entity)) - { -#> -[KnownTypeAttribute(typeof(<#=MultiSchemaEscape(subType, code)#>))] -<# - } -#> -<#=Accessibility.ForType(entity)#> <#=code.SpaceAfter(code.AbstractOption(entity))#>partial class <#=code.Escape(entity)#> : <#=BaseTypeName(entity, code)#> -{ -<# - if (!entity.Abstract) - { - WriteFactoryMethod(entity, code); - } - - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionSimpleProperties")); - foreach (EdmProperty property in entity.Properties.Where(p => p.DeclaringType == entity && p.TypeUsage.EdmType is SimpleType)) - { - VerifyGetterAndSetterAccessibilityCompatability(property); - WriteSimpleTypeProperty(property, code); - } - region.End(); - - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionComplexProperties")); - foreach (EdmProperty property in entity.Properties.Where(p => p.DeclaringType == entity && p.TypeUsage.EdmType is ComplexType)) - { - VerifyGetterAndSetterAccessibilityCompatability(property); - WriteComplexTypeProperty(property, code); - } - region.End(); - - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionNavigationProperties")); - foreach (NavigationProperty navProperty in entity.NavigationProperties.Where(n => n.DeclaringType == entity)) - { - VerifyGetterAndSetterAccessibilityCompatability(navProperty); -#> - - /// - /// <#=SummaryComment(navProperty)#> - /// <#=LongDescriptionCommentElement(navProperty, region.CurrentIndentLevel)#> - [XmlIgnoreAttribute()] - [SoapIgnoreAttribute()] - [DataMemberAttribute()] - [EdmRelationshipNavigationPropertyAttribute("<#=navProperty.RelationshipType.NamespaceName#>", "<#=navProperty.RelationshipType.Name#>", "<#=navProperty.ToEndMember.Name#>")] -<# - if (navProperty.ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.Many) - { -#> - <#=code.SpaceAfter(NewModifier(navProperty))#><#=Accessibility.ForProperty(navProperty)#> EntityCollection<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>> <#=code.Escape(navProperty)#> - { - <#=code.SpaceAfter(Accessibility.ForGetter(navProperty))#>get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedCollection<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>"); - } - <#=code.SpaceAfter(Accessibility.ForSetter(navProperty))#>set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedCollection<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>", value); - } - } - } -<# - } - else - { -#> - <#=code.SpaceAfter(NewModifier(navProperty))#><#=Accessibility.ForProperty(navProperty)#> <#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#> <#=code.Escape(navProperty)#> - { - <#=code.SpaceAfter(Accessibility.ForGetter(navProperty))#>get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>").Value; - } - <#=code.SpaceAfter(Accessibility.ForSetter(navProperty))#>set - { - ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>").Value = value; - } - } -<# - string refPropertyName = navProperty.Name + "Reference"; - if (entity.Members.Any(m => m.Name == refPropertyName)) - { - // 6017 is the same error number that EntityClassGenerator uses. - Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6017", String.Format(CultureInfo.CurrentCulture, - CodeGenerationTools.GetResourceString("Template_ConflictingGeneratedNavPropName"), - navProperty.Name, entity.FullName, refPropertyName))); - } -#> - /// - /// <#=SummaryComment(navProperty)#> - /// <#=LongDescriptionCommentElement(navProperty, region.CurrentIndentLevel)#> - [BrowsableAttribute(false)] - [DataMemberAttribute()] - <#=Accessibility.ForProperty(navProperty)#> EntityReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>> <#=refPropertyName#> - { - <#=code.SpaceAfter(Accessibility.ForGetter(navProperty))#>get - { - return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>"); - } - <#=code.SpaceAfter(Accessibility.ForSetter(navProperty))#>set - { - if ((value != null)) - { - ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<<#=MultiSchemaEscape(navProperty.ToEndMember.GetEntityType(), code)#>>("<#=navProperty.RelationshipType.FullName#>", "<#=navProperty.ToEndMember.Name#>", value); - } - } - } -<# - } - } - region.End(); -#> -} -<# - } - region.End(); - - //////// - //////// Write ComplexType classes. - //////// - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionComplexTypes")); - foreach (ComplexType complex in GetSourceSchemaTypes().OrderBy(c => c.Name)) - { -#> - -/// -/// <#=SummaryComment(complex)#> -/// <#=LongDescriptionCommentElement(complex, region.CurrentIndentLevel)#> -[EdmComplexTypeAttribute(NamespaceName="<#=complex.NamespaceName#>", Name="<#=complex.Name#>")] -[DataContractAttribute(IsReference=true)] -[Serializable()] -<#=Accessibility.ForType(complex)#> partial class <#=code.Escape(complex)#> : ComplexObject -{ -<# - WriteFactoryMethod(complex, code); - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionSimpleProperties")); - foreach (EdmProperty property in complex.Properties.Where(p => p.DeclaringType == complex && p.TypeUsage.EdmType is SimpleType)) - { - VerifyGetterAndSetterAccessibilityCompatability(property); - WriteSimpleTypeProperty(property, code); - } - region.End(); - - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionComplexProperties")); - foreach (EdmProperty property in complex.Properties.Where(p => p.DeclaringType == complex && p.TypeUsage.EdmType is ComplexType)) - { - VerifyGetterAndSetterAccessibilityCompatability(property); - WriteComplexTypeProperty(property, code); - } - region.End(); -#> -} -<# - } - region.End(); - - //////// - //////// Write enums. - //////// - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionEnumTypes")); - foreach (EnumType enumType in GetSourceSchemaTypes().OrderBy(c => c.Name)) - { -#> - -/// -/// <#=SummaryComment(enumType)#> -/// <#=LongDescriptionCommentElement(enumType, region.CurrentIndentLevel)#> -[EdmEnumTypeAttribute(NamespaceName="<#=enumType.NamespaceName#>", Name="<#=enumType.Name#>")] -[DataContractAttribute()] -<# - if (enumType.IsFlags) - { -#> -[FlagsAttribute()] -<# - } -#> -<#=Accessibility.ForType(enumType)#> enum <#=code.Escape(enumType)#> : <#=code.Escape(enumType.UnderlyingType.ClrEquivalentType, fullyQualifySystemTypes: false)#> -{ -<# - foreach (EnumMember member in enumType.Members) - { -#> - /// - /// <#=SummaryComment(member)#> - /// <#=LongDescriptionCommentElement(member, region.CurrentIndentLevel + 1)#> - [EnumMemberAttribute()] - <#=code.Escape(member)#> = <#=member.Value#>, - -<# - } - - // Remove the last comma and line break - if (enumType.Members.Any()) - { - this.GenerationEnvironment.Remove( - this.GenerationEnvironment.Length - (CurrentIndent.Length + 5), CurrentIndent.Length + 3); - } -#> -} -<# - } - region.End(); - - if (!String.IsNullOrEmpty(namespaceName)) - { - PopIndent(); -#> -} -<# - } - - if (!VerifyTypeUniqueness(GetSourceSchemaTypes() - .Where(i => i is StructuralType || i is EnumType || i is EntityContainer) - .Select(i => code.GetGlobalItemName(i)))) - { - return string.Empty; - } -#> -<#+ - - //////// - //////// Reusable Template Sections - //////// - - //////// - //////// Write Factory Method. - //////// - private void WriteFactoryMethod(StructuralType structuralType, CodeGenerationTools code) - { - CodeRegion region = new CodeRegion(this, 1); - - string methodName = "Create" + structuralType.Name; - UniqueIdentifierService uniqueIdentifier = new UniqueIdentifierService(); - string instanceName = code.Escape(uniqueIdentifier.AdjustIdentifier((code.CamelCase(structuralType.Name)))); - IEnumerable parameters = FactoryMethodParameter.CreateParameters(structuralType.Members.OfType().Where(p => IncludePropertyInFactoryMethod(structuralType, p)), uniqueIdentifier, MultiSchemaEscape, code); - - if (parameters.Count() == 0) - return; - - if (structuralType.Members.Any(m => m.Name == methodName)) - { - // 6029 is the same error number that EntityClassGenerator uses for this conflict. - Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6029", - String.Format(CultureInfo.CurrentCulture, - CodeGenerationTools.GetResourceString("Template_FactoryMethodNameConflict"), methodName, structuralType.FullName))); - } - - region.Begin(CodeGenerationTools.GetResourceString("Template_RegionFactoryMethod")); -#> - - /// - /// <#=String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_FactoryMethodComment"), structuralType.Name)#> - /// <#=ParameterComments(parameters.Select(p => new Tuple(p.RawParameterName, p.ParameterComment)), region.CurrentIndentLevel)#> - public static <#=code.Escape(structuralType)#> <#=methodName#>(<#=string.Join(", ", parameters.Select(p => p.ParameterType + " " + p.ParameterName).ToArray())#>) - { - <#=code.Escape(structuralType)#> <#=instanceName#> = new <#=code.Escape(structuralType)#>(); -<#+ - foreach (FactoryMethodParameter parameter in parameters) - { - if (parameter.IsComplexType) - { - // ComplexType initialization. -#> - <#=instanceName#>.<#=code.Escape(parameter.Source)#> = StructuralObject.VerifyComplexObjectIsNotNull(<#=parameter.ParameterName#>, "<#=parameter.Source.Name#>"); -<#+ - } - else - { - // SimpleType initialization. -#> - <#=instanceName#>.<#=code.Escape(parameter.Source)#> = <#=parameter.ParameterName#>; -<#+ - } - } -#> - return <#=instanceName#>; - } -<#+ - region.End(); - } - - - //////// - //////// Write SimpleType Properties. - //////// - private void WriteSimpleTypeProperty(EdmProperty simpleProperty, CodeGenerationTools code) - { - MetadataTools ef = new MetadataTools(this); -#> - - /// - /// <#=SummaryComment(simpleProperty)#> - /// <#=LongDescriptionCommentElement(simpleProperty, 1)#> - [EdmScalarPropertyAttribute(EntityKeyProperty=<#=code.CreateLiteral(ef.IsKey(simpleProperty))#>, IsNullable=<#=code.CreateLiteral(ef.IsNullable(simpleProperty))#>)] - [DataMemberAttribute()] - <#=code.SpaceAfter(NewModifier(simpleProperty))#><#=Accessibility.ForProperty(simpleProperty)#> <#=MultiSchemaEscape(simpleProperty.TypeUsage, code)#> <#=code.Escape(simpleProperty)#> - { - <#=code.SpaceAfter(Accessibility.ForGetter(simpleProperty))#>get - { -<#+ if (ef.ClrType(simpleProperty.TypeUsage) == typeof(byte[])) - { -#> - return StructuralObject.GetValidValue(<#=code.FieldName(simpleProperty)#>); -<#+ - } - else - { -#> - return <#=code.FieldName(simpleProperty)#>; -<#+ - } -#> - } - <#=code.SpaceAfter(Accessibility.ForSetter((simpleProperty)))#>set - { -<#+ - if (ef.IsKey(simpleProperty)) - { - if (ef.ClrType(simpleProperty.TypeUsage) == typeof(byte[])) - { -#> - if (!StructuralObject.BinaryEquals(<#=code.FieldName(simpleProperty)#>, value)) -<#+ - } - else - { -#> - if (<#=code.FieldName(simpleProperty)#> != value) -<#+ - } -#> - { -<#+ - PushIndent(CodeRegion.GetIndent(1)); - } -#> - <#=ChangingMethodName(simpleProperty)#>(value); - ReportPropertyChanging("<#=simpleProperty.Name#>"); - <#=code.FieldName(simpleProperty)#> = <#=CastToEnumType(simpleProperty.TypeUsage, code)#>StructuralObject.SetValidValue(<#=CastToUnderlyingType(simpleProperty.TypeUsage, code)#>value<#=OptionalNullableParameterForSetValidValue(simpleProperty, code)#>); - ReportPropertyChanged("<#=simpleProperty.Name#>"); - <#=ChangedMethodName(simpleProperty)#>(); -<#+ - if (ef.IsKey(simpleProperty)) - { - PopIndent(); -#> - } -<#+ - } -#> - } - } - private <#=MultiSchemaEscape(simpleProperty.TypeUsage, code)#> <#=code.FieldName(simpleProperty)#><#=code.StringBefore(" = ", code.CreateLiteral(simpleProperty.DefaultValue))#>; - partial void <#=ChangingMethodName(simpleProperty)#>(<#=MultiSchemaEscape(simpleProperty.TypeUsage, code)#> value); - partial void <#=ChangedMethodName(simpleProperty)#>(); -<#+ - } - - //////// - //////// Write ComplexType Properties. - //////// - private void WriteComplexTypeProperty(EdmProperty complexProperty, CodeGenerationTools code) - { -#> - - /// - /// <#=SummaryComment(complexProperty)#> - /// <#=LongDescriptionCommentElement(complexProperty, 1)#> - [EdmComplexPropertyAttribute()] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] - [XmlElement(IsNullable=true)] - [SoapElement(IsNullable=true)] - [DataMemberAttribute()] - <#=code.SpaceAfter(NewModifier(complexProperty))#><#=Accessibility.ForProperty(complexProperty)#> <#=MultiSchemaEscape(complexProperty.TypeUsage, code)#> <#=code.Escape(complexProperty)#> - { - <#=code.SpaceAfter(Accessibility.ForGetter(complexProperty))#>get - { - <#=code.FieldName(complexProperty)#> = GetValidValue(<#=code.FieldName(complexProperty)#>, "<#=complexProperty.Name#>", false, <#=InitializedTrackingField(complexProperty, code)#>); - <#=InitializedTrackingField(complexProperty, code)#> = true; - return <#=code.FieldName(complexProperty)#>; - } - <#=code.SpaceAfter(Accessibility.ForSetter(complexProperty))#>set - { - <#=ChangingMethodName(complexProperty)#>(value); - ReportPropertyChanging("<#=complexProperty.Name#>"); - <#=code.FieldName(complexProperty)#> = SetValidValue(<#=code.FieldName(complexProperty)#>, value); - <#=InitializedTrackingField(complexProperty, code)#> = true; - ReportPropertyChanged("<#=complexProperty.Name#>"); - <#=ChangedMethodName(complexProperty)#>(); - } - } - private <#=MultiSchemaEscape(complexProperty.TypeUsage, code)#> <#=code.FieldName(complexProperty)#>; - private bool <#=InitializedTrackingField(complexProperty, code)#>; - partial void <#=ChangingMethodName(complexProperty)#>(<#=MultiSchemaEscape(complexProperty.TypeUsage, code)#> value); - partial void <#=ChangedMethodName(complexProperty)#>(); -<#+ - } - - private void WriteFunctionParameters(IEnumerable parameters) - { - foreach (FunctionImportParameter parameter in parameters) - { - if (!parameter.NeedsLocalVariable) - { - continue; - } -#> - ObjectParameter <#=parameter.LocalVariableName#>; - if (<#=parameter.IsNullableOfT ? parameter.FunctionParameterName + ".HasValue" : parameter.FunctionParameterName + " != null"#>) - { - <#=parameter.LocalVariableName#> = new ObjectParameter("<#=parameter.EsqlParameterName#>", <#=parameter.FunctionParameterName#>); - } - else - { - <#=parameter.LocalVariableName#> = new ObjectParameter("<#=parameter.EsqlParameterName#>", typeof(<#=parameter.RawClrTypeName#>)); - } - -<#+ - } - } - - private void WriteLazyLoadingEnabled(EntityContainer container) - { - string lazyLoadingAttributeValue = null; - string lazyLoadingAttributeName = MetadataConstants.EDM_ANNOTATION_09_02 + ":LazyLoadingEnabled"; - if(MetadataTools.TryGetStringMetadataPropertySetting(container, lazyLoadingAttributeName, out lazyLoadingAttributeValue)) - { - bool isLazyLoading = false; - if(bool.TryParse(lazyLoadingAttributeValue, out isLazyLoading)) - { -#> - this.ContextOptions.LazyLoadingEnabled = <#=isLazyLoading.ToString().ToLowerInvariant()#>; -<#+ - } - } - } - -//////// -//////// Declare Template Public Properties. -//////// -public string SourceCsdlPath{ get; set; } -public string ModelNamespace{ get; set; } -public EdmItemCollection ItemCollection{ get; set; } -public IEnumerable ReferenceCsdlPaths{ get; set; } -public Nullable CreateContextAddToMethods{ get; set; } -public Dictionary EdmToObjectNamespaceMap -{ - get { return _edmToObjectNamespaceMap; } - set { _edmToObjectNamespaceMap = value; } -} -public Dictionary _edmToObjectNamespaceMap = new Dictionary(); -public Double SourceEdmVersion -{ - get - { - if (ItemCollection != null) - { - return ItemCollection.EdmVersion; - } - - return 0.0; - } -} - -private bool VerifyTypeUniqueness(IEnumerable types) -{ - HashSet hash = new HashSet(); - foreach (string type in types) - { - if (!hash.Add(type)) - { - // 6034 is the error number used by System.Data.Entity.Design EntityClassGenerator. - Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6034", - String.Format(CultureInfo.CurrentCulture, - CodeGenerationTools.GetResourceString("Template_DuplicateTopLevelType"), - type))); - return false; - } - } - return true; -} - -void ApplyUserSettings(UserSettings userSettings) -{ - // Setup template UserSettings. - if (SourceCsdlPath == null) - { -#if !PREPROCESSED_TEMPLATE - if(userSettings.SourceCsdlPath == "$" + "edmxInputFile" + "$") - { - Errors.Add(new System.CodeDom.Compiler.CompilerError(Host.TemplateFile, -1, -1, "", - CodeGenerationTools.GetResourceString("Template_ReplaceVsItemTemplateToken"))); - return; - } - - SourceCsdlPath = Host.ResolvePath(userSettings.SourceCsdlPath); -#else - SourceCsdlPath = userSettings.SourceCsdlPath; -#endif - } - - // normalize the path, remove ..\ from it - SourceCsdlPath = Path.GetFullPath(SourceCsdlPath); - - - if (ReferenceCsdlPaths == null) - { - ReferenceCsdlPaths = userSettings.ReferenceCsdlPaths; - } - - if (!CreateContextAddToMethods.HasValue) - { - CreateContextAddToMethods = userSettings.CreateContextAddToMethods; - } - - DefaultSummaryComment = CodeGenerationTools.GetResourceString("Template_CommentNoDocumentation"); -} - -class UserSettings -{ - public string SourceCsdlPath{ get; set; } - public string[] ReferenceCsdlPaths{ get; set; } - public bool FullyQualifySystemTypes{ get; set; } - public bool CreateContextAddToMethods{ get; set; } - public bool CamelCaseFields{ get; set; } -} - -string GetNamespaceName(CodeGenerationTools code) -{ - string namespaceName = code.VsNamespaceSuggestion(); - -#if PREPROCESSED_TEMPLATE - if (String.IsNullOrEmpty(namespaceName)) - { - namespaceName = GetObjectNamespace(ModelNamespace); - } -#endif - return namespaceName; -} - -string MultiSchemaEscape(TypeUsage usage, CodeGenerationTools code) -{ - MetadataTools ef = new MetadataTools(this); - if (usage.EdmType != null) - { - if(usage.EdmType.Name == "Geography") - { - return "System.Data.Entity.Spatial.DbGeography"; - } - else if(usage.EdmType.Name == "Geometry") - { - return "System.Data.Entity.Spatial.DbGeometry"; - } - else if (usage.EdmType is StructuralType) - { - return MultiSchemaEscape(usage.EdmType, code); - } - else if (usage.EdmType is EnumType) - { - string typeName = MultiSchemaEscape(usage.EdmType, code); - if (ef.IsNullable(usage)) - { - return String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", typeName); - } - - return typeName; - } - } - - return code.Escape(usage); -} - -string MultiSchemaEscape(EdmType type, CodeGenerationTools code) -{ - if (type.NamespaceName != ModelNamespace) - { - return code.CreateFullName(code.EscapeNamespace(GetObjectNamespace(type.NamespaceName)), code.Escape(type)); - } - - return code.Escape(type); -} - -string NewModifier(NavigationProperty navigationProperty) -{ - Type baseType = typeof(EntityObject); - return NewModifier(baseType, navigationProperty.Name); -} - -string NewModifier(EdmFunction edmFunction) -{ - Type baseType = typeof(ObjectContext); - return NewModifier(baseType, edmFunction.Name); -} - -string NewModifier(EntitySet set) -{ - Type baseType = typeof(ObjectContext); - return NewModifier(baseType, set.Name); -} - -string NewModifier(EdmProperty property) -{ - Type baseType; - if (property.DeclaringType.BuiltInTypeKind == BuiltInTypeKind.EntityType) - { - baseType = typeof(EntityObject); - } - else - { - baseType = typeof(ComplexObject); - } - return NewModifier(baseType, property.Name); -} - -string NewModifier(Type type, string memberName) -{ - if (HasBaseMemberWithMatchingName(type, memberName)) - { - return "new"; - } - return string.Empty; -} - -static bool HasBaseMemberWithMatchingName(Type type, string memberName) -{ - BindingFlags bindingFlags = BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Public - | BindingFlags.Instance | BindingFlags.Static; - return type.GetMembers(bindingFlags).Where(m => IsVisibleMember(m)).Any(m => m.Name == memberName); -} - -string CastToEnumType(TypeUsage typeUsage, CodeGenerationTools code) -{ - EnumType type = typeUsage.EdmType as EnumType; - if (type == null) - return string.Empty; - - return "(" + MultiSchemaEscape(typeUsage, code) + ")"; -} - -string CastToUnderlyingType(TypeUsage typeUsage, CodeGenerationTools code) -{ - MetadataTools ef = new MetadataTools(this); - EnumType type = typeUsage.EdmType as EnumType; - if (type == null) - { - return string.Empty; - } - - string clrType = code.Escape(type.UnderlyingType.ClrEquivalentType, fullyQualifySystemTypes: false); - - if (ef.IsNullable(typeUsage)) - { - clrType = String.Format(CultureInfo.InvariantCulture, "Nullable<{0}>", clrType); - } - - return "(" + clrType + ")"; -} - -string ChangingMethodName(EdmMember member) -{ - return string.Format(CultureInfo.InvariantCulture, "On{0}Changing", member.Name); -} - -string ChangedMethodName(EdmMember member) -{ - return string.Format(CultureInfo.InvariantCulture, "On{0}Changed", member.Name); -} - -string InitializedTrackingField(EdmProperty property, CodeGenerationTools code) -{ - string namePart = property.Name + "Initialized"; - if (code.CamelCaseFields) - { - namePart = code.CamelCase(namePart); - } - return "_" + namePart; -} - -string OptionalNullableParameterForSetValidValue(EdmMember member, CodeGenerationTools code) -{ - MetadataTools ef = new MetadataTools(this); - string list = string.Empty; - PrimitiveType type = member.TypeUsage.EdmType as PrimitiveType; - if (type != null && type.ClrEquivalentType.IsClass) - { - MetadataProperty storeGeneratedPatternProperty = null; - bool isNullable = ef.IsNullable(member.TypeUsage) || - (member.MetadataProperties.TryGetValue(MetadataConstants.EDM_ANNOTATION_09_02 + ":StoreGeneratedPattern", false, out storeGeneratedPatternProperty) && - Object.Equals(storeGeneratedPatternProperty.Value, "Computed")); - list += ", " + code.CreateLiteral(isNullable); - } - return list; -} - -static bool IsVisibleMember(MemberInfo memberInfo) -{ - if (memberInfo is EventInfo) - { - EventInfo ei = (EventInfo)memberInfo; - MethodInfo add = ei.GetAddMethod(); - MethodInfo remove = ei.GetRemoveMethod(); - return IsVisibleMethod(add) || IsVisibleMethod(remove); - } - else if (memberInfo is FieldInfo) - { - FieldInfo fi = (FieldInfo)memberInfo; - return !fi.IsPrivate && !fi.IsAssembly; - } - else if (memberInfo is MethodBase) - { - MethodBase mb = (MethodBase)memberInfo; - if (mb.IsSpecialName) - return false; - return IsVisibleMethod(mb); - } - else if (memberInfo is PropertyInfo) - { - PropertyInfo pi = (PropertyInfo)memberInfo; - MethodInfo get = pi.GetGetMethod(); - MethodInfo set = pi.GetSetMethod(); - return IsVisibleMethod(get) || IsVisibleMethod(set); - } - - return false; -} - -static bool IsVisibleMethod(MethodBase methodBase) -{ - if (methodBase == null) - return false; - - return !methodBase.IsPrivate && !methodBase.IsAssembly; -} - -IEnumerable GetSourceSchemaTypes() where T : GlobalItem -{ - if (Path.GetExtension(SourceCsdlPath) != ".edmx") - { - return ItemCollection.GetItems().Where(e => e.MetadataProperties.Any(mp => mp.Name == "SchemaSource" && (string)mp.Value == SourceCsdlPath)); - } - else - { - return ItemCollection.GetItems(); - } -} - -string EndName(AssociationType association, int index) -{ - return association.AssociationEndMembers[index].Name; -} - -string EndMultiplicity(AssociationType association, int index, CodeGenerationTools code) -{ - return "System.Data.Entity.Core.Metadata.Edm.RelationshipMultiplicity." + association.AssociationEndMembers[index].RelationshipMultiplicity.ToString(); -} - -string EscapeEndTypeName(AssociationType association, int index, CodeGenerationTools code) -{ - EntityType entity = association.AssociationEndMembers[index].GetEntityType(); - return code.CreateFullName(code.EscapeNamespace(GetObjectNamespace(entity.NamespaceName)), code.Escape(entity)); -} - -string GetObjectNamespace(string csdlNamespaceName) -{ - string objectNamespace; - if (EdmToObjectNamespaceMap.TryGetValue(csdlNamespaceName, out objectNamespace)) - { - return objectNamespace; - } - - return csdlNamespaceName; -} - -void UpdateObjectNamespaceMap(string objectNamespace) -{ - if(objectNamespace != ModelNamespace && !EdmToObjectNamespaceMap.ContainsKey(ModelNamespace)) - { - EdmToObjectNamespaceMap.Add(ModelNamespace, objectNamespace); - } -} - -static string FixParameterName(string name, CodeGenerationTools code) -{ - // Change any property that is 'id' (case insensitive) to 'ID' - // since 'iD' is a violation of FxCop rules. - if (StringComparer.OrdinalIgnoreCase.Equals(name, "id")) - { - // Return all lower case since it is an abbreviation, not an acronym. - return "id"; - } - return code.CamelCase(name); -} - -string BaseTypeName(EntityType entity, CodeGenerationTools code) -{ - return entity.BaseType == null ? "EntityObject" : MultiSchemaEscape(entity.BaseType, code); -} - -bool IncludePropertyInFactoryMethod(StructuralType factoryType, EdmProperty edmProperty) -{ - if (edmProperty.Nullable) - { - return false; - } - - if (edmProperty.DefaultValue != null) - { - return false; - } - - if ((Accessibility.ForReadOnlyProperty(edmProperty) != "public" && Accessibility.ForWriteOnlyProperty(edmProperty) != "public") || - (factoryType != edmProperty.DeclaringType && Accessibility.ForWriteOnlyProperty(edmProperty) == "private") - ) - { - // There is no public part to the property. - return false; - } - - return true; -} - -class FactoryMethodParameter -{ - public EdmProperty Source; - public string RawParameterName; - public string ParameterName; - public string ParameterType; - public string ParameterComment; - public bool IsComplexType; - - public static IEnumerable CreateParameters(IEnumerable properties, UniqueIdentifierService unique, Func multiSchemaEscape, CodeGenerationTools code) - { - List parameters = new List(); - foreach (EdmProperty property in properties) - { - FactoryMethodParameter parameter = new FactoryMethodParameter(); - parameter.Source = property; - parameter.IsComplexType = property.TypeUsage.EdmType is ComplexType; - parameter.RawParameterName = unique.AdjustIdentifier(FixParameterName(property.Name, code)); - parameter.ParameterName = code.Escape(parameter.RawParameterName); - parameter.ParameterType = multiSchemaEscape(property.TypeUsage, code); - parameter.ParameterComment = String.Format(CultureInfo.CurrentCulture, CodeGenerationTools.GetResourceString("Template_CommentFactoryMethodParam"), property.Name); - parameters.Add(parameter); - } - - return parameters; - } -} - -string DefaultSummaryComment{ get; set; } - -string SummaryComment(MetadataItem item) -{ - if (item.Documentation != null && item.Documentation.Summary != null) - { - return PrefixLinesOfMultilineComment(XMLCOMMENT_START + " ", XmlEntityize(item.Documentation.Summary)); - } - - if (DefaultSummaryComment != null) - { - return DefaultSummaryComment; - } - - return string.Empty; -} - -string LongDescriptionCommentElement(MetadataItem item, int indentLevel) -{ - if (item.Documentation != null && !String.IsNullOrEmpty(item.Documentation.LongDescription)) - { - string comment = Environment.NewLine; - string lineStart = CodeRegion.GetIndent(indentLevel) + XMLCOMMENT_START + " "; - comment += lineStart + "" + Environment.NewLine; - comment += lineStart + PrefixLinesOfMultilineComment(lineStart, XmlEntityize(item.Documentation.LongDescription)) + Environment.NewLine; - comment += lineStart + ""; - return comment; - } - return string.Empty; -} - -string PrefixLinesOfMultilineComment(string prefix, string comment) -{ - return comment.Replace(Environment.NewLine, Environment.NewLine + prefix); -} - -string ParameterComments(IEnumerable> parameters, int indentLevel) -{ - System.Text.StringBuilder builder = new System.Text.StringBuilder(); - foreach (Tuple parameter in parameters) - { - builder.AppendLine(); - builder.Append(CodeRegion.GetIndent(indentLevel)); - builder.Append(XMLCOMMENT_START); - builder.Append(String.Format(CultureInfo.InvariantCulture, " {1}", parameter.Item1, parameter.Item2)); - } - return builder.ToString(); -} - -string XmlEntityize(string text) -{ - if (string.IsNullOrEmpty(text)) - { - return string.Empty; - } - - text = text.Replace("&","&"); - text = text.Replace("<","<").Replace(">",">"); - string id = Guid.NewGuid().ToString(); - text = text.Replace(Environment.NewLine, id); - text = text.Replace("\r", " ").Replace("\n"," "); - text = text.Replace(id, Environment.NewLine); - return text.Replace("\'","'").Replace("\"","""); -} - -const string XMLCOMMENT_START = "///"; -IEnumerable GetProperties(StructuralType type) -{ - if (type.BuiltInTypeKind == BuiltInTypeKind.EntityType) - { - return ((EntityType)type).Properties; - } - else - { - return ((ComplexType)type).Properties; - } -} - -protected void VerifyGetterAndSetterAccessibilityCompatability(EdmMember member) -{ - string rawGetterAccessibility = Accessibility.ForReadOnlyProperty(member); - string rawSetterAccessibility = Accessibility.ForWriteOnlyProperty(member); - - if ((rawGetterAccessibility == "internal" && rawSetterAccessibility == "protected") || - (rawGetterAccessibility == "protected" && rawSetterAccessibility == "internal")) - - { - Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6033", String.Format(CultureInfo.CurrentCulture, - CodeGenerationTools.GetResourceString("GeneratedPropertyAccessibilityConflict"), - member.Name, rawGetterAccessibility, rawSetterAccessibility))); - } -} - -private void VerifyEntityTypeAndSetAccessibilityCompatability(EntitySet set) -{ - string typeAccess = Accessibility.ForType(set.ElementType); - string setAccess = Accessibility.ForReadOnlyProperty(set); - - if(typeAccess == "internal" && (setAccess == "public" || setAccess == "protected")) - { - Errors.Add(new System.CodeDom.Compiler.CompilerError(SourceCsdlPath, -1, -1, "6036", String.Format(CultureInfo.CurrentCulture, - CodeGenerationTools.GetResourceString("EntityTypeAndSetAccessibilityConflict"), - set.ElementType.Name, typeAccess, set.Name, setAccess))); - } -} - -private void DefineMetadata() -{ - TemplateMetadata[MetadataConstants.TT_TEMPLATE_NAME] = "CSharpCodeGen"; - TemplateMetadata[MetadataConstants.TT_TEMPLATE_VERSION] = "5.0"; - TemplateMetadata[MetadataConstants.TT_MINIMUM_ENTITY_FRAMEWORK_VERSION] = "4.0"; -} - -sealed class UniqueIdentifierService -{ - private readonly HashSet _knownIdentifiers; - - public UniqueIdentifierService() - { - _knownIdentifiers = new HashSet(StringComparer.Ordinal); - } - - /// - /// Makes the supplied identifier unique within the scope by adding - /// a suffix (1, 2, 3, ...), and returns the unique identifier. - /// - public string AdjustIdentifier(string identifier) - { - // find a unique name by adding suffix as necessary - var numberOfConflicts = 0; - var adjustedIdentifier = identifier; - - while (!_knownIdentifiers.Add(adjustedIdentifier)) - { - ++numberOfConflicts; - adjustedIdentifier = identifier + numberOfConflicts.ToString(CultureInfo.InvariantCulture); - } - - return adjustedIdentifier; - } -} - -#> diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs similarity index 99% rename from src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs rename to src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index 47990e841..6c620b8d4 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCoreDbCtx_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -7,11 +7,11 @@ using TestDomainServices.Testing; using System.Configuration; using OpenRiaServices.EntityFrameworkCore; -using DbContextModels.NorthwindEFCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; +using EFCoreModels.Northwind; -namespace TestDomainServices.EFCoreDbCtx +namespace TestDomainServices.EFCore { [EnableClientAccess] public class Northwind : DbDomainServiceEFCore @@ -426,7 +426,7 @@ public void UpdateRegion(Region region) EntityEntry tEntityEntry = this.DbContext.Entry(territory); CollectionEntry employeesCollection = tEntityEntry.Collection("Employees"); employeesCollection.Load(); - territory.Employees.Clear(); + territory.EmployeeTerritories.Clear(); this.DbContext.Territories.Remove(territory); } @@ -450,7 +450,7 @@ public void DeleteRegion(Region region) EntityEntry tEntityEntry = this.DbContext.Entry(territory); CollectionEntry employeesCollection = tEntityEntry.Collection("Employees"); employeesCollection.Load(); - territory.Employees.Clear(); + territory.EmployeeTerritories.Clear(); this.DbContext.Territories.Remove(territory); } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs deleted file mode 100644 index 04dd8f5a5..000000000 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind_POCO.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Data; -using System.Data.Entity; -using System.Data.Entity.Core.Objects; -using System.Linq; -using System.Runtime.Serialization; -using System.ServiceModel; -using OpenRiaServices.EntityFrameworkCore; -using OpenRiaServices.Server; -using NorthwindEFCorePOCOModel; -using TestDomainServices.Testing; -using System.Data.Entity.Core.EntityClient; -using System.Configuration; - -namespace TestDomainServices.EFCore -{ - /// - /// Test DomainService that targets an EF POCO model. - /// - [EnableClientAccess] - public class EFCoreNorthwindPOCO : LinqToEntitiesDomainServiceEFCore - { - #region Product methods - public Product GetProductById(int id) - { - return this.GetProducts().SingleOrDefault(p => p.ProductID == id); - } - - public IQueryable GetProducts() - { - throw new NotImplementedException(); - } - - public void InsertProduct(Product product) - { - throw new NotImplementedException(); - //if (GetEntityState(product) != EntityState.Detached) - //{ - // ObjectContext.ObjectStateManager.ChangeObjectState(product, EntityState.Added); - //} - //else - //{ - // ObjectContext.Products.AddObject(product); - //} - } - - public void UpdateProduct(Product current) - { - throw new NotImplementedException(); - //ObjectContext.Products.AttachAsModified(current, this.ChangeSet.GetOriginal(current)); - } - - public void DeleteProduct(Product product) - { - throw new NotImplementedException(); - //if (GetEntityState(product) == EntityState.Detached) - //{ - // ObjectContext.Products.Attach(product); - //} - //ObjectContext.Products.DeleteObject(product); - } - #endregion - - public IQueryable GetCategories() - { - throw new NotImplementedException(); - //return ObjectContext.Categories; - } - - private EntityState GetEntityState(object entity) - { - throw new NotImplementedException(); - //ObjectStateEntry stateEntry = null; - //if (!this.ObjectContext.ObjectStateManager.TryGetObjectStateEntry(entity, out stateEntry)) - //{ - // return EntityState.Detached; - //} - //return stateEntry.State; - } - } - - /// - /// Derived provider that overrides Context creation to use the current - /// active connection. - /// - [EnableClientAccess] - [ServiceContract(Name = "Northwind")] - public class NorthwindPOCO_CUD : EFCoreNorthwindPOCO - { - // TODo - // protected override NorthwindEntities CreateObjectContext() - // { - // NorthwindEntities context = null; - - // string connection = DBImager.GetNewDatabaseConnectionString("Northwind"); - // if (!string.IsNullOrEmpty(connection)) - // { - // // if there is an active connection in scope use it - // var builder = new EntityConnectionStringBuilder(); - // builder.ConnectionString = ConfigurationManager.ConnectionStrings[NorthwindEntities.ConnectionStringName].ConnectionString; - // builder.ProviderConnectionString = connection; - // context = new NorthwindEntities(builder.ConnectionString); - // } - // else - // { - // context = base.CreateObjectContext(); - // } - - // return context; - // } - } -} From 70d881a11c6d2c40ea034f86aaeffb94d4ebe522 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 21:32:29 +0100 Subject: [PATCH 17/99] Add some TODO code/docs to type descriptor --- ...esDomainServiceEFCoreDescriptionProvider.cs | 9 +++++++++ ...nqToEntitiesEFCoreTypeDescriptionContext.cs | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs index e92e57563..baaf655e6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data.Entity.Core.Metadata.Edm; +using Microsoft.EntityFrameworkCore.Metadata; #if RIACONTRIB using System.ServiceModel.DomainServices.Server; #endif @@ -47,6 +48,14 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom // call into base so the TDs are chained parent = base.GetTypeDescriptor(objectType, parent); + // TODO: Check if ef model + var model = _typeDescriptionContext.Model; + if (model != null && model.FindEntityType(objectType.FullName) is IEntityType entityType) + { + // TODO: ... + } + + StructuralType edmType = this._typeDescriptionContext.GetEdmType(objectType); if (edmType != null && (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || edmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index c319a8bf4..a531cdf4e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -6,6 +6,8 @@ using System.Globalization; using System.Linq; using OpenRiaServices.Server; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore; namespace OpenRiaServices.EntityFrameworkCore { @@ -17,6 +19,7 @@ internal class LinqToEntitiesEFCoreTypeDescriptionContext : TypeDescriptionConte private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; private MetadataWorkspace _metadataWorkspace; + private IModel _model; /// /// Constructor that accepts a LINQ To Entities context type @@ -31,6 +34,21 @@ public LinqToEntitiesEFCoreTypeDescriptionContext(Type contextType) this._contextType = contextType; } + // TODO: Add model property _context.Model + public IModel Model + { + get + { + if (_model == null) + { + // TODO: Is there a smarter way ?? + var dbContext = (DbContext)Activator.CreateInstance(_contextType); + _model = dbContext.Model; + } + return _model; + } + } + /// /// Gets the MetadataWorkspace for the context /// From fbb039765afb7e35a0b93395237818c0ac1a08ae Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 21:32:48 +0100 Subject: [PATCH 18/99] Update projects since files where removed --- .../Test/DomainServiceDescriptionTest.cs | 6 ++++-- .../Test/OpenRiaServices.Server.Test.csproj | 3 +-- src/RiaServices.sln | 20 +++---------------- ...Services.Common.DomainServices.Test.csproj | 7 +------ 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index a4f805b3a..b927a2a96 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -396,9 +396,11 @@ public void DomainServiceDescription_EFPOCO() [TestMethod] public void DomainServiceDescription_EFCoreTestFindEntityType() { + // TODO: Use code such as this to + // First create a context manually and verify that POCO metadata is configured correctly - var ctxt = new DbContextModels.NorthwindEFCoreScaffolded.NorthwindContext(); - IEntityType entityType = ctxt.Model.FindEntityType(typeof(DbContextModels.NorthwindEFCoreScaffolded.Products).FullName); + var ctxt = new EFCoreModels.Northwind.EFCoreDbCtxNorthwindEntities(); + IEntityType entityType = ctxt.Model.FindEntityType(typeof(EFCoreModels.Northwind.Product).FullName); Assert.IsNotNull(entityType); } diff --git a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj index 1d4cc0d4c..7b44cd496 100644 --- a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj +++ b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj @@ -37,11 +37,10 @@ - + - diff --git a/src/RiaServices.sln b/src/RiaServices.sln index 0f6c713e1..1434d1ec9 100644 --- a/src/RiaServices.sln +++ b/src/RiaServices.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31624.102 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32014.148 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{1CED8364-77AC-4254-869F-1E4EC5A33416}" EndProject @@ -142,11 +142,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Client.Doma EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Server.EntityFrameworkCore", "OpenRiaServices.Server.EntityFrameworkCore\Framework\OpenRiaServices.Server.EntityFrameworkCore.csproj", "{B8D39090-3B76-41BB-A139-956E42619E91}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreCodeFirstModels_dont_care", "OpenRiaServices.Server.EntityFrameworkCore\Test\CodeFirstModel\EFCoreCodeFirstModels_dont_care.csproj", "{D18943F4-49C8-49E5-A658-1FD4E59C7E0D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreDbContextModels", "OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\EFCoreDbContextModels.csproj", "{6F468ADB-5799-4C24-93C5-765120AAAA4E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCorePOCOModels", "Test\Desktop\EFCodePOCOModels\EFCorePOCOModels.csproj", "{28B11752-D00D-4BD9-B496-A54371F5C6D9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreModels", "OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\EFCoreModels.csproj", "{6F468ADB-5799-4C24-93C5-765120AAAA4E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -350,18 +346,10 @@ Global {B8D39090-3B76-41BB-A139-956E42619E91}.Debug|Any CPU.Build.0 = Debug|Any CPU {B8D39090-3B76-41BB-A139-956E42619E91}.Release|Any CPU.ActiveCfg = Release|Any CPU {B8D39090-3B76-41BB-A139-956E42619E91}.Release|Any CPU.Build.0 = Release|Any CPU - {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D18943F4-49C8-49E5-A658-1FD4E59C7E0D}.Release|Any CPU.Build.0 = Release|Any CPU {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Debug|Any CPU.Build.0 = Debug|Any CPU {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Release|Any CPU.ActiveCfg = Release|Any CPU {6F468ADB-5799-4C24-93C5-765120AAAA4E}.Release|Any CPU.Build.0 = Release|Any CPU - {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28B11752-D00D-4BD9-B496-A54371F5C6D9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -428,9 +416,7 @@ Global {7026BE35-4A31-4C10-B9C8-98BA36D333C5} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} {92A7B751-DF5E-40AA-8846-C9ABAD8DA6AA} = {5612B0C3-4314-4795-ACA9-DDC5F25AE04D} {B8D39090-3B76-41BB-A139-956E42619E91} = {2095B11C-903C-47FF-B812-82DFA7A068AC} - {D18943F4-49C8-49E5-A658-1FD4E59C7E0D} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} {6F468ADB-5799-4C24-93C5-765120AAAA4E} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} - {28B11752-D00D-4BD9-B496-A54371F5C6D9} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C135CEC9-180C-4B67-92AC-3342375AE14C} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index bb1626d49..310b044a4 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -24,8 +24,7 @@ - - + @@ -491,7 +490,6 @@ AdventureWorks.cs AdventureWorks.edmx - MSLinqToSQLGenerator Northwind.designer.cs @@ -582,9 +580,6 @@ - - - TextTemplatingFileGenerator From 37dc97ebc4060925c3dcfa68b94552a9dac13ccf Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 22:02:12 +0100 Subject: [PATCH 19/99] Add Ef Core to tests web project so it can create missing binding redirects --- .../Test/TestWap/TestWap.csproj | 2 +- src/Test/WebsiteFullTrust/Web.config | 52 ++++++++++++++++++- .../WebsiteFullTrust/WebsiteFullTrust.csproj | 7 +++ 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj b/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj index 7e74401a2..926474e35 100644 --- a/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj +++ b/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj @@ -108,7 +108,7 @@ - 4.5.4 + 4.5.3 diff --git a/src/Test/WebsiteFullTrust/Web.config b/src/Test/WebsiteFullTrust/Web.config index 02dda8a63..39581d94b 100644 --- a/src/Test/WebsiteFullTrust/Web.config +++ b/src/Test/WebsiteFullTrust/Web.config @@ -1,4 +1,4 @@ - + @@ -68,4 +68,52 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj index 597f8c99b..db6f83096 100644 --- a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj +++ b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj @@ -110,6 +110,10 @@ {b2183838-a948-47fd-8ab4-e8e7c5cd4477} OpenRiaServices.Server.Authentication.AspNetMembership + + {b8d39090-3b76-41bb-a139-956e42619e91} + OpenRiaServices.Server.EntityFrameworkCore + {B33BF27F-7DF7-46FF-A1DA-F12A873E124F} OpenRiaServices.Tools @@ -139,6 +143,9 @@ 6.4.4 + + 3.1.20 + 10.0 From f6c2c968c3f2ea3c1c24fd76984ad350af6ca097 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 22:02:24 +0100 Subject: [PATCH 20/99] Update test Uri's --- .../Data/CrossDomainServiceQueryTests.cs | 16 ++++++++++ .../Test/Client.Test/Data/UpdateTests.cs | 31 ++----------------- .../Test/Client.Test/TestUris.cs | 8 +++-- 3 files changed, 24 insertions(+), 31 deletions(-) diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs index aca757bad..08f2af41c 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs @@ -584,4 +584,20 @@ protected override Northwind CreateNorthwind() return new Northwind(TestURIs.DbCtx_Northwind); } } + /** TODO: + * + [TestClass] + public class EFCoreQueryTests : CrossDomainServiceQueryTests + { + public EFCoreQueryTests() + : base(TestURIs.EFCore_Catalog, ProviderType.EFCore) + { + } + + protected override Northwind CreateNorthwind() + { + return new Northwind(TestURIs.EFCore_Northwind); + } + } + **/ } diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs index 461e0a545..840127a86 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs @@ -4475,10 +4475,10 @@ TestContext testContext } [TestClass] - public class EFCoreEFCFUpdateTests : UpdateTests + public class EFCoreUpdateTests : UpdateTests { - public EFCoreEFCFUpdateTests() - : base(TestURIs.EFCoreEFCF_Northwind_CUD, ProviderType.EFCore) + public EFCoreUpdateTests() + : base(TestURIs.EFCore_Northwind_CUD, ProviderType.EFCore) { } @@ -4523,31 +4523,6 @@ TestContext testContext } } - [TestClass] - public class EFCoreDbCtxUpdateTests : UpdateTests - { - public EFCoreDbCtxUpdateTests() - : base(TestURIs.EFCoreDbCtx_Northwind_CUD, ProviderType.EFCore) - { - } - - /// - /// Silverlight version of class initializer doesn't take TestContext - /// - [ClassInitialize] - public static void ClassSetup( -#if !SILVERLIGHT - TestContext testContext -#endif -) - { - // ensure that our isolation DB has been created once and only once - // at the test fixture level - TestDatabase.Initialize(); - } - } - - /// /// Non DAL/DB scenario tests /// diff --git a/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs b/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs index 10ca9bef9..ac62f1d0e 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs @@ -22,13 +22,15 @@ public static class TestURIs public static readonly Uri EF_Northwind_POCO_CUD = new Uri(RootURI, "TestDomainServices-EF-NorthwindPOCO_CUD.svc"); // EF CodeFirst - public static readonly Uri EFCoreEFCF_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCoreEFCF-Northwind_CUD.svc"); public static readonly Uri EFCF_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCF-Northwind_CUD.svc"); public static readonly Uri DbCtx_Northwind_CUD = new Uri(RootURI, "TestDomainServices-DbCtx-Northwind_CUD.svc"); - public static readonly Uri EFCoreDbCtx_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCoreDbCtx-Northwind_CUD.svc"); public static readonly Uri DbCtx_Northwind = new Uri(RootURI, "TestDomainServices-DbCtx-Northwind.svc"); public static readonly Uri DbCtx_Catalog = new Uri(RootURI, "TestDomainServices-DbCtx-Catalog.svc"); - public static readonly Uri EFCodeFirst = new Uri(RootURI, "EFCodeFirst-EFCodeFirstTestDomainService.svc"); + public static readonly Uri EFCodeFirst = new Uri(RootURI, "EFCodeFirst-EFCodeFirstTestDomainService.svc"); + + // EF Core + public static readonly Uri EFCore_Northwind = new Uri(RootURI, "TestDomainServices-EFCore-Northwind.svc"); + public static readonly Uri EFCore_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCore-Northwind_CUD.svc"); // LTS public static readonly Uri LTS_Catalog = new Uri(RootURI, "TestDomainServices-LTS-Catalog.svc"); From b153c57522e077bb79f4b01c1346f7c93432dc8f Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 22:06:22 +0100 Subject: [PATCH 21/99] Fix resources and make smalles possible change to get typedescriptor starting to use "EF core model" --- ...rviceEFCoreDescriptionProviderAttribute.cs | 1 + .../Framework/DbResource.Designer.cs | 20 +++++++++---------- ...sDomainServiceEFCoreDescriptionProvider.cs | 8 ++------ ...rviceEFCoreDescriptionProviderAttribute.cs | 1 + ...qToEntitiesEFCoreTypeDescriptionContext.cs | 6 +++++- .../Framework/MetadataResource.Designer.cs | 4 ++-- .../MetadataWorkspaceUtilitiesEFCore.cs | 5 +++-- ...Services.Server.EntityFrameworkCore.csproj | 6 +++++- .../Framework/ResourceEFCore.Designer.cs | 6 +++--- 9 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs index ec3b57d7f..8ffbd80b8 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore; using System.Globalization; using OpenRiaServices.Server; +using OpenRiaServices.Server.EntityFrameworkCore; namespace OpenRiaServices.EntityFrameworkCore { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs index ae4181fff..2146c1a29 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbResource.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace OpenRiaServices.EntityFrameworkCore { +namespace OpenRiaServices.Server.EntityFrameworkCore { using System; @@ -19,10 +19,10 @@ namespace OpenRiaServices.EntityFrameworkCore { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class DbResource { + internal class DbResource { private static global::System.Resources.ResourceManager resourceMan; @@ -36,10 +36,10 @@ internal DbResource() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { + internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.DbResource", typeof(DbResource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.Server.EntityFrameworkCore.DbResource", typeof(DbResource).Assembly); resourceMan = temp; } return resourceMan; @@ -51,7 +51,7 @@ internal DbResource() { /// resource lookups using this strongly typed resource class. ///
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { + internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal DbResource() { /// /// Looks up a localized string similar to The DbContext type '{0}' does not contain a default constructor. A default constructor is required to use EntityFramework in the Code-First mode with WCF RIA Services.. /// - public static string DefaultCtorNotFound { + internal static string DefaultCtorNotFound { get { return ResourceManager.GetString("DefaultCtorNotFound", resourceCulture); } @@ -72,7 +72,7 @@ public static string DefaultCtorNotFound { /// /// Looks up a localized string similar to Type '{0}' is not a valid DbDomainServiceDescriptionProviderAttribute parameter because it does not derive from DbContext.. /// - public static string InvalidDbDomainServiceDescriptionProviderSpecification { + internal static string InvalidDbDomainServiceDescriptionProviderSpecification { get { return ResourceManager.GetString("InvalidDbDomainServiceDescriptionProviderSpecification", resourceCulture); } @@ -81,7 +81,7 @@ public static string InvalidDbDomainServiceDescriptionProviderSpecification { /// /// Looks up a localized string similar to Failed to get the MetadataWorkspace for the DbContext type '{0}'.. /// - public static string MetadataWorkspaceNotFound { + internal static string MetadataWorkspaceNotFound { get { return ResourceManager.GetString("MetadataWorkspaceNotFound", resourceCulture); } @@ -90,7 +90,7 @@ public static string MetadataWorkspaceNotFound { /// /// Looks up a localized string similar to ObjectStateManager not initialized for the DbContext type '{0}'.. /// - public static string ObjectStateManagerNotFoundException { + internal static string ObjectStateManagerNotFoundException { get { return ResourceManager.GetString("ObjectStateManagerNotFoundException", resourceCulture); } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs index baaf655e6..fb2fef082 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs @@ -76,12 +76,8 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom public override bool LookupIsEntityType(Type type) { - StructuralType edmType = this._typeDescriptionContext.GetEdmType(type); - if (edmType != null && edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) - { - return true; - } - return false; + // TODO: Check if ef model, need to double check it fails for non- entity types + return _typeDescriptionContext.GetEntityType(type) != null; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs index 2ad4fdab7..a945a1eb5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs @@ -2,6 +2,7 @@ using System.ComponentModel; using System.Globalization; using OpenRiaServices.Server; +using OpenRiaServices.Server.EntityFrameworkCore; namespace OpenRiaServices.EntityFrameworkCore { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index a531cdf4e..9bcccd872 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -8,6 +8,7 @@ using OpenRiaServices.Server; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore; +using OpenRiaServices.Server.EntityFrameworkCore; namespace OpenRiaServices.EntityFrameworkCore { @@ -49,6 +50,8 @@ public IModel Model } } + public IEntityType GetEntityType(Type type) => Model.FindEntityType(type); + /// /// Gets the MetadataWorkspace for the context /// @@ -72,7 +75,8 @@ public MetadataWorkspace MetadataWorkspace /// The StructuralType that corresponds to the given CLR type public StructuralType GetEdmType(Type clrType) { - return ObjectContextUtilitiesEFCore.GetEdmType(this.MetadataWorkspace, clrType); + return null; + //return ObjectContextUtilitiesEFCore.GetEdmType(this.MetadataWorkspace, clrType); } /// diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs index 2f927a582..e9ea4873d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs @@ -19,7 +19,7 @@ namespace System.Data.Mapping { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class MetadataResource { @@ -39,7 +39,7 @@ internal MetadataResource() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.MetadataResource", typeof(MetadataResource).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.Server.EntityFrameworkCore.MetadataResource", typeof(MetadataResource).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs index 5372bb875..6688ddfb1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs @@ -5,6 +5,7 @@ using OpenRiaServices; using System.Data.Entity.Core.Metadata.Edm; using Microsoft.EntityFrameworkCore; +using OpenRiaServices.Server.EntityFrameworkCore; namespace System.Data.Mapping { @@ -31,7 +32,7 @@ public static MetadataWorkspace CreateMetadataWorkspace(Type contextType) { if (contextType.GetConstructor(Type.EmptyTypes) == null) { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFrameworkCore.DbResource.DefaultCtorNotFound, contextType.FullName)); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, DbResource.DefaultCtorNotFound, contextType.FullName)); } try @@ -45,7 +46,7 @@ public static MetadataWorkspace CreateMetadataWorkspace(Type contextType) throw; } - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, OpenRiaServices.EntityFrameworkCore.DbResource.MetadataWorkspaceNotFound + ProcessException(efException), contextType.FullName), efException); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, DbResource.MetadataWorkspaceNotFound + ProcessException(efException), contextType.FullName), efException); } } #endif diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 6c4d04487..158d4c535 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -40,7 +40,7 @@ - PublicResXFileCodeGenerator + ResXFileCodeGenerator DbResource.Designer.cs Designer @@ -49,5 +49,9 @@ MetadataResource.Designer.cs System.Data.Mapping + + ResXFileCodeGenerator + ResourceEFCore.Designer.cs + \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs index fb1f21893..a6c815772 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace OpenRiaServices.EntityFrameworkCore { +namespace OpenRiaServices.Server.EntityFrameworkCore { using System; @@ -19,7 +19,7 @@ namespace OpenRiaServices.EntityFrameworkCore { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class ResourceEFCore { @@ -39,7 +39,7 @@ internal ResourceEFCore() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFrameworkCore.Resource", typeof(ResourceEFCore).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.Server.EntityFrameworkCore.ResourceEFCore", typeof(ResourceEFCore).Assembly); resourceMan = temp; } return resourceMan; From 133c9c1237930fbb102034ae584d1ca6068995e9 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Feb 2022 22:06:52 +0100 Subject: [PATCH 22/99] Match existing releationship names --- .../DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs | 4 ++-- .../Test/DbContextModel/Northwind/Order.cs | 4 ++-- .../Test/DbContextModel/Northwind/Product.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index 628d15bd6..d1139487b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -262,13 +262,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasDefaultValueSql("(0)"); entity.HasOne(d => d.Order) - .WithMany(p => p.OrderDetails) + .WithMany(p => p.Order_Details) .HasForeignKey(d => d.OrderID) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_Order_Details_Orders"); entity.HasOne(d => d.Product) - .WithMany(p => p.OrderDetails) + .WithMany(p => p.Order_Details) .HasForeignKey(d => d.ProductID) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_Order_Details_Products"); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs index 76cbcfac4..67786b97f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs @@ -11,7 +11,7 @@ public partial class Order { public Order() { - OrderDetails = new HashSet(); + Order_Details = new HashSet(); } public int OrderID { get; set; } @@ -32,6 +32,6 @@ public Order() public virtual Customer Customer { get; set; } public virtual Employees Employee { get; set; } public virtual Shipper ShipViaNavigation { get; set; } - public virtual ICollection OrderDetails { get; set; } + public virtual ICollection Order_Details { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs index 7068aa68d..2802a1bae 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs @@ -11,7 +11,7 @@ public partial class Product { public Product() { - OrderDetails = new HashSet(); + Order_Details = new HashSet(); } public int ProductID { get; set; } @@ -27,6 +27,6 @@ public Product() public virtual Category Category { get; set; } public virtual Supplier Supplier { get; set; } - public virtual ICollection OrderDetails { get; set; } + public virtual ICollection Order_Details { get; set; } } } From 77d89177258731ed73f7a846da1ed07a4d71dc69 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 16 Feb 2022 19:36:59 +0100 Subject: [PATCH 23/99] setup some basic functionality of EF core type descriptor --- ...sDomainServiceEFCoreDescriptionProvider.cs | 9 +- ...qToEntitiesEFCoreTypeDescriptionContext.cs | 119 +++++----- .../LinqToEntitiesEFCoreTypeDescriptor.cs | 205 ++++++++---------- .../Framework/TypeDescriptionContextBase.cs | 7 +- 4 files changed, 156 insertions(+), 184 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs index fb2fef082..40a498769 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs @@ -53,15 +53,8 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom if (model != null && model.FindEntityType(objectType.FullName) is IEntityType entityType) { // TODO: ... - } - - - StructuralType edmType = this._typeDescriptionContext.GetEdmType(objectType); - if (edmType != null && - (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || edmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) - { // only add an LTE TypeDescriptor if the type is an EF Entity or ComplexType - td = new LinqToEntitiesEFCoreTypeDescriptor(this._typeDescriptionContext, edmType, parent); + td = new LinqToEntitiesEFCoreTypeDescriptor(this._typeDescriptionContext, entityType, parent); } else { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index 9bcccd872..6251b2ccf 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore; using OpenRiaServices.Server.EntityFrameworkCore; +using System.Diagnostics; namespace OpenRiaServices.EntityFrameworkCore { @@ -19,7 +20,6 @@ internal class LinqToEntitiesEFCoreTypeDescriptionContext : TypeDescriptionConte { private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; - private MetadataWorkspace _metadataWorkspace; private IModel _model; /// @@ -52,22 +52,6 @@ public IModel Model public IEntityType GetEntityType(Type type) => Model.FindEntityType(type); - /// - /// Gets the MetadataWorkspace for the context - /// - public MetadataWorkspace MetadataWorkspace - { - get - { - if (this._metadataWorkspace == null) - { - // we only support embedded mappings - this._metadataWorkspace = MetadataWorkspaceUtilitiesEFCore.CreateMetadataWorkspace(this._contextType); - } - return this._metadataWorkspace; - } - } - /// /// Returns the that corresponds to the given CLR type /// @@ -79,67 +63,76 @@ public StructuralType GetEdmType(Type clrType) //return ObjectContextUtilitiesEFCore.GetEdmType(this.MetadataWorkspace, clrType); } - /// - /// Returns the association information for the specified navigation property. - /// - /// The navigation property to return association information for - /// The association info - internal AssociationInfo GetAssociationInfo(NavigationProperty navigationProperty) - { - lock (this._associationMap) - { - string associationName = navigationProperty.RelationshipType.FullName; - AssociationInfo associationInfo = null; - if (!this._associationMap.TryGetValue(associationName, out associationInfo)) - { - AssociationType associationType = (AssociationType)navigationProperty.RelationshipType; - - if (!associationType.ReferentialConstraints.Any()) - { - // We only support EF models where FK info is part of the model. - throw new NotSupportedException( - string.Format(CultureInfo.CurrentCulture, - ResourceEFCore.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); - } - - associationInfo = new AssociationInfo(); - associationInfo.FKRole = associationType.ReferentialConstraints[0].ToRole.Name; - associationInfo.Name = this.GetAssociationName(navigationProperty, associationInfo.FKRole); - associationInfo.ThisKey = associationType.ReferentialConstraints[0].ToProperties.Select(p => p.Name).ToArray(); - associationInfo.OtherKey = associationType.ReferentialConstraints[0].FromProperties.Select(p => p.Name).ToArray(); - associationInfo.IsRequired = associationType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.One; - - this._associationMap[associationName] = associationInfo; - } - - return associationInfo; - } - } + ///// + ///// Returns the association information for the specified navigation property. + ///// + ///// The navigation property to return association information for + ///// The association info + //internal AssociationInfo GetAssociationInfo(NavigationProperty navigationProperty) + //{ + // lock (this._associationMap) + // { + // string associationName = navigationProperty.RelationshipType.FullName; + // AssociationInfo associationInfo = null; + // if (!this._associationMap.TryGetValue(associationName, out associationInfo)) + // { + // AssociationType associationType = (AssociationType)navigationProperty.RelationshipType; + + // if (!associationType.ReferentialConstraints.Any()) + // { + // // We only support EF models where FK info is part of the model. + // throw new NotSupportedException( + // string.Format(CultureInfo.CurrentCulture, + // ResourceEFCore.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); + // } + + // associationInfo = new AssociationInfo(); + // associationInfo.FKRole = associationType.ReferentialConstraints[0].ToRole.Name; + // associationInfo.Name = this.GetAssociationName(navigationProperty, associationInfo.FKRole); + // associationInfo.ThisKey = associationType.ReferentialConstraints[0].ToProperties.Select(p => p.Name).ToArray(); + // associationInfo.OtherKey = associationType.ReferentialConstraints[0].FromProperties.Select(p => p.Name).ToArray(); + // associationInfo.IsRequired = associationType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.One; + + // this._associationMap[associationName] = associationInfo; + // } + + // return associationInfo; + // } + //} /// /// Creates an AssociationAttribute for the specified navigation property /// /// The navigation property that corresponds to the association (it identifies the end points) /// A new AssociationAttribute that describes the given navigation property association - internal AssociationAttribute CreateAssociationAttribute(NavigationProperty navigationProperty) + internal AssociationAttribute CreateAssociationAttribute(INavigation navigationProperty) { - AssociationInfo assocInfo = this.GetAssociationInfo(navigationProperty); - bool isForeignKey = navigationProperty.FromEndMember.Name == assocInfo.FKRole; + var fk = navigationProperty.ForeignKey; + + + //// // We only support EF models where FK info is part of the model. + //if (fk is null) + // throw new NotSupportedException( + // string.Format(CultureInfo.CurrentCulture, + // ResourceEFCore.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); + string thisKey; string otherKey; - if (isForeignKey) + if (navigationProperty.IsDependentToPrincipal()) { - thisKey = FormatMemberList(assocInfo.ThisKey); - otherKey = FormatMemberList(assocInfo.OtherKey); + thisKey = FormatMemberList(fk.Properties); + otherKey = FormatMemberList(fk.PrincipalKey.Properties); } else { - otherKey = FormatMemberList(assocInfo.ThisKey); - thisKey = FormatMemberList(assocInfo.OtherKey); + Debug.Assert(fk.PrincipalEntityType == navigationProperty.DeclaringEntityType); + + otherKey = FormatMemberList(fk.PrincipalKey.Properties); + thisKey = FormatMemberList(fk.Properties); } - AssociationAttribute assocAttrib = new AssociationAttribute(assocInfo.Name, thisKey, otherKey); - assocAttrib.IsForeignKey = isForeignKey; + AssociationAttribute assocAttrib = new AssociationAttribute(fk.GetConstraintName(), thisKey, otherKey); + assocAttrib.IsForeignKey = navigationProperty.IsDependentToPrincipal(); // TODO: isForeignKey; return assocAttrib; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs index ed6d31c94..3e504b8a0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs @@ -11,6 +11,7 @@ using OpenRiaServices.Server; using System.Data.Entity.Core.Metadata.Edm; using System.Data.Entity.Core.Objects.DataClasses; +using Microsoft.EntityFrameworkCore.Metadata; namespace OpenRiaServices.EntityFrameworkCore { @@ -20,43 +21,36 @@ namespace OpenRiaServices.EntityFrameworkCore internal class LinqToEntitiesEFCoreTypeDescriptor : TypeDescriptorBase { private readonly LinqToEntitiesEFCoreTypeDescriptionContext _typeDescriptionContext; - private readonly StructuralType _edmType; - private readonly EdmMember _timestampMember; - private readonly HashSet _foreignKeyMembers; + private readonly IEntityType _entityType; + private readonly IProperty _timestampProperty; private readonly bool _keyIsEditable; - /// - /// Constructor taking a metadata context, an structural type, and a parent custom type descriptor - /// - /// The context. - /// The type (can be an entity or complex type). - /// The parent custom type descriptor. - public LinqToEntitiesEFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescriptionContext, StructuralType edmType, ICustomTypeDescriptor parent) - : base(parent) + public LinqToEntitiesEFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescriptionContext, IEntityType entityType, ICustomTypeDescriptor parent) + : base(parent) { this._typeDescriptionContext = typeDescriptionContext; - this._edmType = edmType; + this._entityType = entityType; - EdmMember[] timestampMembers = this._edmType.Members.Where(p => ObjectContextUtilitiesEFCore.IsConcurrencyTimestamp(p)).ToArray(); + var timestampMembers = entityType.GetProperties().Where(p => p.IsConcurrencyToken).ToArray(); if (timestampMembers.Length == 1) { - this._timestampMember = timestampMembers[0]; + this._timestampProperty = timestampMembers[0]; } - if (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + // if (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) { // if any FK member of any association is also part of the primary key, then the key cannot be marked // Editable(false) - EntityType entityType = (EntityType)edmType; - this._foreignKeyMembers = new HashSet(entityType.NavigationProperties.SelectMany(p => p.GetDependentProperties())); - foreach (EdmProperty foreignKeyMember in this._foreignKeyMembers) - { - if (entityType.KeyMembers.Contains(foreignKeyMember)) - { - this._keyIsEditable = true; - break; - } - } + var fk = entityType.GetNavigations().SelectMany(n => n.ForeignKey.Properties).ToHashSet(); + //this._foreignKeyMembers + //foreach (EdmProperty foreignKeyMember in this._foreignKeyMembers) + //{ + // if (entityType.KeyMembers.Contains(foreignKeyMember)) + // { + // this._keyIsEditable = true; + // break; + // } + //} } } @@ -71,17 +65,6 @@ public LinqToEntitiesEFCoreTypeDescriptionContext TypeDescriptionContext } } - /// - /// Gets the Edm type - /// - private StructuralType EdmType - { - get - { - return this._edmType; - } - } - /// /// Returns a collection of all the s we infer from the metadata associated /// with the metadata member corresponding to the given property descriptor @@ -105,21 +88,17 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor bool inferRoundtripOriginalAttribute = false; bool hasKeyAttribute = (pd.Attributes[typeof(KeyAttribute)] != null); - bool isEntity = this.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; - if (isEntity) + bool isEntity = true; // this.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + var property = _entityType.FindProperty(pd.Name); + + if (property != null) { - EntityType entityType = (EntityType)this.EdmType; - EdmMember keyMember = entityType.KeyMembers.SingleOrDefault(k => k.Name == pd.Name); - if (keyMember != null && !hasKeyAttribute) + if (property.IsPrimaryKey()) { attributes.Add(new KeyAttribute()); hasKeyAttribute = true; } - } - EdmProperty member = this.EdmType.Members.SingleOrDefault(p => p.Name == pd.Name) as EdmProperty; - if (member != null) - { if (hasKeyAttribute) { // key members must always be roundtripped @@ -136,20 +115,20 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor bool databaseGenerated = false; if (pd.Attributes[typeof(DatabaseGeneratedAttribute)] == null) { - MetadataProperty md = ObjectContextUtilitiesEFCore.GetStoreGeneratedPattern(member); - if (md != null) - { - if ((string)md.Value == "Computed") - { - attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Computed)); - databaseGenerated = true; - } - else if ((string)md.Value == "Identity") - { - attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)); - databaseGenerated = true; - } - } + //MetadataProperty md = ObjectContextUtilitiesEFCore.GetStoreGeneratedPattern(member); + //if (property.ValueGenerated != ValueGenerated.Never) + //{ + // if ((string)md.Value == "Computed") + // { + // attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Computed)); + // databaseGenerated = true; + // } + // else if ((string)md.Value == "Identity") + // { + // attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)); + // databaseGenerated = true; + // } + //} } else { @@ -157,17 +136,16 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor } // Add implicit ConcurrencyCheck attribute to metadata if ConcurrencyMode is anything other than ConcurrencyMode.None - Facet facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "ConcurrencyMode"); - if (facet != null && facet.Value != null && (ConcurrencyMode)facet.Value != ConcurrencyMode.None && + if (property.IsConcurrencyToken && pd.Attributes[typeof(ConcurrencyCheckAttribute)] == null) { attributes.Add(new ConcurrencyCheckAttribute()); inferRoundtripOriginalAttribute = true; } - + // Add Required attribute to metadata if the member cannot be null and it is either a reference type or a Nullable // unless it is a database generated field - if (!member.Nullable && (!pd.PropertyType.IsValueType || IsNullableType(pd.PropertyType)) + if (!property.IsNullable && (!pd.PropertyType.IsValueType || IsNullableType(pd.PropertyType)) && !databaseGenerated && pd.Attributes[typeof(RequiredAttribute)] == null) { @@ -178,49 +156,44 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor if (isStringType && pd.Attributes[typeof(StringLengthAttribute)] == null) { - facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "MaxLength"); - if (facet != null && facet.Value != null && facet.Value.GetType() == typeof(int)) + if (property.GetMaxLength() is int maxLength) { - // need to test for Type int, since the value can also be of type - // System.Data.Entity.Core.Metadata.Edm.EdmConstants.Unbounded - int maxLength = (int)facet.Value; attributes.Add(new StringLengthAttribute(maxLength)); } } - bool hasTimestampAttribute = (pd.Attributes[typeof(TimestampAttribute)] != null); - - if (this._timestampMember == member && !hasTimestampAttribute) - { - attributes.Add(new TimestampAttribute()); - hasTimestampAttribute = true; - } + //bool hasTimestampAttribute = (pd.Attributes[typeof(TimestampAttribute)] != null); + //if (this._timestampMember == member && !hasTimestampAttribute) + //{ + // attributes.Add(new TimestampAttribute()); + // hasTimestampAttribute = true; + //} // All members marked with TimestampAttribute (inferred or explicit) need to // have [Editable(false)] and [RoundtripOriginal] applied - if (hasTimestampAttribute) - { - inferRoundtripOriginalAttribute = true; + //if (hasTimestampAttribute) + //{ + // inferRoundtripOriginalAttribute = true; - if (editableAttribute == null) - { - editableAttribute = new EditableAttribute(false); - } - } + // if (editableAttribute == null) + // { + // editableAttribute = new EditableAttribute(false); + // } + //} // Add RTO to this member if required. If this type has a timestamp // member that member should be the ONLY member we apply RTO to. // Dont apply RTO if it is an association member. - bool isForeignKeyMember = this._foreignKeyMembers != null && this._foreignKeyMembers.Contains(member); - if ((this._timestampMember == null || this._timestampMember == member) && - (inferRoundtripOriginalAttribute || isForeignKeyMember) && - pd.Attributes[typeof(AssociationAttribute)] == null) - { - if (pd.Attributes[typeof(RoundtripOriginalAttribute)] == null) - { - attributes.Add(new RoundtripOriginalAttribute()); - } - } + //bool isForeignKeyMember = this._foreignKeyMembers != null && this._foreignKeyMembers.Contains(member); + //if ((this._timestampMember == null || this._timestampMember == member) && + // (inferRoundtripOriginalAttribute || isForeignKeyMember) && + // pd.Attributes[typeof(AssociationAttribute)] == null) + //{ + // if (pd.Attributes[typeof(RoundtripOriginalAttribute)] == null) + // { + // attributes.Add(new RoundtripOriginalAttribute()); + // } + //} } // Add the Editable attribute if required @@ -229,9 +202,21 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor attributes.Add(editableAttribute); } - if (isEntity) + if (_entityType.FindNavigation(pd.Name) is INavigation navigation) { this.AddAssociationAttributes(pd, attributes); + + bool isManyToMany = false; // TODO: Fix for EF5+ + if (!isManyToMany) + { + AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(System.ComponentModel.DataAnnotations.AssociationAttribute)]; + if (assocAttrib == null) + { + assocAttrib = this.TypeDescriptionContext.CreateAssociationAttribute(navigation); + attributes.Add(assocAttrib); + } + } + } return attributes.ToArray(); @@ -267,22 +252,22 @@ internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) /// The list of attributes to append to private void AddAssociationAttributes(PropertyDescriptor pd, List attributes) { - EntityType entityType = (EntityType)this.EdmType; - NavigationProperty navProperty = entityType.NavigationProperties.Where(n => n.Name == pd.Name).SingleOrDefault(); - if (navProperty != null) - { - bool isManyToMany = navProperty.RelationshipType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.Many && - navProperty.RelationshipType.RelationshipEndMembers[1].RelationshipMultiplicity == RelationshipMultiplicity.Many; - if (!isManyToMany) - { - AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(System.ComponentModel.DataAnnotations.AssociationAttribute)]; - if (assocAttrib == null) - { - assocAttrib = this.TypeDescriptionContext.CreateAssociationAttribute(navProperty); - attributes.Add(assocAttrib); - } - } - } + //EntityType entityType = (EntityType)this.EdmType; + //NavigationProperty navProperty = entityType.NavigationProperties.Where(n => n.Name == pd.Name).SingleOrDefault(); + //if (navProperty != null) + //{ + // bool isManyToMany = navProperty.RelationshipType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.Many && + // navProperty.RelationshipType.RelationshipEndMembers[1].RelationshipMultiplicity == RelationshipMultiplicity.Many; + // if (!isManyToMany) + // { + // AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(System.ComponentModel.DataAnnotations.AssociationAttribute)]; + // if (assocAttrib == null) + // { + // assocAttrib = this.TypeDescriptionContext.CreateAssociationAttribute(navProperty); + // attributes.Add(assocAttrib); + // } + // } + //} } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs index b0488d606..f1e1b48a9 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; +using Microsoft.EntityFrameworkCore.Metadata; namespace OpenRiaServices.Server { @@ -33,16 +34,16 @@ protected static string MakeUniqueName(string suggested, IEnumerable exi /// /// A collection of members. /// A comma delimited list of member names. - protected static string FormatMemberList(IEnumerable members) + protected static string FormatMemberList(IEnumerable members) { string memberList = string.Empty; - foreach (string name in members) + foreach (var prop in members) { if (memberList.Length > 0) { memberList += ","; } - memberList += name; + memberList += prop.Name; } return memberList; } From 458bb63d5d7591a4474c3957484c247a828f71d4 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 16 Feb 2022 19:37:30 +0100 Subject: [PATCH 24/99] fix compilation of tests after namespace change --- src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index c30457cd8..df4f6a2df 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -175,7 +175,7 @@ public void TestClientCodegen_EFCoreEFDbCtxDomainServices() // Default codegen TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\Scenarios", "CG_Scenarios_EFDbContext", "EFDbContextScenarios.g", - typeof(TestDomainServices.EFCoreDbCtx.Northwind), sharedFiles, false)); + typeof(TestDomainServices.EFCore.Northwind), sharedFiles, false)); } [DeploymentItem(@"Baselines\FullTypeNames\Scenarios", "CG_Scenarios_EFDbContext_FullTypes")] @@ -187,7 +187,7 @@ public void TestClientCodegen_EFCoreEFDbCtxDomainServices_FullTypes() // Full type names TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"FullTypeNames\Scenarios", "CG_Scenarios_EFDbContext_FullTypes", "EFDbContextScenarios.g", - typeof(TestDomainServices.EFCoreDbCtx.Northwind), sharedFiles, true)); + typeof(TestDomainServices.EFCore.Northwind), sharedFiles, true)); } [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFCFDbContext")] From dd21d198e9148c1789e3d280083f3fb59ad1cd9a Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 16 Feb 2022 19:47:24 +0100 Subject: [PATCH 25/99] fix xml namespace --- .../Test/DbContextModel/Northwind/NorthwindPartialClasses.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs index 36d998cba..6b6325e54 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs @@ -5,7 +5,7 @@ // These assembly attributes allow us to serialize different CLR types into the same contract [assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", - ClrNamespace = "DbContextModels.Northwind")] + ClrNamespace = "EFCoreModels.Northwind")] namespace EFCoreModels.Northwind { From ecff4980193969425f5be32ecee2d9f0b5bde347 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 16 Feb 2022 19:49:40 +0100 Subject: [PATCH 26/99] Fix connectionstring in update tests --- .../Northwind/EFCore_Northwind.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index 6c620b8d4..a3743282e 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -515,7 +515,6 @@ protected override EFCoreDbCtxNorthwindEntities CreateDbContext() { // if there is an active connection in scope use it // Here we have to append the mapping file info to the connection string - connection = string.Format("metadata=res://*/Northwind.NorthwindDbCtx.csdl|res://*/Northwind.NorthwindDbCtx.ssdl|res://*/Northwind.NorthwindDbCtx.msl;provider=System.Data.SqlClient;provider connection string=\"{0}\"", connection); context = new EFCoreDbCtxNorthwindEntities(connection); } else From 3a877212b948ead4bbacdc20d4b55c8b14508865 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 16 Feb 2022 20:39:33 +0100 Subject: [PATCH 27/99] Discover some more attributes --- ...qToEntitiesEFCoreTypeDescriptionContext.cs | 11 --- .../LinqToEntitiesEFCoreTypeDescriptor.cs | 90 +++++++------------ 2 files changed, 32 insertions(+), 69 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index 6251b2ccf..5cbadcfd5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -52,17 +52,6 @@ public IModel Model public IEntityType GetEntityType(Type type) => Model.FindEntityType(type); - /// - /// Returns the that corresponds to the given CLR type - /// - /// The CLR type - /// The StructuralType that corresponds to the given CLR type - public StructuralType GetEdmType(Type clrType) - { - return null; - //return ObjectContextUtilitiesEFCore.GetEdmType(this.MetadataWorkspace, clrType); - } - ///// ///// Returns the association information for the specified navigation property. ///// diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs index 3e504b8a0..ae976c1cf 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs @@ -31,7 +31,7 @@ public LinqToEntitiesEFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionCon this._typeDescriptionContext = typeDescriptionContext; this._entityType = entityType; - var timestampMembers = entityType.GetProperties().Where(p => p.IsConcurrencyToken).ToArray(); + var timestampMembers = entityType.GetProperties().Where(p => p.IsConcurrencyToken && p.ValueGenerated == ValueGenerated.OnAddOrUpdate).ToArray(); if (timestampMembers.Length == 1) { this._timestampProperty = timestampMembers[0]; @@ -115,20 +115,20 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor bool databaseGenerated = false; if (pd.Attributes[typeof(DatabaseGeneratedAttribute)] == null) { - //MetadataProperty md = ObjectContextUtilitiesEFCore.GetStoreGeneratedPattern(member); - //if (property.ValueGenerated != ValueGenerated.Never) - //{ - // if ((string)md.Value == "Computed") - // { - // attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Computed)); - // databaseGenerated = true; - // } - // else if ((string)md.Value == "Identity") - // { - // attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)); - // databaseGenerated = true; - // } - //} + switch (property.ValueGenerated) + { + case ValueGenerated.Never: + break; + case ValueGenerated.OnAddOrUpdate: + attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Computed)); + databaseGenerated = true; + break; + case ValueGenerated.OnAdd: + attributes.Add(new DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)); + databaseGenerated = true; + break; + default: throw new NotImplementedException("Only suppport ValueGenerated.OnAdd, OnAddOrUpdate, None"); + } } else { @@ -162,30 +162,30 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor } } - //bool hasTimestampAttribute = (pd.Attributes[typeof(TimestampAttribute)] != null); - //if (this._timestampMember == member && !hasTimestampAttribute) - //{ - // attributes.Add(new TimestampAttribute()); - // hasTimestampAttribute = true; - //} + bool hasTimestampAttribute = (pd.Attributes[typeof(TimestampAttribute)] != null); + if (this._timestampProperty == property && !hasTimestampAttribute) + { + attributes.Add(new TimestampAttribute()); + hasTimestampAttribute = true; + } // All members marked with TimestampAttribute (inferred or explicit) need to // have [Editable(false)] and [RoundtripOriginal] applied - //if (hasTimestampAttribute) - //{ - // inferRoundtripOriginalAttribute = true; + if (hasTimestampAttribute) + { + inferRoundtripOriginalAttribute = true; - // if (editableAttribute == null) - // { - // editableAttribute = new EditableAttribute(false); - // } - //} + if (editableAttribute == null) + { + editableAttribute = new EditableAttribute(false); + } + } // Add RTO to this member if required. If this type has a timestamp // member that member should be the ONLY member we apply RTO to. // Dont apply RTO if it is an association member. //bool isForeignKeyMember = this._foreignKeyMembers != null && this._foreignKeyMembers.Contains(member); - //if ((this._timestampMember == null || this._timestampMember == member) && + //if ((this._timestampProperty == null || this._timestampProperty == property) && // (inferRoundtripOriginalAttribute || isForeignKeyMember) && // pd.Attributes[typeof(AssociationAttribute)] == null) //{ @@ -202,11 +202,10 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor attributes.Add(editableAttribute); } + // Add AssociationAttribute if required for the specified property if (_entityType.FindNavigation(pd.Name) is INavigation navigation) { - this.AddAssociationAttributes(pd, attributes); - - bool isManyToMany = false; // TODO: Fix for EF5+ + bool isManyToMany = navigation.IsCollection() && (navigation.FindInverse()?.IsCollection() == true); if (!isManyToMany) { AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(System.ComponentModel.DataAnnotations.AssociationAttribute)]; @@ -244,30 +243,5 @@ internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) return false; } - - /// - /// Add AssociationAttribute if required for the specified property - /// - /// The property - /// The list of attributes to append to - private void AddAssociationAttributes(PropertyDescriptor pd, List attributes) - { - //EntityType entityType = (EntityType)this.EdmType; - //NavigationProperty navProperty = entityType.NavigationProperties.Where(n => n.Name == pd.Name).SingleOrDefault(); - //if (navProperty != null) - //{ - // bool isManyToMany = navProperty.RelationshipType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.Many && - // navProperty.RelationshipType.RelationshipEndMembers[1].RelationshipMultiplicity == RelationshipMultiplicity.Many; - // if (!isManyToMany) - // { - // AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(System.ComponentModel.DataAnnotations.AssociationAttribute)]; - // if (assocAttrib == null) - // { - // assocAttrib = this.TypeDescriptionContext.CreateAssociationAttribute(navProperty); - // attributes.Add(assocAttrib); - // } - // } - //} - } } } From b3b157ac668e8e8646eec42be36e710d2eafc7d4 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 16 Feb 2022 20:39:47 +0100 Subject: [PATCH 28/99] ignore "calculated properties" from partial classes --- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index d1139487b..ad8579e88 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -341,6 +341,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .WithMany(p => p.Orders) .HasForeignKey(d => d.ShipVia) .HasConstraintName("FK_Orders_Shippers"); + + entity.Ignore(e => e.FormattedName); }); modelBuilder.Entity(entity => @@ -390,10 +392,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .WithMany(p => p.Products) .HasForeignKey(d => d.SupplierID) .HasConstraintName("FK_Products_Suppliers"); + + // Only used for tets + entity.Ignore(e => e.ResolveMethod); }); modelBuilder.Entity(entity => { + entity.ToTable("Region"); + entity.HasKey(e => e.RegionID) .IsClustered(false); From be1f8b6ceb6bbbe0b342b758db300fecbf3c9b45 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 17 Feb 2022 12:03:01 +0100 Subject: [PATCH 29/99] Model updates to better match EF6 models, --- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 69 ++++++++++--------- .../Test/DbContextModel/Northwind/Order.cs | 2 +- .../DbContextModel/Northwind/Territory.cs | 4 +- .../Northwind/EFCore_Northwind.cs | 8 +-- 4 files changed, 45 insertions(+), 38 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index ad8579e88..773f81971 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -133,29 +133,32 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.CustomerID) .HasColumnName("CustomerID") .HasMaxLength(5) - .IsFixedLength(); + .IsFixedLength() + .IsConcurrencyToken(); - entity.Property(e => e.Address).HasMaxLength(60); + entity.Property(e => e.Address).HasMaxLength(60).IsConcurrencyToken(); - entity.Property(e => e.City).HasMaxLength(15); + entity.Property(e => e.City).HasMaxLength(15).IsConcurrencyToken(); entity.Property(e => e.CompanyName) .IsRequired() - .HasMaxLength(40); + .HasMaxLength(40) + .IsConcurrencyToken(); - entity.Property(e => e.ContactName).HasMaxLength(30); + entity.Property(e => e.ContactName).HasMaxLength(30).IsConcurrencyToken(); - entity.Property(e => e.ContactTitle).HasMaxLength(30); + entity.Property(e => e.ContactTitle).HasMaxLength(30).IsConcurrencyToken(); - entity.Property(e => e.Country).HasMaxLength(15); + entity.Property(e => e.Country).HasMaxLength(15).IsConcurrencyToken(); - entity.Property(e => e.Fax).HasMaxLength(24); + entity.Property(e => e.Fax).HasMaxLength(24).IsConcurrencyToken(); - entity.Property(e => e.Phone).HasMaxLength(24); + entity.Property(e => e.Phone).HasMaxLength(24).IsConcurrencyToken(); - entity.Property(e => e.PostalCode).HasMaxLength(10); + entity.Property(e => e.PostalCode).HasMaxLength(10).IsConcurrencyToken(); + + entity.Property(e => e.Region).HasMaxLength(15).IsConcurrencyToken(); - entity.Property(e => e.Region).HasMaxLength(15); }); modelBuilder.Entity(entity => @@ -176,7 +179,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasConstraintName("FK_EmployeeTerritories_Employees"); entity.HasOne(d => d.Territory) - .WithMany(p => p.EmployeeTerritories) + .WithMany(p => p.Employees) .HasForeignKey(d => d.TerritoryID) .OnDelete(DeleteBehavior.ClientSetNull) .HasConstraintName("FK_EmployeeTerritories_Territories"); @@ -249,17 +252,18 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasIndex(e => e.ProductID) .HasName("ProductsOrder_Details"); - entity.Property(e => e.OrderID).HasColumnName("OrderID"); + entity.Property(e => e.OrderID).HasColumnName("OrderID").IsConcurrencyToken(); - entity.Property(e => e.ProductID).HasColumnName("ProductID"); + entity.Property(e => e.ProductID).HasColumnName("ProductID").IsConcurrencyToken(); - entity.Property(e => e.Discount).HasDefaultValueSql("(0)"); + entity.Property(e => e.Discount).HasDefaultValueSql("(0)").IsConcurrencyToken(); - entity.Property(e => e.Quantity).HasDefaultValueSql("(1)"); + entity.Property(e => e.Quantity).HasDefaultValueSql("(1)").IsConcurrencyToken(); entity.Property(e => e.UnitPrice) .HasColumnType("money") - .HasDefaultValueSql("(0)"); + .HasDefaultValueSql("(0)") + .IsConcurrencyToken(); entity.HasOne(d => d.Order) .WithMany(p => p.Order_Details) @@ -296,36 +300,39 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasIndex(e => e.ShippedDate) .HasName("ShippedDate"); - entity.Property(e => e.OrderID).HasColumnName("OrderID"); + entity.Property(e => e.OrderID).HasColumnName("OrderID") + .IsConcurrencyToken(); entity.Property(e => e.CustomerID) .HasColumnName("CustomerID") .HasMaxLength(5) - .IsFixedLength(); + .IsFixedLength() + .IsConcurrencyToken(); - entity.Property(e => e.EmployeeID).HasColumnName("EmployeeID"); + entity.Property(e => e.EmployeeID).HasColumnName("EmployeeID").IsConcurrencyToken(); entity.Property(e => e.Freight) .HasColumnType("money") - .HasDefaultValueSql("(0)"); + .HasDefaultValueSql("(0)") + .IsConcurrencyToken(); - entity.Property(e => e.OrderDate).HasColumnType("datetime"); + entity.Property(e => e.OrderDate).HasColumnType("datetime").IsConcurrencyToken(); - entity.Property(e => e.RequiredDate).HasColumnType("datetime"); + entity.Property(e => e.RequiredDate).HasColumnType("datetime").IsConcurrencyToken(); - entity.Property(e => e.ShipAddress).HasMaxLength(60); + entity.Property(e => e.ShipAddress).HasMaxLength(60).IsConcurrencyToken(); - entity.Property(e => e.ShipCity).HasMaxLength(15); + entity.Property(e => e.ShipCity).HasMaxLength(15).IsConcurrencyToken(); - entity.Property(e => e.ShipCountry).HasMaxLength(15); + entity.Property(e => e.ShipCountry).HasMaxLength(15).IsConcurrencyToken(); - entity.Property(e => e.ShipName).HasMaxLength(40); + entity.Property(e => e.ShipName).HasMaxLength(40).IsConcurrencyToken(); - entity.Property(e => e.ShipPostalCode).HasMaxLength(10); + entity.Property(e => e.ShipPostalCode).HasMaxLength(10).IsConcurrencyToken(); - entity.Property(e => e.ShipRegion).HasMaxLength(15); + entity.Property(e => e.ShipRegion).HasMaxLength(15).IsConcurrencyToken(); - entity.Property(e => e.ShippedDate).HasColumnType("datetime"); + entity.Property(e => e.ShippedDate).HasColumnType("datetime").IsConcurrencyToken(); entity.HasOne(d => d.Customer) .WithMany(p => p.Orders) @@ -337,7 +344,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasForeignKey(d => d.EmployeeID) .HasConstraintName("FK_Orders_Employees"); - entity.HasOne(d => d.ShipViaNavigation) + entity.HasOne(d => d.Shipper) .WithMany(p => p.Orders) .HasForeignKey(d => d.ShipVia) .HasConstraintName("FK_Orders_Shippers"); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs index 67786b97f..de2a2277e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs @@ -31,7 +31,7 @@ public Order() public virtual Customer Customer { get; set; } public virtual Employees Employee { get; set; } - public virtual Shipper ShipViaNavigation { get; set; } + public virtual Shipper Shipper { get; set; } public virtual ICollection Order_Details { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs index 72c560216..9310beba0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Territory.cs @@ -11,7 +11,7 @@ public partial class Territory { public Territory() { - EmployeeTerritories = new HashSet(); + Employees = new HashSet(); } public string TerritoryID { get; set; } @@ -19,6 +19,6 @@ public Territory() public int RegionID { get; set; } public virtual Region Region { get; set; } - public virtual ICollection EmployeeTerritories { get; set; } + public virtual ICollection Employees { get; set; } } } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index a3743282e..a649fba16 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -424,9 +424,9 @@ public void UpdateRegion(Region region) // need to remove any employee territory rows EntityEntry tEntityEntry = this.DbContext.Entry(territory); - CollectionEntry employeesCollection = tEntityEntry.Collection("Employees"); + CollectionEntry employeesCollection = tEntityEntry.Collection(nameof(territory.Employees)); employeesCollection.Load(); - territory.EmployeeTerritories.Clear(); + territory.Employees.Clear(); this.DbContext.Territories.Remove(territory); } @@ -448,9 +448,9 @@ public void DeleteRegion(Region region) // need to remove any employee territory rows EntityEntry tEntityEntry = this.DbContext.Entry(territory); - CollectionEntry employeesCollection = tEntityEntry.Collection("Employees"); + CollectionEntry employeesCollection = tEntityEntry.Collection(nameof(territory.Employees)); employeesCollection.Load(); - territory.EmployeeTerritories.Clear(); + territory.Employees.Clear(); this.DbContext.Territories.Remove(territory); } From 1c0d9bffde41a63d9fd867cbecd5c617adee5ac6 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 17 Feb 2022 12:03:24 +0100 Subject: [PATCH 30/99] Add throw with details about missing code in SetChangeSetConflicts --- .../Framework/DbDomainServiceEFCore.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs index 9e8d1ee95..ec172548f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs @@ -202,7 +202,7 @@ private void SetChangeSetConflicts(Dictionary opera { EntityEntry stateEntry = conflictEntry.Key; - if (stateEntry.State == Microsoft.EntityFrameworkCore.EntityState.Unchanged) + if (stateEntry.State == EntityState.Unchanged) { continue; } @@ -210,6 +210,10 @@ private void SetChangeSetConflicts(Dictionary opera // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. ChangeSetEntry operationInConflict = conflictEntry.Value; + // TODO: Look into DbDomainService.SetChangeSetConflicts it looks quite different and contains other logic such as + // loading store entity + throw new NotImplementedException(); + // Determine which members are in conflict by comparing original values to the current DB values PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); List membersInConflict = new List(); @@ -217,7 +221,7 @@ private void SetChangeSetConflicts(Dictionary opera PropertyDescriptor pd; foreach (var prop in stateEntry.OriginalValues.Properties) { - originalValue = stateEntry.OriginalValues.GetValue(prop.Name); + originalValue = stateEntry.OriginalValues[prop.Name]; if (originalValue is DBNull) { originalValue = null; From ea707ebfcf3353cdc7a80c884896e81d5727321d Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 17 Feb 2022 12:07:16 +0100 Subject: [PATCH 31/99] Fix compilation --- .../BusinessLogicClassContextTests.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs b/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs index 66327be75..a9636da26 100644 --- a/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs +++ b/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs @@ -6,6 +6,7 @@ using NorthwindModel; using DescriptionAttribute = Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute; using TestHelper = OpenRiaServices.VisualStudio.DomainServices.Tools.Test.Utilities.TestHelper; +using System; namespace OpenRiaServices.VisualStudio.DomainServices.Tools.Test { @@ -117,12 +118,15 @@ public void BusinessLogicClass_Context_EFDbContextTest() } [TestMethod] - [Description("Tests if LinqToEntitiesDbContext works properly for DbContext entities")] + [Description("Tests if LinqToEntitiesDbContext works properly for EFCore entities")] public void BusinessLogicClass_Context_EFCoreDbContextTest() { - LinqToEntitiesDbContext dbContext = new LinqToEntitiesDbContext(typeof(DbContextModels.NorthwindEFCore.EFCoreDbCtxNorthwindEntities)); - Assert.AreEqual(11, dbContext.Entities.Count()); - Assert.IsTrue(dbContext.NeedToGenerateMetadataClasses); + // TODO: This won't work since LinqToEntitiesDbContext uses EF6 metadata model + // Something similar to LinqToEntitiesDbContext but using EF Core's IModel must be built + //LinqToEntitiesDbContext dbContext = new LinqToEntitiesDbContext(typeof(EFCoreModels.Northwind.EFCoreDbCtxNorthwindEntities)); + //Assert.AreEqual(11, dbContext.Entities.Count()); + //Assert.IsTrue(dbContext.NeedToGenerateMetadataClasses); + throw new NotImplementedException(); } [TestMethod] From 6428100ea4c5297b4476338b8ecd501ed7af53e4 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 17 Feb 2022 21:44:42 +0100 Subject: [PATCH 32/99] Remove extra classes we only need one type of DomainService and Attribute Efcore only has a single programming model based on DbContext, there is no ObjectContext or Poco variantes --- .../Data/CrossDomainServiceQueryTests.cs | 2 +- .../Framework/DbDomainServiceEFCore.cs | 34 +-- .../LinqToEntitiesDomainServiceEFCore.cs | 133 ----------- ...sDomainServiceEFCoreDescriptionProvider.cs | 4 - ...rviceEFCoreDescriptionProviderAttribute.cs | 96 -------- ...qToEntitiesEFCoreTypeDescriptionContext.cs | 9 +- .../LinqToEntitiesEFCoreTypeDescriptor.cs | 24 +- .../MetadataWorkspaceUtilitiesEFCore.cs | 219 ------------------ .../Framework/ObjectContextUtilitiesEFCore.cs | 112 +-------- ...Services.Server.EntityFrameworkCore.csproj | 1 - .../Test/DbContextModel/EFCoreModels.csproj | 4 - .../Northwind/NorthwindPartialClasses.cs | 2 +- .../Scenarios/EFDbContextScenarios.g.cs | 124 +++------- .../Northwind/EFCore_Northwind.cs | 38 +-- 14 files changed, 76 insertions(+), 726 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs index 08f2af41c..6ab4048ea 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs @@ -585,7 +585,7 @@ protected override Northwind CreateNorthwind() } } /** TODO: - * + * copy EFQueryTests, do we want the added test from that one [TestClass] public class EFCoreQueryTests : CrossDomainServiceQueryTests { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs index 9e8d1ee95..261a1f73b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs @@ -202,7 +202,7 @@ private void SetChangeSetConflicts(Dictionary opera { EntityEntry stateEntry = conflictEntry.Key; - if (stateEntry.State == Microsoft.EntityFrameworkCore.EntityState.Unchanged) + if (stateEntry.State == EntityState.Unchanged) { continue; } @@ -210,35 +210,39 @@ private void SetChangeSetConflicts(Dictionary opera // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. ChangeSetEntry operationInConflict = conflictEntry.Value; + // Determine which members are in conflict by comparing original values to the current DB values - PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); + // // TODO: Populate store entity conflictEntry.Value.StoreEntity + // TODO: make async + var dbValues = stateEntry.GetDatabaseValues(); + + // PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); List membersInConflict = new List(); object originalValue; - PropertyDescriptor pd; + //PropertyDescriptor pd; foreach (var prop in stateEntry.OriginalValues.Properties) { - originalValue = stateEntry.OriginalValues.GetValue(prop.Name); + originalValue = stateEntry.OriginalValues[prop.Name]; if (originalValue is DBNull) { originalValue = null; } string propertyName = prop.Name; - pd = propDescriptors[propertyName]; - if (pd == null) - { - // This might happen in the case of a private model - // member that isn't mapped - continue; - } - - if (!object.Equals(originalValue, pd.GetValue(operationInConflict.StoreEntity))) + //pd = propDescriptors[propertyName]; + //if (pd == null) + //{ + // // This might happen in the case of a private model + // // member that isn't mapped + // continue; + //} + + if (!object.Equals(originalValue, dbValues[prop.Name])) { - membersInConflict.Add(pd.Name); + membersInConflict.Add(prop.Name); } } operationInConflict.ConflictMembers = membersInConflict; - } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs deleted file mode 100644 index 4967ca313..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCore.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Data.Entity.Core; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using OpenRiaServices.Server; - -namespace OpenRiaServices.EntityFrameworkCore -{ - /// - /// Base class for DomainServices operating on LINQ To Entities data models - /// - /// The Type of the LINQ To Entities ObjectContext - [LinqToEntitiesDomainServiceEFCoreDescriptionProvider] - public abstract class LinqToEntitiesDomainServiceEFCore : DomainService where TContext : new() - { - /// - /// Protected constructor because this is an abstract class - /// - protected LinqToEntitiesDomainServiceEFCore() - { - } - - /// - /// Initializes this . must be called - /// prior to invoking any operations on the instance. - /// - /// The for this - /// instance. Overrides must call the base method. - public override void Initialize(DomainServiceContext context) - { - base.Initialize(context); - } - - - /// - /// Gets the number of rows in an . - /// - /// The element Type of the query. - /// The query for which the count should be returned. - /// which may be used by hosting layer to request cancellation - /// The total number of rows. - protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) - { - return QueryHelperEFCore.CountAsync(query, cancellationToken); - } - - /// - /// Enumerates the specified enumerable to guarantee eager execution. - /// If possible code similar to ToListAsync is used, but with optimizations to start with a larger initial capacity - /// - /// The element type of the enumerable. - /// The enumerable to enumerate. - /// The estimated number of items the enumerable will yield. - /// which may be used by hosting layer to request cancellation - /// A new enumerable with the results of the enumerated enumerable. - protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) - { - return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); - } - - /// - /// This method is called to finalize changes after all the operations in the specified changeset - /// have been invoked. All changes are committed to the ObjectContext, and any resulting optimistic - /// concurrency errors are processed. - /// - /// which may be used by hosting layer to request cancellation - /// True if the was persisted successfully, false otherwise. - protected override ValueTask PersistChangeSetAsync(CancellationToken cancellationToken) - { - return new ValueTask(this.InvokeSaveChangesAsync(true, cancellationToken)); - } - - private async Task InvokeSaveChangesAsync(bool retryOnConflict, CancellationToken cancellationToken) - { - try - { - await this.SubmitAsync(ChangeSet, cancellationToken); - } - catch (OptimisticConcurrencyException ex) - { - // Map the operations that could have caused a conflict to an entity. - //Dictionary operationConflictMap = new Dictionary(); - //foreach (ObjectStateEntry conflict in ex.StateEntries) - //{ - // ChangeSetEntry entry = this.ChangeSet.ChangeSetEntries.SingleOrDefault(p => object.ReferenceEquals(p.Entity, conflict.Entity)); - // if (entry == null) - // { - // // If we're unable to find the object in our changeset, propagate - // // the original exception - // throw; - // } - // operationConflictMap.Add(conflict, entry); - //} - - //this.SetChangeSetConflicts(operationConflictMap); - - //// Call out to any user resolve code and resubmit if all conflicts - //// were resolved - //if (retryOnConflict && this.ResolveConflicts(ex.StateEntries)) - //{ - // // clear the conflics from the entries - // foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) - // { - // entry.StoreEntity = null; - // entry.ConflictMembers = null; - // entry.IsDeleteConflict = false; - // } - - // // If all conflicts were resolved attempt a resubmit - // return await this.InvokeSaveChangesAsync(/* retryOnConflict */ false, cancellationToken).ConfigureAwait(false); - //} - - // if the conflict wasn't resolved, call the error handler - this.OnError(new DomainServiceErrorInfo(ex)); - - // if there was a conflict but no conflict information was - // extracted to the individual entries, we need to ensure the - // error makes it back to the client - if (!this.ChangeSet.HasError) - { - throw; - } - - return false; - } - - return true; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs index 40a498769..0cff6904f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs @@ -1,11 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; -using System.Data.Entity.Core.Metadata.Edm; using Microsoft.EntityFrameworkCore.Metadata; -#if RIACONTRIB -using System.ServiceModel.DomainServices.Server; -#endif using OpenRiaServices.Server; namespace OpenRiaServices.EntityFrameworkCore diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs deleted file mode 100644 index a945a1eb5..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.ComponentModel; -using System.Globalization; -using OpenRiaServices.Server; -using OpenRiaServices.Server.EntityFrameworkCore; - -namespace OpenRiaServices.EntityFrameworkCore -{ - - // TODO: Remove and move code to DB context - - /// - /// Attribute applied to a that exposes LINQ to Entities mapped - /// Types. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] - public sealed class LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute - { - private Type _objectContextType; - - /// - /// Default constructor. Using this constructor, the Type of the LINQ To Entities - /// ObjectContext will be inferred from the the - /// attribute is applied to. - /// - public LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute() - : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) - { - } - - /// - /// Constructs an attribute for the specified LINQ To Entities - /// ObjectContext Type. - /// - /// The LINQ To Entities ObjectContext Type. - public LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute(Type objectContextType) - : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) - { - this._objectContextType = objectContextType; - } - - /// - /// The Linq To Entities ObjectContext Type. - /// - public Type ObjectContextType - { - get - { - return this._objectContextType; - } - } - - /// - /// This method creates an instance of the . - /// - /// The Type to create a description provider for. - /// The existing parent description provider. - /// The description provider. - public override DomainServiceDescriptionProvider CreateProvider(Type domainServiceType, DomainServiceDescriptionProvider parent) - { - if (domainServiceType == null) - { - throw new ArgumentNullException(nameof(domainServiceType)); - } - - if (this._objectContextType == null) - { - this._objectContextType = GetContextType(domainServiceType); - } - - return new LinqToEntitiesDomainServiceEFCoreDescriptionProvider(domainServiceType, this._objectContextType, parent); - } - - /// - /// Extracts the context type from the specified . - /// - /// A LINQ to Entities domain service type. - /// The type of the object context. - private static Type GetContextType(Type domainServiceType) - { - Type efDomainServiceType = domainServiceType.BaseType; - while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DomainService)) - { - if (efDomainServiceType == typeof(object)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, - ResourceEFCore.InvalidMetadataProviderSpecification, - typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DomainService).Name)); - } - efDomainServiceType = efDomainServiceType.BaseType; - } - - return efDomainServiceType.GetGenericArguments()[0]; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index 5cbadcfd5..836d9508c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -1,9 +1,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Data.Mapping; -using System.Data.Entity.Core.Metadata.Edm; -using System.Globalization; +using System.ComponentModel.DataAnnotations;using System.Globalization; using System.Linq; using OpenRiaServices.Server; using Microsoft.EntityFrameworkCore.Metadata; @@ -18,7 +15,7 @@ namespace OpenRiaServices.EntityFrameworkCore /// internal class LinqToEntitiesEFCoreTypeDescriptionContext : TypeDescriptionContextBase { - private readonly Dictionary _associationMap = new Dictionary(); + // private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; private IModel _model; @@ -131,6 +128,7 @@ internal AssociationAttribute CreateAssociationAttribute(INavigation navigationP /// The navigation property /// The foreign key role name for the property's association /// A unique association name for the specified navigation property. + /* private string GetAssociationName(NavigationProperty navigationProperty, string foreignKeyRoleName) { RelationshipEndMember fromMember = navigationProperty.FromEndMember; @@ -152,5 +150,6 @@ private string GetAssociationName(NavigationProperty navigationProperty, string return associationName; } + */ } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs index ae976c1cf..199c15f32 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs @@ -2,15 +2,11 @@ using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; -#if RIACONTRIB -using System.ServiceModel.DomainServices.Server; -#endif using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using System.Linq; using OpenRiaServices.Server; -using System.Data.Entity.Core.Metadata.Edm; -using System.Data.Entity.Core.Objects.DataClasses; +//using System.Data.Entity.Core.Objects.DataClasses; using Microsoft.EntityFrameworkCore.Metadata; namespace OpenRiaServices.EntityFrameworkCore @@ -75,15 +71,6 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor { List attributes = new List(); - // Exclude any EntityState, EntityReference, etc. members - if (ShouldExcludeEntityMember(pd)) - { - // for these members, we don't want to do any further - // attribute inference - attributes.Add(new ExcludeAttribute()); - return attributes.ToArray(); - } - EditableAttribute editableAttribute = null; bool inferRoundtripOriginalAttribute = false; @@ -229,18 +216,15 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor /// True if the property should be excluded, false otherwise. internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) { + //TODO: remove this, EntityState is not part of entities + // exclude EntityState members if (pd.PropertyType == typeof(EntityState)) // TODO: Maybe also check pd.Component type { return true; } - // exclude entity reference properties - if (typeof(EntityReference).IsAssignableFrom(pd.PropertyType)) - { - return true; - } - + return false; } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs deleted file mode 100644 index 6688ddfb1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataWorkspaceUtilitiesEFCore.cs +++ /dev/null @@ -1,219 +0,0 @@ -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Reflection; -using OpenRiaServices; -using System.Data.Entity.Core.Metadata.Edm; -using Microsoft.EntityFrameworkCore; -using OpenRiaServices.Server.EntityFrameworkCore; - -namespace System.Data.Mapping -{ - /// - /// EF metadata utilities class. - /// - internal static class MetadataWorkspaceUtilitiesEFCore - { - /// - /// Creates a metadata workspace for the specified context. - /// - /// The type of the object context. - /// The metadata workspace. - public static MetadataWorkspace CreateMetadataWorkspace(Type contextType) - { - MetadataWorkspace metadataWorkspace = null; -#if !DBCONTEXT - - metadataWorkspace = MetadataWorkspaceUtilities.CreateMetadataWorkspaceFromResources(contextType, typeof(ObjectContext)); - -#else - metadataWorkspace = MetadataWorkspaceUtilitiesEFCore.CreateMetadataWorkspaceFromResources(contextType, typeof(DbContext)); - if (metadataWorkspace == null && typeof(DbContext).IsAssignableFrom(contextType)) - { - if (contextType.GetConstructor(Type.EmptyTypes) == null) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, DbResource.DefaultCtorNotFound, contextType.FullName)); - } - - try - { - DbContext dbContext = Activator.CreateInstance(contextType) as DbContext; - } - catch (Exception efException) - { - if (efException.IsFatal()) - { - throw; - } - - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, DbResource.MetadataWorkspaceNotFound + ProcessException(efException), contextType.FullName), efException); - } - } -#endif - if (metadataWorkspace == null) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, MetadataResource.LinqToEntitiesProvider_UnableToRetrieveMetadata, contextType.Name)); - } - else - { - return metadataWorkspace; - } - } - - static string ProcessException(Exception ex) - { - if (ex == null) - return string.Empty; - else - return " Exception: " + ex.Message + ProcessException(ex.InnerException); - } - /// - /// Creates the MetadataWorkspace for the given context type and base context type. - /// - /// The type of the context. - /// The base context type (DbContext or ObjectContext). - /// The generated - public static MetadataWorkspace CreateMetadataWorkspaceFromResources(Type contextType, Type baseContextType) - { - // get the set of embedded mapping resources for the target assembly and create - // a metadata workspace info for each group - IEnumerable metadataResourcePaths = FindMetadataResources(contextType.Assembly); - IEnumerable workspaceInfos = GetMetadataWorkspaceInfos(metadataResourcePaths); - - // Search for the correct EntityContainer by name and if found, create - // a comlete MetadataWorkspace and return it - foreach (var workspaceInfo in workspaceInfos) - { - EdmItemCollection edmItemCollection = new EdmItemCollection(workspaceInfo.Csdl); - - Type currentType = contextType; - while (currentType != baseContextType && currentType != typeof(object)) - { - EntityContainer container; - if (edmItemCollection.TryGetEntityContainer(currentType.Name, out container)) - { - StoreItemCollection store = new StoreItemCollection(workspaceInfo.Ssdl); - MetadataWorkspace workspace = new MetadataWorkspace(); - return workspace; - } - - currentType = currentType.BaseType; - } - } - return null; - } - - /// - /// Gets the specified resource paths as metadata workspace info objects. - /// - /// The metadata resource paths. - /// The metadata workspace info objects. - private static IEnumerable GetMetadataWorkspaceInfos(IEnumerable resourcePaths) - { - // for file paths, you would want to group without the path or the extension like Path.GetFileNameWithoutExtension, but resource names can contain - // forbidden path chars, so don't use it on resource names - foreach (var group in resourcePaths.GroupBy(p => p.Substring(0, p.LastIndexOf('.')), StringComparer.InvariantCultureIgnoreCase)) - { - yield return MetadataWorkspaceInfo.Create(group); - } - } - - /// - /// Find all the EF metadata resources. - /// - /// The assembly to find the metadata resources in. - /// The metadata paths that were found. - private static IEnumerable FindMetadataResources(Assembly assembly) - { - foreach (string name in assembly.GetManifestResourceNames()) - { - if (MetadataWorkspaceInfo.IsMetadata(name)) - { - yield return string.Format("res://{0}/{1}", assembly.FullName, name); - } - } - } - - /// - /// Represents the paths for a single metadata workspace. - /// - private class MetadataWorkspaceInfo - { - private const string CSDL_EXT = ".csdl"; - private const string MSL_EXT = ".msl"; - private const string SSDL_EXT = ".ssdl"; - - public string Csdl - { - get; - private set; - } - - public string Msl - { - get; - private set; - } - - public string Ssdl - { - get; - private set; - } - - public static MetadataWorkspaceInfo Create(IEnumerable paths) - { - string csdlPath = null; - string mslPath = null; - string ssdlPath = null; - foreach (string path in paths) - { - if (path.EndsWith(CSDL_EXT, StringComparison.OrdinalIgnoreCase)) - { - csdlPath = path; - } - else if (path.EndsWith(MSL_EXT, StringComparison.OrdinalIgnoreCase)) - { - mslPath = path; - } - else if (path.EndsWith(SSDL_EXT, StringComparison.OrdinalIgnoreCase)) - { - ssdlPath = path; - } - } - - return new MetadataWorkspaceInfo(csdlPath, mslPath, ssdlPath); - } - - public static bool IsMetadata(string path) - { - return path.EndsWith(CSDL_EXT, StringComparison.OrdinalIgnoreCase) || - path.EndsWith(MSL_EXT, StringComparison.OrdinalIgnoreCase) || - path.EndsWith(SSDL_EXT, StringComparison.OrdinalIgnoreCase); - } - - - public MetadataWorkspaceInfo(string csdlPath, string mslPath, string ssdlPath) - { - if (csdlPath == null) - { - throw new ArgumentNullException(nameof(csdlPath)); - } - - if (mslPath == null) - { - throw new ArgumentNullException(nameof(mslPath)); - } - - if (ssdlPath == null) - { - throw new ArgumentNullException(nameof(ssdlPath)); - } - - this.Csdl = csdlPath; - this.Msl = mslPath; - this.Ssdl = ssdlPath; - } - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs index e30b35987..c74256ecc 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs @@ -1,9 +1,5 @@ using System; -#if RIACONTRIB -using System.ServiceModel.DomainServices.Server; -#endif using System.Linq; -using System.Data.Entity.Core.Metadata.Edm; using Microsoft.EntityFrameworkCore.ChangeTracking; namespace OpenRiaServices.EntityFrameworkCore @@ -14,113 +10,7 @@ namespace OpenRiaServices.EntityFrameworkCore /// internal static class ObjectContextUtilitiesEFCore { - /// - /// Retrieves the corresponding to the given CLR type (where the - /// type is an entity or complex type). - /// - /// - /// If no mapping exists for , but one does exist for one of its base - /// types, we will return the mapping for the base type. - /// - /// The - /// The CLR type - /// The corresponding to that CLR type, or null if the Type - /// is not mapped. - public static StructuralType GetEdmType(MetadataWorkspace workspace, Type clrType) - { - if (workspace == null) - { - throw new ArgumentNullException(nameof(workspace)); - } - if (clrType == null) - { - throw new ArgumentNullException(nameof(clrType)); - } - - if (clrType.IsPrimitive || clrType == typeof(object)) - { - // want to avoid loading searching system assemblies for - // types we know aren't entity or complex types - return null; - } - - // We first locate the EdmType in "OSpace", which matches the name and namespace of the CLR type - EdmType edmType = null; - do - { - if (!workspace.TryGetType(clrType.Name, clrType.Namespace, DataSpace.OSpace, out edmType)) - { - // If EF could not find this type, it could be because it is not loaded into - // its current workspace. In this case, we explicitly load the assembly containing - // the CLR type and try again. - workspace.LoadFromAssembly(clrType.Assembly); - workspace.TryGetType(clrType.Name, clrType.Namespace, DataSpace.OSpace, out edmType); - } - } - while (edmType == null && (clrType = clrType.BaseType) != typeof(object) && clrType != null); - - // Next we locate the StructuralType from the EdmType. - // This 2-step process is necessary when the types CLR namespace does not match Edm namespace. - // Look at the EdmEntityTypeAttribute on the generated entity classes to see this Edm namespace. - StructuralType structuralType = null; - if (edmType != null && - (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType || edmType.BuiltInTypeKind == BuiltInTypeKind.ComplexType)) - { - workspace.TryGetEdmSpaceType((StructuralType)edmType, out structuralType); - } - - return structuralType; - } - - /// - /// Determines if the specified EdmMember is a concurrency timestamp. - /// - /// Since EF doesn't expose "timestamp" as a first class - /// concept, we use the below criteria to infer this for ourselves. - /// - /// The member to check. - /// True or false. - public static bool IsConcurrencyTimestamp(EdmMember member) - { - Facet facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "ConcurrencyMode"); - if (facet == null || facet.Value == null || (ConcurrencyMode)facet.Value != ConcurrencyMode.Fixed) - { - return false; - } - - facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "FixedLength"); - if (facet == null || facet.Value == null || !((bool)facet.Value)) - { - return false; - } - - facet = member.TypeUsage.Facets.SingleOrDefault(p => p.Name == "MaxLength"); - if (facet == null || facet.Value == null || (int)facet.Value != 8) - { - return false; - } - - MetadataProperty md = ObjectContextUtilitiesEFCore.GetStoreGeneratedPattern(member); - if (md == null || facet.Value == null || (string)md.Value != "Computed") - { - return false; - } - - return true; - } - - /// - /// Gets the property value from the edm member. - /// - /// The EdmMember from which to get the StoreGeneratedPattern value. - /// The value. - public static MetadataProperty GetStoreGeneratedPattern(EdmMember member) - { - MetadataProperty md; - member.MetadataProperties.TryGetValue("http://schemas.microsoft.com/ado/2009/02/edm/annotation:StoreGeneratedPattern", /* ignoreCase */ true, out md); - return md; - } - + public static EntityEntry AttachAsModifiedInternal(object current, object original, ChangeTracker objectContext) { var stateEntry = objectContext.Context.Entry(current); // ObjectStateManager.GetObjectStateEntry(current); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 158d4c535..6fa9d2631 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -8,7 +8,6 @@ - diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj index 0c0657051..fefa131ec 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj @@ -5,10 +5,6 @@ net472 1.0.0.0 - - - - diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs index 6b6325e54..266ca91ca 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs @@ -9,7 +9,7 @@ namespace EFCoreModels.Northwind { - // TODO: Remove MetaDataType attributes and move attributes directly to classe == + // TODO: Remove MetaDataType attributes and move attributes directly to classe so project can be netstandard2 [MetadataType(typeof(RegionMetadata))] public partial class Region { diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs index 461097a67..1325ffd40 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -15,7 +15,7 @@ namespace DbContextModels.Northwind /// /// The 'Category' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class Category : global::OpenRiaServices.Client.Entity { @@ -59,7 +59,6 @@ public Category() /// /// Gets or sets the 'CategoryID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] @@ -160,7 +159,7 @@ public byte[] Picture /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Category_Product", "CategoryID", "CategoryID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID")] public global::OpenRiaServices.Client.EntityCollection Products { get @@ -201,7 +200,7 @@ public override object GetIdentity() /// /// The 'Customer' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class Customer : global::OpenRiaServices.Client.Entity { @@ -273,8 +272,6 @@ public Customer() /// /// Gets or sets the 'Address' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Address @@ -300,8 +297,6 @@ public string Address /// /// Gets or sets the 'City' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string City @@ -327,9 +322,7 @@ public string City /// /// Gets or sets the 'CompanyName' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string CompanyName @@ -355,8 +348,6 @@ public string CompanyName /// /// Gets or sets the 'ContactName' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ContactName @@ -382,8 +373,6 @@ public string ContactName /// /// Gets or sets the 'ContactTitle' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ContactTitle @@ -409,8 +398,6 @@ public string ContactTitle /// /// Gets or sets the 'Country' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Country @@ -436,7 +423,6 @@ public string Country /// /// Gets or sets the 'CustomerID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] @@ -465,8 +451,6 @@ public string CustomerID /// /// Gets or sets the 'Fax' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Fax @@ -492,7 +476,7 @@ public string Fax /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Customer_Order", "CustomerID", "CustomerID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID")] public global::OpenRiaServices.Client.EntityCollection Orders { get @@ -508,8 +492,6 @@ public string Fax /// /// Gets or sets the 'Phone' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Phone @@ -535,8 +517,6 @@ public string Phone /// /// Gets or sets the 'PostalCode' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string PostalCode @@ -562,8 +542,6 @@ public string PostalCode /// /// Gets or sets the 'Region' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Region @@ -614,7 +592,7 @@ public override object GetIdentity() /// /// The 'Order' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class Order : global::OpenRiaServices.Client.Entity { @@ -704,7 +682,7 @@ public Order() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID", IsForeignKey=true)] public global::DbContextModels.Northwind.Customer Customer { get @@ -747,7 +725,6 @@ public Order() /// /// Gets or sets the 'CustomerID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(5)] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -774,7 +751,6 @@ public string CustomerID /// /// Gets or sets the 'EmployeeID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable EmployeeID @@ -825,8 +801,6 @@ public string FormattedName /// /// Gets or sets the 'Freight' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable Freight { @@ -851,7 +825,7 @@ public string FormattedName /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Order_Order_Detail", "OrderID", "OrderID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID")] public global::OpenRiaServices.Client.EntityCollection Order_Details { get @@ -867,8 +841,6 @@ public string FormattedName /// /// Gets or sets the 'OrderDate' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable OrderDate { @@ -893,7 +865,6 @@ public string FormattedName /// /// Gets or sets the 'OrderID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] @@ -920,8 +891,6 @@ public int OrderID /// /// Gets or sets the 'RequiredDate' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable RequiredDate { @@ -946,8 +915,6 @@ public int OrderID /// /// Gets or sets the 'ShipAddress' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipAddress @@ -973,8 +940,6 @@ public string ShipAddress /// /// Gets or sets the 'ShipCity' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipCity @@ -1000,8 +965,6 @@ public string ShipCity /// /// Gets or sets the 'ShipCountry' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipCountry @@ -1027,8 +990,6 @@ public string ShipCountry /// /// Gets or sets the 'ShipName' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipName @@ -1054,8 +1015,6 @@ public string ShipName /// /// Gets or sets the 'ShippedDate' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ShippedDate { @@ -1080,8 +1039,6 @@ public string ShipName /// /// Gets or sets the 'ShipPostalCode' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipPostalCode @@ -1107,8 +1064,6 @@ public string ShipPostalCode /// /// Gets or sets the 'ShipRegion' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipRegion @@ -1134,7 +1089,6 @@ public string ShipRegion /// /// Gets or sets the 'ShipVia' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ShipVia @@ -1190,7 +1144,7 @@ public override object GetIdentity() /// /// The 'Order_Detail' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class Order_Detail : global::OpenRiaServices.Client.Entity { @@ -1240,8 +1194,6 @@ public Order_Detail() /// /// Gets or sets the 'Discount' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public float Discount { @@ -1266,7 +1218,7 @@ public float Discount /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID", IsForeignKey=true)] public global::DbContextModels.Northwind.Order Order { get @@ -1309,7 +1261,7 @@ public float Discount /// /// Gets or sets the 'OrderID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -1324,10 +1276,9 @@ public int OrderID if ((this._orderID != value)) { this.OnOrderIDChanging(value); - this.RaiseDataMemberChanging("OrderID"); this.ValidateProperty("OrderID", value); this._orderID = value; - this.RaiseDataMemberChanged("OrderID"); + this.RaisePropertyChanged("OrderID"); this.OnOrderIDChanged(); } } @@ -1336,7 +1287,7 @@ public int OrderID /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID", IsForeignKey=true)] public global::DbContextModels.Northwind.Product Product { get @@ -1379,7 +1330,7 @@ public int OrderID /// /// Gets or sets the 'ProductID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -1394,10 +1345,9 @@ public int ProductID if ((this._productID != value)) { this.OnProductIDChanging(value); - this.RaiseDataMemberChanging("ProductID"); this.ValidateProperty("ProductID", value); this._productID = value; - this.RaiseDataMemberChanged("ProductID"); + this.RaisePropertyChanged("ProductID"); this.OnProductIDChanged(); } } @@ -1406,8 +1356,6 @@ public int ProductID /// /// Gets or sets the 'Quantity' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public short Quantity { @@ -1432,8 +1380,6 @@ public short Quantity /// /// Gets or sets the 'UnitPrice' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public decimal UnitPrice { @@ -1478,7 +1424,7 @@ public override object GetIdentity() /// /// The 'Product' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class Product : global::OpenRiaServices.Client.Entity { @@ -1562,7 +1508,7 @@ public Product() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID", IsForeignKey=true)] public global::DbContextModels.Northwind.Category Category { get @@ -1605,7 +1551,6 @@ public Product() /// /// Gets or sets the 'CategoryID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable CategoryID @@ -1656,8 +1601,6 @@ public string CategoryName /// /// Gets or sets the 'Discontinued' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public bool Discontinued { @@ -1682,7 +1625,7 @@ public bool Discontinued /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Product_Order_Detail", "ProductID", "ProductID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID")] public global::OpenRiaServices.Client.EntityCollection Order_Details { get @@ -1724,9 +1667,7 @@ public int ProductID /// /// Gets or sets the 'ProductName' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ProductName @@ -1752,8 +1693,6 @@ public string ProductName /// /// Gets or sets the 'QuantityPerUnit' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(20)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string QuantityPerUnit @@ -1779,8 +1718,6 @@ public string QuantityPerUnit /// /// Gets or sets the 'ReorderLevel' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ReorderLevel { @@ -1829,7 +1766,6 @@ public string ResolveMethod /// /// Gets or sets the 'SupplierID' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable SupplierID @@ -1879,8 +1815,6 @@ public string SupplierName /// /// Gets or sets the 'UnitPrice' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitPrice { @@ -1905,8 +1839,6 @@ public string SupplierName /// /// Gets or sets the 'UnitsInStock' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitsInStock { @@ -1931,8 +1863,6 @@ public string SupplierName /// /// Gets or sets the 'UnitsOnOrder' value. /// - [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] - [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitsOnOrder { @@ -2022,7 +1952,7 @@ public void DiscontinueProduct() /// /// The 'ProductInfo' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class ProductInfo : global::OpenRiaServices.Client.Entity { @@ -2172,7 +2102,7 @@ public override object GetIdentity() /// /// The 'Region' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class Region : global::OpenRiaServices.Client.Entity { @@ -2260,7 +2190,7 @@ public int RegionID /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Region_Territory", "RegionID", "RegionID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID")] [global::System.ComponentModel.DataAnnotations.CompositionAttribute()] public global::OpenRiaServices.Client.EntityCollection Territories { @@ -2302,7 +2232,7 @@ public override object GetIdentity() /// /// The 'Territory' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] public sealed partial class Territory : global::OpenRiaServices.Client.Entity { @@ -2342,7 +2272,7 @@ public Territory() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID", IsForeignKey=true)] public global::DbContextModels.Northwind.Region Region { get @@ -2476,7 +2406,7 @@ public override object GetIdentity() } } } -namespace TestDomainServices.DbCtx +namespace TestDomainServices.EFCore { @@ -2501,7 +2431,7 @@ public sealed partial class Northwind : global::OpenRiaServices.Client.DomainCon /// Initializes a new instance of the class. /// public Northwind() : - this(new global::System.Uri("TestDomainServices-DbCtx-Northwind.svc", global::System.UriKind.Relative)) + this(new global::System.Uri("TestDomainServices-EFCore-Northwind.svc", global::System.UriKind.Relative)) { } @@ -2510,7 +2440,7 @@ public Northwind() : /// /// The Northwind service URI. public Northwind(global::System.Uri serviceUri) : - this(global::OpenRiaServices.Client.DomainContext.CreateDomainClient(typeof(global::TestDomainServices.DbCtx.Northwind.INorthwindContract), serviceUri, false)) + this(global::OpenRiaServices.Client.DomainContext.CreateDomainClient(typeof(global::TestDomainServices.EFCore.Northwind.INorthwindContract), serviceUri, false)) { } @@ -2712,7 +2642,7 @@ public void DiscontinueProduct(global::DbContextModels.Northwind.Product product /// A new container instance. protected override global::OpenRiaServices.Client.EntityContainer CreateEntityContainer() { - return new global::TestDomainServices.DbCtx.Northwind.NorthwindEntityContainer(); + return new global::TestDomainServices.EFCore.Northwind.NorthwindEntityContainer(); } /// diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index a3743282e..99aa7605e 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -88,24 +88,22 @@ public void DiscontinueProduct(Product product) protected override bool ResolveConflicts(IEnumerable conflicts) { // TODO - resolve conflicts - //foreach (EntityEntry entityEntry in conflicts) - //{ - // ObjectStateEntry stateEntry = objectStateManager.GetObjectStateEntry(entityEntry.Entity); - // if (entityEntry.State == EntityState.Detached || - // stateEntry.IsRelationship) - // { - // continue; - // } - - // Type entityType = stateEntry.Entity.GetType(); - // if (entityType == typeof(Product)) - // { - // if (!this.ResolveProductConflict(entityEntry)) - // { - // return false; - // } - // } - //} + foreach (EntityEntry entityEntry in conflicts) + { + var stateEntry = DbContext.Entry(entityEntry.Entity); + if (entityEntry.State == EntityState.Detached) { + continue; + } + + Type entityType = stateEntry.Entity.GetType(); + if (entityType == typeof(Product)) + { + if (!this.ResolveProductConflict(entityEntry)) + { + return false; + } + } + } return true; } @@ -123,10 +121,11 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) return this.ResolveProductWithMerge(entryInConflict); case "KeepCurrent": // Client Wins - // objectContext.Refresh(RefreshMode.ClientWins, product); // TODO + //objectContext.Refresh(RefreshMode.ClientWins, product); // TODO break; case "RefreshCurrent": // Store wins + DbContext.Entry(product).Reload(); // objectContext.Refresh(RefreshMode.StoreWins, product); // TODO break; case "ReturnTrueNoResolve": @@ -135,6 +134,7 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) return false; case "ReturnFalseWithResolve": // Store Wins + DbContext.Entry(product).Reload(); // objectContext.Refresh(RefreshMode.StoreWins, product); // TODO return false; case "": From 80721ab525ff852ff3a232be6dad1484d4623683 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 17 Feb 2022 21:55:55 +0100 Subject: [PATCH 33/99] Add some missing ConcurrencyCheck s --- .../Framework/DbDomainServiceEFCore.cs | 4 ++- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 33 ++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs index 261a1f73b..c50766ee2 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs @@ -211,9 +211,11 @@ private void SetChangeSetConflicts(Dictionary opera ChangeSetEntry operationInConflict = conflictEntry.Value; + //TODO: Make sure that code reflects code in DbDomainServicde.SetChangeSetConflicts + // Determine which members are in conflict by comparing original values to the current DB values // // TODO: Populate store entity conflictEntry.Value.StoreEntity - // TODO: make async + // TODO: make async loading of tate var dbValues = stateEntry.GetDatabaseValues(); // PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index ad8579e88..ef0b5f555 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -133,29 +133,40 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.CustomerID) .HasColumnName("CustomerID") .HasMaxLength(5) - .IsFixedLength(); + .IsFixedLength() + .IsConcurrencyToken(); - entity.Property(e => e.Address).HasMaxLength(60); + entity.Property(e => e.Address).HasMaxLength(60) + .IsConcurrencyToken(); - entity.Property(e => e.City).HasMaxLength(15); + entity.Property(e => e.City).HasMaxLength(15) + .IsConcurrencyToken(); entity.Property(e => e.CompanyName) .IsRequired() - .HasMaxLength(40); + .HasMaxLength(40) + .IsConcurrencyToken(); - entity.Property(e => e.ContactName).HasMaxLength(30); + entity.Property(e => e.ContactName).HasMaxLength(30) + .IsConcurrencyToken(); - entity.Property(e => e.ContactTitle).HasMaxLength(30); + entity.Property(e => e.ContactTitle).HasMaxLength(30) + .IsConcurrencyToken(); - entity.Property(e => e.Country).HasMaxLength(15); + entity.Property(e => e.Country).HasMaxLength(15) + .IsConcurrencyToken(); - entity.Property(e => e.Fax).HasMaxLength(24); + entity.Property(e => e.Fax).HasMaxLength(24) + .IsConcurrencyToken(); - entity.Property(e => e.Phone).HasMaxLength(24); + entity.Property(e => e.Phone).HasMaxLength(24) + .IsConcurrencyToken(); - entity.Property(e => e.PostalCode).HasMaxLength(10); + entity.Property(e => e.PostalCode).HasMaxLength(10) + .IsConcurrencyToken(); - entity.Property(e => e.Region).HasMaxLength(15); + entity.Property(e => e.Region).HasMaxLength(15) + .IsConcurrencyToken(); }); modelBuilder.Entity(entity => From 22d0cbf39c2c7c7c0fd2940684db424ec295ae04 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 17 Feb 2022 22:19:23 +0100 Subject: [PATCH 34/99] add some code which might work --- .../Framework/DbDomainServiceEFCore.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs index a800837ef..7acf33727 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs @@ -212,12 +212,20 @@ private void SetChangeSetConflicts(Dictionary opera // TODO: Look into DbDomainService.SetChangeSetConflicts it looks quite different and contains other logic such as // loading store entity - throw new NotImplementedException(); + // It might be possible to use "NoTracking" load to find database version + // - this would include getting keys of entity (using stateEntry.Metadata.GetKeys ? ) + // - then creating an expression comparing an X.Key1 = A && X.Key2 == 2 and so on + // - and doing a NoTracking load (some if it woud need to be in a generic method for eas of use) + // another approach would be to create an instance of the same type as X and use + // valeus obtained from stateEntry.GetDatabaseValues() to set it's values + // throw new NotImplementedException(); // Determine which members are in conflict by comparing original values to the current DB values // // TODO: Populate store entity conflictEntry.Value.StoreEntity // TODO: make async loading of tate var dbValues = stateEntry.GetDatabaseValues(); + operationInConflict.StoreEntity = dbValues?.ToObject(); + operationInConflict.IsDeleteConflict = operationInConflict.StoreEntity == null; // PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); List membersInConflict = new List(); From ba9351cfd2d0358b2083bc7108e540c1f5581948 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Fri, 18 Feb 2022 12:13:09 +0100 Subject: [PATCH 35/99] copy baseline from EFCodeFirst for codegen test --- .../Test/CodeGenDomainServices.cs | 6 +- .../Scenarios/EFCoreContextScenarios.g.cs | 2932 +++++++++++++++++ .../Scenarios/EFCoreContextScenarios.g.vb | 2708 +++++++++++++++ 3 files changed, 5643 insertions(+), 3 deletions(-) create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index df4f6a2df..e8a45acf9 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -166,15 +166,15 @@ public void TestClientCodegen_EFDbCtxDomainServices_FullTypes() typeof(TestDomainServices.DbCtx.Northwind), sharedFiles, true)); } - [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFDbContext")] - [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFDbContext")] + [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFCoreContext")] + [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFCoreContext")] [TestMethod] public void TestClientCodegen_EFCoreEFDbCtxDomainServices() { string[] sharedFiles = Array.Empty(); // Default codegen - TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\Scenarios", "CG_Scenarios_EFDbContext", "EFDbContextScenarios.g", + TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\Scenarios", "CG_Scenarios_EFCoreContext", "EFCoreContextScenarios.g", typeof(TestDomainServices.EFCore.Northwind), sharedFiles, false)); } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs new file mode 100644 index 000000000..d2e1d8629 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs @@ -0,0 +1,2932 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace EFCoreModels.Northwind +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.ComponentModel.DataAnnotations; + using System.Linq; + using System.Runtime.Serialization; + using System.Threading.Tasks; + using OpenRiaServices; + using OpenRiaServices.Client; + using OpenRiaServices.Client.Authentication; + + + /// + /// The 'Category' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Category : Entity + { + + private int _categoryID; + + private string _categoryName; + + private string _description; + + private byte[] _picture; + + private EntityCollection _products; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryIDChanging(int value); + partial void OnCategoryIDChanged(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnDescriptionChanging(string value); + partial void OnDescriptionChanged(); + partial void OnPictureChanging(byte[] value); + partial void OnPictureChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Category() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'CategoryID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int CategoryID + { + get + { + return this._categoryID; + } + set + { + if ((this._categoryID != value)) + { + this.OnCategoryIDChanging(value); + this.ValidateProperty("CategoryID", value); + this._categoryID = value; + this.RaisePropertyChanged("CategoryID"); + this.OnCategoryIDChanged(); + } + } + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [DataMember()] + [Required()] + [StringLength(15)] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.RaiseDataMemberChanging("CategoryName"); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaiseDataMemberChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Description' value. + /// + [DataMember()] + public string Description + { + get + { + return this._description; + } + set + { + if ((this._description != value)) + { + this.OnDescriptionChanging(value); + this.RaiseDataMemberChanging("Description"); + this.ValidateProperty("Description", value); + this._description = value; + this.RaiseDataMemberChanged("Description"); + this.OnDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'Picture' value. + /// + [DataMember()] + public byte[] Picture + { + get + { + return this._picture; + } + set + { + if ((this._picture != value)) + { + this.OnPictureChanging(value); + this.RaiseDataMemberChanging("Picture"); + this.ValidateProperty("Picture", value); + this._picture = value; + this.RaiseDataMemberChanged("Picture"); + this.OnPictureChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Category_Product", "CategoryID", "CategoryID")] + public EntityCollection Products + { + get + { + if ((this._products == null)) + { + this._products = new EntityCollection(this, "Products", this.FilterProducts, this.AttachProducts, this.DetachProducts); + } + return this._products; + } + } + + private void AttachProducts(Product entity) + { + entity.Category = this; + } + + private void DetachProducts(Product entity) + { + entity.Category = null; + } + + private bool FilterProducts(Product entity) + { + return (entity.CategoryID == this.CategoryID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._categoryID; + } + } + + /// + /// The 'Customer' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Customer : Entity + { + + private string _address; + + private string _city; + + private string _companyName; + + private string _contactName; + + private string _contactTitle; + + private string _country; + + private string _customerID; + + private string _fax; + + private EntityCollection _orders; + + private string _phone; + + private string _postalCode; + + private string _region; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnAddressChanging(string value); + partial void OnAddressChanged(); + partial void OnCityChanging(string value); + partial void OnCityChanged(); + partial void OnCompanyNameChanging(string value); + partial void OnCompanyNameChanged(); + partial void OnContactNameChanging(string value); + partial void OnContactNameChanged(); + partial void OnContactTitleChanging(string value); + partial void OnContactTitleChanged(); + partial void OnCountryChanging(string value); + partial void OnCountryChanged(); + partial void OnCustomerIDChanging(string value); + partial void OnCustomerIDChanged(); + partial void OnFaxChanging(string value); + partial void OnFaxChanged(); + partial void OnPhoneChanging(string value); + partial void OnPhoneChanged(); + partial void OnPostalCodeChanging(string value); + partial void OnPostalCodeChanged(); + partial void OnRegionChanging(string value); + partial void OnRegionChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Customer() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'Address' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(60)] + public string Address + { + get + { + return this._address; + } + set + { + if ((this._address != value)) + { + this.OnAddressChanging(value); + this.RaiseDataMemberChanging("Address"); + this.ValidateProperty("Address", value); + this._address = value; + this.RaiseDataMemberChanged("Address"); + this.OnAddressChanged(); + } + } + } + + /// + /// Gets or sets the 'City' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string City + { + get + { + return this._city; + } + set + { + if ((this._city != value)) + { + this.OnCityChanging(value); + this.RaiseDataMemberChanging("City"); + this.ValidateProperty("City", value); + this._city = value; + this.RaiseDataMemberChanged("City"); + this.OnCityChanged(); + } + } + } + + /// + /// Gets or sets the 'CompanyName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(40)] + public string CompanyName + { + get + { + return this._companyName; + } + set + { + if ((this._companyName != value)) + { + this.OnCompanyNameChanging(value); + this.RaiseDataMemberChanging("CompanyName"); + this.ValidateProperty("CompanyName", value); + this._companyName = value; + this.RaiseDataMemberChanged("CompanyName"); + this.OnCompanyNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ContactName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(30)] + public string ContactName + { + get + { + return this._contactName; + } + set + { + if ((this._contactName != value)) + { + this.OnContactNameChanging(value); + this.RaiseDataMemberChanging("ContactName"); + this.ValidateProperty("ContactName", value); + this._contactName = value; + this.RaiseDataMemberChanged("ContactName"); + this.OnContactNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ContactTitle' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(30)] + public string ContactTitle + { + get + { + return this._contactTitle; + } + set + { + if ((this._contactTitle != value)) + { + this.OnContactTitleChanging(value); + this.RaiseDataMemberChanging("ContactTitle"); + this.ValidateProperty("ContactTitle", value); + this._contactTitle = value; + this.RaiseDataMemberChanged("ContactTitle"); + this.OnContactTitleChanged(); + } + } + } + + /// + /// Gets or sets the 'Country' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string Country + { + get + { + return this._country; + } + set + { + if ((this._country != value)) + { + this.OnCountryChanging(value); + this.RaiseDataMemberChanging("Country"); + this.ValidateProperty("Country", value); + this._country = value; + this.RaiseDataMemberChanged("Country"); + this.OnCountryChanged(); + } + } + } + + /// + /// Gets or sets the 'CustomerID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [Required()] + [RoundtripOriginal()] + [StringLength(15)] + public string CustomerID + { + get + { + return this._customerID; + } + set + { + if ((this._customerID != value)) + { + this.OnCustomerIDChanging(value); + this.ValidateProperty("CustomerID", value); + this._customerID = value; + this.RaisePropertyChanged("CustomerID"); + this.OnCustomerIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Fax' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(24)] + public string Fax + { + get + { + return this._fax; + } + set + { + if ((this._fax != value)) + { + this.OnFaxChanging(value); + this.RaiseDataMemberChanging("Fax"); + this.ValidateProperty("Fax", value); + this._fax = value; + this.RaiseDataMemberChanged("Fax"); + this.OnFaxChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Customer_Order", "CustomerID", "CustomerID")] + public EntityCollection Orders + { + get + { + if ((this._orders == null)) + { + this._orders = new EntityCollection(this, "Orders", this.FilterOrders, this.AttachOrders, this.DetachOrders); + } + return this._orders; + } + } + + /// + /// Gets or sets the 'Phone' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(24)] + public string Phone + { + get + { + return this._phone; + } + set + { + if ((this._phone != value)) + { + this.OnPhoneChanging(value); + this.RaiseDataMemberChanging("Phone"); + this.ValidateProperty("Phone", value); + this._phone = value; + this.RaiseDataMemberChanged("Phone"); + this.OnPhoneChanged(); + } + } + } + + /// + /// Gets or sets the 'PostalCode' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(10)] + public string PostalCode + { + get + { + return this._postalCode; + } + set + { + if ((this._postalCode != value)) + { + this.OnPostalCodeChanging(value); + this.RaiseDataMemberChanging("PostalCode"); + this.ValidateProperty("PostalCode", value); + this._postalCode = value; + this.RaiseDataMemberChanged("PostalCode"); + this.OnPostalCodeChanged(); + } + } + } + + /// + /// Gets or sets the 'Region' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string Region + { + get + { + return this._region; + } + set + { + if ((this._region != value)) + { + this.OnRegionChanging(value); + this.RaiseDataMemberChanging("Region"); + this.ValidateProperty("Region", value); + this._region = value; + this.RaiseDataMemberChanged("Region"); + this.OnRegionChanged(); + } + } + } + + private void AttachOrders(Order entity) + { + entity.Customer = this; + } + + private void DetachOrders(Order entity) + { + entity.Customer = null; + } + + private bool FilterOrders(Order entity) + { + return (entity.CustomerID == this.CustomerID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._customerID; + } + } + + /// + /// The 'Order' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Order : Entity + { + + private EntityRef _customer; + + private string _customerID; + + private Nullable _employeeID; + + private string _formattedName; + + private Nullable _freight; + + private EntityCollection _order_Details; + + private Nullable _orderDate; + + private int _orderID; + + private Nullable _requiredDate; + + private string _shipAddress; + + private string _shipCity; + + private string _shipCountry; + + private string _shipName; + + private Nullable _shippedDate; + + private string _shipPostalCode; + + private string _shipRegion; + + private Nullable _shipVia; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCustomerIDChanging(string value); + partial void OnCustomerIDChanged(); + partial void OnEmployeeIDChanging(Nullable value); + partial void OnEmployeeIDChanged(); + partial void OnFormattedNameChanging(string value); + partial void OnFormattedNameChanged(); + partial void OnFreightChanging(Nullable value); + partial void OnFreightChanged(); + partial void OnOrderDateChanging(Nullable value); + partial void OnOrderDateChanged(); + partial void OnOrderIDChanging(int value); + partial void OnOrderIDChanged(); + partial void OnRequiredDateChanging(Nullable value); + partial void OnRequiredDateChanged(); + partial void OnShipAddressChanging(string value); + partial void OnShipAddressChanged(); + partial void OnShipCityChanging(string value); + partial void OnShipCityChanged(); + partial void OnShipCountryChanging(string value); + partial void OnShipCountryChanged(); + partial void OnShipNameChanging(string value); + partial void OnShipNameChanged(); + partial void OnShippedDateChanging(Nullable value); + partial void OnShippedDateChanged(); + partial void OnShipPostalCodeChanging(string value); + partial void OnShipPostalCodeChanged(); + partial void OnShipRegionChanging(string value); + partial void OnShipRegionChanged(); + partial void OnShipViaChanging(Nullable value); + partial void OnShipViaChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Order() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)] + public Customer Customer + { + get + { + if ((this._customer == null)) + { + this._customer = new EntityRef(this, "Customer", this.FilterCustomer); + } + return this._customer.Entity; + } + set + { + Customer previous = this.Customer; + if ((previous != value)) + { + this.ValidateProperty("Customer", value); + if ((previous != null)) + { + this._customer.Entity = null; + previous.Orders.Remove(this); + } + if ((value != null)) + { + this.CustomerID = value.CustomerID; + } + else + { + this.CustomerID = default(string); + } + this._customer.Entity = value; + if ((value != null)) + { + value.Orders.Add(this); + } + this.RaisePropertyChanged("Customer"); + } + } + } + + /// + /// Gets or sets the 'CustomerID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(5)] + public string CustomerID + { + get + { + return this._customerID; + } + set + { + if ((this._customerID != value)) + { + this.OnCustomerIDChanging(value); + this.RaiseDataMemberChanging("CustomerID"); + this.ValidateProperty("CustomerID", value); + this._customerID = value; + this.RaiseDataMemberChanged("CustomerID"); + this.OnCustomerIDChanged(); + } + } + } + + /// + /// Gets or sets the 'EmployeeID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable EmployeeID + { + get + { + return this._employeeID; + } + set + { + if ((this._employeeID != value)) + { + this.OnEmployeeIDChanging(value); + this.RaiseDataMemberChanging("EmployeeID"); + this.ValidateProperty("EmployeeID", value); + this._employeeID = value; + this.RaiseDataMemberChanged("EmployeeID"); + this.OnEmployeeIDChanged(); + } + } + } + + /// + /// Gets or sets the 'FormattedName' value. + /// + [DataMember()] + [Editable(false)] + [ReadOnly(true)] + public string FormattedName + { + get + { + return this._formattedName; + } + set + { + if ((this._formattedName != value)) + { + this.OnFormattedNameChanging(value); + this.ValidateProperty("FormattedName", value); + this._formattedName = value; + this.RaisePropertyChanged("FormattedName"); + this.OnFormattedNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Freight' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable Freight + { + get + { + return this._freight; + } + set + { + if ((this._freight != value)) + { + this.OnFreightChanging(value); + this.RaiseDataMemberChanging("Freight"); + this.ValidateProperty("Freight", value); + this._freight = value; + this.RaiseDataMemberChanged("Freight"); + this.OnFreightChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Order_Order_Detail", "OrderID", "OrderID")] + public EntityCollection Order_Details + { + get + { + if ((this._order_Details == null)) + { + this._order_Details = new EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + } + return this._order_Details; + } + } + + /// + /// Gets or sets the 'OrderDate' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable OrderDate + { + get + { + return this._orderDate; + } + set + { + if ((this._orderDate != value)) + { + this.OnOrderDateChanging(value); + this.RaiseDataMemberChanging("OrderDate"); + this.ValidateProperty("OrderDate", value); + this._orderDate = value; + this.RaiseDataMemberChanged("OrderDate"); + this.OnOrderDateChanged(); + } + } + } + + /// + /// Gets or sets the 'OrderID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int OrderID + { + get + { + return this._orderID; + } + set + { + if ((this._orderID != value)) + { + this.OnOrderIDChanging(value); + this.ValidateProperty("OrderID", value); + this._orderID = value; + this.RaisePropertyChanged("OrderID"); + this.OnOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the 'RequiredDate' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable RequiredDate + { + get + { + return this._requiredDate; + } + set + { + if ((this._requiredDate != value)) + { + this.OnRequiredDateChanging(value); + this.RaiseDataMemberChanging("RequiredDate"); + this.ValidateProperty("RequiredDate", value); + this._requiredDate = value; + this.RaiseDataMemberChanged("RequiredDate"); + this.OnRequiredDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipAddress' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(60)] + public string ShipAddress + { + get + { + return this._shipAddress; + } + set + { + if ((this._shipAddress != value)) + { + this.OnShipAddressChanging(value); + this.RaiseDataMemberChanging("ShipAddress"); + this.ValidateProperty("ShipAddress", value); + this._shipAddress = value; + this.RaiseDataMemberChanged("ShipAddress"); + this.OnShipAddressChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipCity' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string ShipCity + { + get + { + return this._shipCity; + } + set + { + if ((this._shipCity != value)) + { + this.OnShipCityChanging(value); + this.RaiseDataMemberChanging("ShipCity"); + this.ValidateProperty("ShipCity", value); + this._shipCity = value; + this.RaiseDataMemberChanged("ShipCity"); + this.OnShipCityChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipCountry' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string ShipCountry + { + get + { + return this._shipCountry; + } + set + { + if ((this._shipCountry != value)) + { + this.OnShipCountryChanging(value); + this.RaiseDataMemberChanging("ShipCountry"); + this.ValidateProperty("ShipCountry", value); + this._shipCountry = value; + this.RaiseDataMemberChanged("ShipCountry"); + this.OnShipCountryChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(40)] + public string ShipName + { + get + { + return this._shipName; + } + set + { + if ((this._shipName != value)) + { + this.OnShipNameChanging(value); + this.RaiseDataMemberChanging("ShipName"); + this.ValidateProperty("ShipName", value); + this._shipName = value; + this.RaiseDataMemberChanged("ShipName"); + this.OnShipNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ShippedDate' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable ShippedDate + { + get + { + return this._shippedDate; + } + set + { + if ((this._shippedDate != value)) + { + this.OnShippedDateChanging(value); + this.RaiseDataMemberChanging("ShippedDate"); + this.ValidateProperty("ShippedDate", value); + this._shippedDate = value; + this.RaiseDataMemberChanged("ShippedDate"); + this.OnShippedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipPostalCode' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(10)] + public string ShipPostalCode + { + get + { + return this._shipPostalCode; + } + set + { + if ((this._shipPostalCode != value)) + { + this.OnShipPostalCodeChanging(value); + this.RaiseDataMemberChanging("ShipPostalCode"); + this.ValidateProperty("ShipPostalCode", value); + this._shipPostalCode = value; + this.RaiseDataMemberChanged("ShipPostalCode"); + this.OnShipPostalCodeChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipRegion' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string ShipRegion + { + get + { + return this._shipRegion; + } + set + { + if ((this._shipRegion != value)) + { + this.OnShipRegionChanging(value); + this.RaiseDataMemberChanging("ShipRegion"); + this.ValidateProperty("ShipRegion", value); + this._shipRegion = value; + this.RaiseDataMemberChanged("ShipRegion"); + this.OnShipRegionChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipVia' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable ShipVia + { + get + { + return this._shipVia; + } + set + { + if ((this._shipVia != value)) + { + this.OnShipViaChanging(value); + this.RaiseDataMemberChanging("ShipVia"); + this.ValidateProperty("ShipVia", value); + this._shipVia = value; + this.RaiseDataMemberChanged("ShipVia"); + this.OnShipViaChanged(); + } + } + } + + private bool FilterCustomer(Customer entity) + { + return (entity.CustomerID == this.CustomerID); + } + + private void AttachOrder_Details(Order_Detail entity) + { + entity.Order = this; + } + + private void DetachOrder_Details(Order_Detail entity) + { + entity.Order = null; + } + + private bool FilterOrder_Details(Order_Detail entity) + { + return (entity.OrderID == this.OrderID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._orderID; + } + } + + /// + /// The 'Order_Detail' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Order_Detail : Entity + { + + private float _discount; + + private EntityRef _order; + + private int _orderID; + + private EntityRef _product; + + private int _productID; + + private short _quantity; + + private decimal _unitPrice; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnDiscountChanging(float value); + partial void OnDiscountChanged(); + partial void OnOrderIDChanging(int value); + partial void OnOrderIDChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnQuantityChanging(short value); + partial void OnQuantityChanged(); + partial void OnUnitPriceChanging(decimal value); + partial void OnUnitPriceChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Order_Detail() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'Discount' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public float Discount + { + get + { + return this._discount; + } + set + { + if ((this._discount != value)) + { + this.OnDiscountChanging(value); + this.RaiseDataMemberChanging("Discount"); + this.ValidateProperty("Discount", value); + this._discount = value; + this.RaiseDataMemberChanged("Discount"); + this.OnDiscountChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)] + public Order Order + { + get + { + if ((this._order == null)) + { + this._order = new EntityRef(this, "Order", this.FilterOrder); + } + return this._order.Entity; + } + set + { + Order previous = this.Order; + if ((previous != value)) + { + this.ValidateProperty("Order", value); + if ((previous != null)) + { + this._order.Entity = null; + previous.Order_Details.Remove(this); + } + if ((value != null)) + { + this.OrderID = value.OrderID; + } + else + { + this.OrderID = default(int); + } + this._order.Entity = value; + if ((value != null)) + { + value.Order_Details.Add(this); + } + this.RaisePropertyChanged("Order"); + } + } + } + + /// + /// Gets or sets the 'OrderID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Key()] + [RoundtripOriginal()] + public int OrderID + { + get + { + return this._orderID; + } + set + { + if ((this._orderID != value)) + { + this.OnOrderIDChanging(value); + this.RaiseDataMemberChanging("OrderID"); + this.ValidateProperty("OrderID", value); + this._orderID = value; + this.RaiseDataMemberChanged("OrderID"); + this.OnOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)] + public Product Product + { + get + { + if ((this._product == null)) + { + this._product = new EntityRef(this, "Product", this.FilterProduct); + } + return this._product.Entity; + } + set + { + Product previous = this.Product; + if ((previous != value)) + { + this.ValidateProperty("Product", value); + if ((previous != null)) + { + this._product.Entity = null; + previous.Order_Details.Remove(this); + } + if ((value != null)) + { + this.ProductID = value.ProductID; + } + else + { + this.ProductID = default(int); + } + this._product.Entity = value; + if ((value != null)) + { + value.Order_Details.Add(this); + } + this.RaisePropertyChanged("Product"); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Key()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.RaiseDataMemberChanging("ProductID"); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaiseDataMemberChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Quantity' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public short Quantity + { + get + { + return this._quantity; + } + set + { + if ((this._quantity != value)) + { + this.OnQuantityChanging(value); + this.RaiseDataMemberChanging("Quantity"); + this.ValidateProperty("Quantity", value); + this._quantity = value; + this.RaiseDataMemberChanged("Quantity"); + this.OnQuantityChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitPrice' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public decimal UnitPrice + { + get + { + return this._unitPrice; + } + set + { + if ((this._unitPrice != value)) + { + this.OnUnitPriceChanging(value); + this.RaiseDataMemberChanging("UnitPrice"); + this.ValidateProperty("UnitPrice", value); + this._unitPrice = value; + this.RaiseDataMemberChanged("UnitPrice"); + this.OnUnitPriceChanged(); + } + } + } + + private bool FilterOrder(Order entity) + { + return (entity.OrderID == this.OrderID); + } + + private bool FilterProduct(Product entity) + { + return (entity.ProductID == this.ProductID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return EntityKey.Create(this._orderID, this._productID); + } + } + + /// + /// The 'Product' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Product : Entity + { + + private EntityRef _category; + + private Nullable _categoryID; + + private string _categoryName; + + private bool _discontinued; + + private EntityCollection _order_Details; + + private int _productID; + + private string _productName; + + private string _quantityPerUnit; + + private Nullable _reorderLevel; + + private string _resolveMethod; + + private Nullable _supplierID; + + private string _supplierName; + + private Nullable _unitPrice; + + private Nullable _unitsInStock; + + private Nullable _unitsOnOrder; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryIDChanging(Nullable value); + partial void OnCategoryIDChanged(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnDiscontinuedChanging(bool value); + partial void OnDiscontinuedChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnProductNameChanging(string value); + partial void OnProductNameChanged(); + partial void OnQuantityPerUnitChanging(string value); + partial void OnQuantityPerUnitChanged(); + partial void OnReorderLevelChanging(Nullable value); + partial void OnReorderLevelChanged(); + partial void OnResolveMethodChanging(string value); + partial void OnResolveMethodChanged(); + partial void OnSupplierIDChanging(Nullable value); + partial void OnSupplierIDChanged(); + partial void OnSupplierNameChanging(string value); + partial void OnSupplierNameChanged(); + partial void OnUnitPriceChanging(Nullable value); + partial void OnUnitPriceChanged(); + partial void OnUnitsInStockChanging(Nullable value); + partial void OnUnitsInStockChanged(); + partial void OnUnitsOnOrderChanging(Nullable value); + partial void OnUnitsOnOrderChanged(); + partial void OnDiscontinueProductInvoking(); + partial void OnDiscontinueProductInvoked(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Product() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)] + public Category Category + { + get + { + if ((this._category == null)) + { + this._category = new EntityRef(this, "Category", this.FilterCategory); + } + return this._category.Entity; + } + set + { + Category previous = this.Category; + if ((previous != value)) + { + this.ValidateProperty("Category", value); + if ((previous != null)) + { + this._category.Entity = null; + previous.Products.Remove(this); + } + if ((value != null)) + { + this.CategoryID = value.CategoryID; + } + else + { + this.CategoryID = default(Nullable); + } + this._category.Entity = value; + if ((value != null)) + { + value.Products.Add(this); + } + this.RaisePropertyChanged("Category"); + } + } + } + + /// + /// Gets or sets the 'CategoryID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable CategoryID + { + get + { + return this._categoryID; + } + set + { + if ((this._categoryID != value)) + { + this.OnCategoryIDChanging(value); + this.RaiseDataMemberChanging("CategoryID"); + this.ValidateProperty("CategoryID", value); + this._categoryID = value; + this.RaiseDataMemberChanged("CategoryID"); + this.OnCategoryIDChanged(); + } + } + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [DataMember()] + [Editable(false)] + [StringLength(15)] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaisePropertyChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Discontinued' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public bool Discontinued + { + get + { + return this._discontinued; + } + set + { + if ((this._discontinued != value)) + { + this.OnDiscontinuedChanging(value); + this.RaiseDataMemberChanging("Discontinued"); + this.ValidateProperty("Discontinued", value); + this._discontinued = value; + this.RaiseDataMemberChanged("Discontinued"); + this.OnDiscontinuedChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Product_Order_Detail", "ProductID", "ProductID")] + public EntityCollection Order_Details + { + get + { + if ((this._order_Details == null)) + { + this._order_Details = new EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + } + return this._order_Details; + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Required()] + [RoundtripOriginal()] + [StringLength(40)] + public string ProductName + { + get + { + return this._productName; + } + set + { + if ((this._productName != value)) + { + this.OnProductNameChanging(value); + this.RaiseDataMemberChanging("ProductName"); + this.ValidateProperty("ProductName", value); + this._productName = value; + this.RaiseDataMemberChanged("ProductName"); + this.OnProductNameChanged(); + } + } + } + + /// + /// Gets or sets the 'QuantityPerUnit' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(20)] + public string QuantityPerUnit + { + get + { + return this._quantityPerUnit; + } + set + { + if ((this._quantityPerUnit != value)) + { + this.OnQuantityPerUnitChanging(value); + this.RaiseDataMemberChanging("QuantityPerUnit"); + this.ValidateProperty("QuantityPerUnit", value); + this._quantityPerUnit = value; + this.RaiseDataMemberChanged("QuantityPerUnit"); + this.OnQuantityPerUnitChanged(); + } + } + } + + /// + /// Gets or sets the 'ReorderLevel' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable ReorderLevel + { + get + { + return this._reorderLevel; + } + set + { + if ((this._reorderLevel != value)) + { + this.OnReorderLevelChanging(value); + this.RaiseDataMemberChanging("ReorderLevel"); + this.ValidateProperty("ReorderLevel", value); + this._reorderLevel = value; + this.RaiseDataMemberChanged("ReorderLevel"); + this.OnReorderLevelChanged(); + } + } + } + + /// + /// Gets or sets the 'ResolveMethod' value. + /// + [DataMember()] + public string ResolveMethod + { + get + { + return this._resolveMethod; + } + set + { + if ((this._resolveMethod != value)) + { + this.OnResolveMethodChanging(value); + this.RaiseDataMemberChanging("ResolveMethod"); + this.ValidateProperty("ResolveMethod", value); + this._resolveMethod = value; + this.RaiseDataMemberChanged("ResolveMethod"); + this.OnResolveMethodChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable SupplierID + { + get + { + return this._supplierID; + } + set + { + if ((this._supplierID != value)) + { + this.OnSupplierIDChanging(value); + this.RaiseDataMemberChanging("SupplierID"); + this.ValidateProperty("SupplierID", value); + this._supplierID = value; + this.RaiseDataMemberChanged("SupplierID"); + this.OnSupplierIDChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierName' value. + /// + [DataMember()] + [Editable(false)] + public string SupplierName + { + get + { + return this._supplierName; + } + set + { + if ((this._supplierName != value)) + { + this.OnSupplierNameChanging(value); + this.ValidateProperty("SupplierName", value); + this._supplierName = value; + this.RaisePropertyChanged("SupplierName"); + this.OnSupplierNameChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitPrice' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable UnitPrice + { + get + { + return this._unitPrice; + } + set + { + if ((this._unitPrice != value)) + { + this.OnUnitPriceChanging(value); + this.RaiseDataMemberChanging("UnitPrice"); + this.ValidateProperty("UnitPrice", value); + this._unitPrice = value; + this.RaiseDataMemberChanged("UnitPrice"); + this.OnUnitPriceChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitsInStock' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable UnitsInStock + { + get + { + return this._unitsInStock; + } + set + { + if ((this._unitsInStock != value)) + { + this.OnUnitsInStockChanging(value); + this.RaiseDataMemberChanging("UnitsInStock"); + this.ValidateProperty("UnitsInStock", value); + this._unitsInStock = value; + this.RaiseDataMemberChanged("UnitsInStock"); + this.OnUnitsInStockChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitsOnOrder' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable UnitsOnOrder + { + get + { + return this._unitsOnOrder; + } + set + { + if ((this._unitsOnOrder != value)) + { + this.OnUnitsOnOrderChanging(value); + this.RaiseDataMemberChanging("UnitsOnOrder"); + this.ValidateProperty("UnitsOnOrder", value); + this._unitsOnOrder = value; + this.RaiseDataMemberChanged("UnitsOnOrder"); + this.OnUnitsOnOrderChanged(); + } + } + } + + /// + /// Gets a value indicating whether the 'DiscontinueProduct' action has been invoked on this entity. + /// + [Display(AutoGenerateField=false)] + public bool IsDiscontinueProductInvoked + { + get + { + return base.IsActionInvoked("DiscontinueProduct"); + } + } + + /// + /// Gets a value indicating whether the 'DiscontinueProduct' method can be invoked on this entity. + /// + [Display(AutoGenerateField=false)] + public bool CanDiscontinueProduct + { + get + { + return base.CanInvokeAction("DiscontinueProduct"); + } + } + + private bool FilterCategory(Category entity) + { + return (entity.CategoryID == this.CategoryID); + } + + private void AttachOrder_Details(Order_Detail entity) + { + entity.Product = this; + } + + private void DetachOrder_Details(Order_Detail entity) + { + entity.Product = null; + } + + private bool FilterOrder_Details(Order_Detail entity) + { + return (entity.ProductID == this.ProductID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._productID; + } + + /// + /// Invokes the 'DiscontinueProduct' action on this entity. + /// + [EntityAction("DiscontinueProduct", AllowMultipleInvocations=false)] + public void DiscontinueProduct() + { + this.OnDiscontinueProductInvoking(); + base.InvokeAction("DiscontinueProduct"); + this.OnDiscontinueProductInvoked(); + } + } + + /// + /// The 'ProductInfo' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class ProductInfo : Entity + { + + private string _categoryName; + + private int _productID; + + private string _productName; + + private string _supplierName; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnProductNameChanging(string value); + partial void OnProductNameChanged(); + partial void OnSupplierNameChanging(string value); + partial void OnSupplierNameChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public ProductInfo() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [DataMember()] + [Editable(false)] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaisePropertyChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductName' value. + /// + [DataMember()] + public string ProductName + { + get + { + return this._productName; + } + set + { + if ((this._productName != value)) + { + this.OnProductNameChanging(value); + this.RaiseDataMemberChanging("ProductName"); + this.ValidateProperty("ProductName", value); + this._productName = value; + this.RaiseDataMemberChanged("ProductName"); + this.OnProductNameChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierName' value. + /// + [DataMember()] + [Editable(false)] + public string SupplierName + { + get + { + return this._supplierName; + } + set + { + if ((this._supplierName != value)) + { + this.OnSupplierNameChanging(value); + this.ValidateProperty("SupplierName", value); + this._supplierName = value; + this.RaisePropertyChanged("SupplierName"); + this.OnSupplierNameChanged(); + } + } + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._productID; + } + } + + /// + /// The 'Region' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Region : Entity + { + + private string _regionDescription; + + private int _regionID; + + private EntityCollection _territories; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnRegionDescriptionChanging(string value); + partial void OnRegionDescriptionChanged(); + partial void OnRegionIDChanging(int value); + partial void OnRegionIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Region() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'RegionDescription' value. + /// + [DataMember()] + [StringLength(50)] + public string RegionDescription + { + get + { + return this._regionDescription; + } + set + { + if ((this._regionDescription != value)) + { + this.OnRegionDescriptionChanging(value); + this.RaiseDataMemberChanging("RegionDescription"); + this.ValidateProperty("RegionDescription", value); + this._regionDescription = value; + this.RaiseDataMemberChanged("RegionDescription"); + this.OnRegionDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'RegionID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int RegionID + { + get + { + return this._regionID; + } + set + { + if ((this._regionID != value)) + { + this.OnRegionIDChanging(value); + this.ValidateProperty("RegionID", value); + this._regionID = value; + this.RaisePropertyChanged("RegionID"); + this.OnRegionIDChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Region_Territory", "RegionID", "RegionID")] + [Composition()] + public EntityCollection Territories + { + get + { + if ((this._territories == null)) + { + this._territories = new EntityCollection(this, "Territories", this.FilterTerritories, this.AttachTerritories, this.DetachTerritories); + } + return this._territories; + } + } + + private void AttachTerritories(Territory entity) + { + entity.Region = this; + } + + private void DetachTerritories(Territory entity) + { + entity.Region = null; + } + + private bool FilterTerritories(Territory entity) + { + return (entity.RegionID == this.RegionID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._regionID; + } + } + + /// + /// The 'Territory' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Territory : Entity + { + + private EntityRef _region; + + private int _regionID; + + private string _territoryDescription; + + private string _territoryID; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnRegionIDChanging(int value); + partial void OnRegionIDChanged(); + partial void OnTerritoryDescriptionChanging(string value); + partial void OnTerritoryDescriptionChanged(); + partial void OnTerritoryIDChanging(string value); + partial void OnTerritoryIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Territory() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)] + public Region Region + { + get + { + if ((this._region == null)) + { + this._region = new EntityRef(this, "Region", this.FilterRegion); + } + return this._region.Entity; + } + set + { + Region previous = this.Region; + if ((previous != value)) + { + this.ValidateProperty("Region", value); + if ((previous != null)) + { + this._region.Entity = null; + previous.Territories.Remove(this); + } + if ((value != null)) + { + this.RegionID = value.RegionID; + } + else + { + this.RegionID = default(int); + } + this._region.Entity = value; + if ((value != null)) + { + value.Territories.Add(this); + } + this.RaisePropertyChanged("Region"); + } + } + } + + /// + /// Gets or sets the 'RegionID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public int RegionID + { + get + { + return this._regionID; + } + set + { + if ((this._regionID != value)) + { + this.OnRegionIDChanging(value); + this.RaiseDataMemberChanging("RegionID"); + this.ValidateProperty("RegionID", value); + this._regionID = value; + this.RaiseDataMemberChanged("RegionID"); + this.OnRegionIDChanged(); + } + } + } + + /// + /// Gets or sets the 'TerritoryDescription' value. + /// + [DataMember()] + [StringLength(50)] + public string TerritoryDescription + { + get + { + return this._territoryDescription; + } + set + { + if ((this._territoryDescription != value)) + { + this.OnTerritoryDescriptionChanging(value); + this.RaiseDataMemberChanging("TerritoryDescription"); + this.ValidateProperty("TerritoryDescription", value); + this._territoryDescription = value; + this.RaiseDataMemberChanged("TerritoryDescription"); + this.OnTerritoryDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'TerritoryID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [Required()] + [RoundtripOriginal()] + [StringLength(20)] + public string TerritoryID + { + get + { + return this._territoryID; + } + set + { + if ((this._territoryID != value)) + { + this.OnTerritoryIDChanging(value); + this.ValidateProperty("TerritoryID", value); + this._territoryID = value; + this.RaisePropertyChanged("TerritoryID"); + this.OnTerritoryIDChanged(); + } + } + } + + private bool FilterRegion(Region entity) + { + return (entity.RegionID == this.RegionID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._territoryID; + } + } +} +namespace TestDomainServices.EFCore +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.ComponentModel.DataAnnotations; + using System.Linq; + using System.ServiceModel; + using System.Threading.Tasks; + using CodeFirstModels; + using OpenRiaServices; + using OpenRiaServices.Client; + using OpenRiaServices.Client.Authentication; + + + /// + /// The DomainContext corresponding to the 'Northwind' DomainService. + /// + public sealed partial class Northwind : DomainContext + { + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Northwind() : + this(new Uri("TestDomainServices-EFCore-Northwind.svc", UriKind.Relative)) + { + } + + /// + /// Initializes a new instance of the class with the specified service URI. + /// + /// The Northwind service URI. + public Northwind(Uri serviceUri) : + this(DomainContext.CreateDomainClient(typeof(INorthwindContract), serviceUri, false)) + { + } + + /// + /// Initializes a new instance of the class with the specified . + /// + /// The DomainClient instance to use for this DomainContext. + public Northwind(DomainClient domainClient) : + base(domainClient) + { + this.OnCreated(); + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Categories + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Customers + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Order_Details + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Orders + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Products + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet ProductInfos + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Regions + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetCategoriesQuery() + { + this.ValidateMethod("GetCategoriesQuery", null); + return base.CreateQuery("GetCategories", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetCustomersQuery() + { + this.ValidateMethod("GetCustomersQuery", null); + return base.CreateQuery("GetCustomers", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetOrderDetailsQuery() + { + this.ValidateMethod("GetOrderDetailsQuery", null); + return base.CreateQuery("GetOrderDetails", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetOrdersQuery() + { + this.ValidateMethod("GetOrdersQuery", null); + return base.CreateQuery("GetOrders", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductById' query. + /// + /// The value for the 'id' parameter of the query. + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductByIdQuery(int id) + { + Dictionary parameters = new Dictionary(); + parameters.Add("id", id); + this.ValidateMethod("GetProductByIdQuery", parameters); + return base.CreateQuery("GetProductById", parameters, false, false); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductInfosQuery() + { + this.ValidateMethod("GetProductInfosQuery", null); + return base.CreateQuery("GetProductInfos", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductsQuery() + { + this.ValidateMethod("GetProductsQuery", null); + return base.CreateQuery("GetProducts", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegionById' query. + /// + /// The value for the 'id' parameter of the query. + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetRegionByIdQuery(int id) + { + Dictionary parameters = new Dictionary(); + parameters.Add("id", id); + this.ValidateMethod("GetRegionByIdQuery", parameters); + return base.CreateQuery("GetRegionById", parameters, false, false); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetRegionsQuery() + { + this.ValidateMethod("GetRegionsQuery", null); + return base.CreateQuery("GetRegions", null, false, true); + } + + /// + /// Invokes the 'DiscontinueProduct' method of the specified entity. + /// + /// The entity instance. + public void DiscontinueProduct(Product product) + { + product.DiscontinueProduct(); + } + + /// + /// Creates a new EntityContainer for this DomainContext's EntitySets. + /// + /// A new container instance. + protected override EntityContainer CreateEntityContainer() + { + return new NorthwindEntityContainer(); + } + + /// + /// Service contract for the 'Northwind' DomainService. + /// + [ServiceContract()] + public interface INorthwindContract + { + + /// + /// Asynchronously invokes the 'GetCategories' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetCategories", ReplyAction="http://tempuri.org/Northwind/GetCategoriesResponse")] + IAsyncResult BeginGetCategories(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetCategories'. + /// + /// The IAsyncResult returned from 'BeginGetCategories'. + /// The 'QueryResult' returned from the 'GetCategories' operation. + QueryResult EndGetCategories(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetCustomers' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetCustomers", ReplyAction="http://tempuri.org/Northwind/GetCustomersResponse")] + IAsyncResult BeginGetCustomers(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetCustomers'. + /// + /// The IAsyncResult returned from 'BeginGetCustomers'. + /// The 'QueryResult' returned from the 'GetCustomers' operation. + QueryResult EndGetCustomers(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetOrderDetails' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetOrderDetails", ReplyAction="http://tempuri.org/Northwind/GetOrderDetailsResponse")] + IAsyncResult BeginGetOrderDetails(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetOrderDetails'. + /// + /// The IAsyncResult returned from 'BeginGetOrderDetails'. + /// The 'QueryResult' returned from the 'GetOrderDetails' operation. + QueryResult EndGetOrderDetails(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetOrders' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetOrders", ReplyAction="http://tempuri.org/Northwind/GetOrdersResponse")] + IAsyncResult BeginGetOrders(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetOrders'. + /// + /// The IAsyncResult returned from 'BeginGetOrders'. + /// The 'QueryResult' returned from the 'GetOrders' operation. + QueryResult EndGetOrders(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductById' operation. + /// + /// The value for the 'id' parameter of this action. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProductById", ReplyAction="http://tempuri.org/Northwind/GetProductByIdResponse")] + IAsyncResult BeginGetProductById(int id, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductById'. + /// + /// The IAsyncResult returned from 'BeginGetProductById'. + /// The 'QueryResult' returned from the 'GetProductById' operation. + QueryResult EndGetProductById(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductInfos' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProductInfos", ReplyAction="http://tempuri.org/Northwind/GetProductInfosResponse")] + IAsyncResult BeginGetProductInfos(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductInfos'. + /// + /// The IAsyncResult returned from 'BeginGetProductInfos'. + /// The 'QueryResult' returned from the 'GetProductInfos' operation. + QueryResult EndGetProductInfos(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProducts' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProducts", ReplyAction="http://tempuri.org/Northwind/GetProductsResponse")] + IAsyncResult BeginGetProducts(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProducts'. + /// + /// The IAsyncResult returned from 'BeginGetProducts'. + /// The 'QueryResult' returned from the 'GetProducts' operation. + QueryResult EndGetProducts(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetRegionById' operation. + /// + /// The value for the 'id' parameter of this action. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetRegionById", ReplyAction="http://tempuri.org/Northwind/GetRegionByIdResponse")] + IAsyncResult BeginGetRegionById(int id, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetRegionById'. + /// + /// The IAsyncResult returned from 'BeginGetRegionById'. + /// The 'QueryResult' returned from the 'GetRegionById' operation. + QueryResult EndGetRegionById(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetRegions' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetRegions", ReplyAction="http://tempuri.org/Northwind/GetRegionsResponse")] + IAsyncResult BeginGetRegions(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetRegions'. + /// + /// The IAsyncResult returned from 'BeginGetRegions'. + /// The 'QueryResult' returned from the 'GetRegions' operation. + QueryResult EndGetRegions(IAsyncResult result); + + /// + /// Asynchronously invokes the 'SubmitChanges' operation. + /// + /// The change-set to submit. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/SubmitChanges", ReplyAction="http://tempuri.org/Northwind/SubmitChangesResponse")] + IAsyncResult BeginSubmitChanges(IEnumerable changeSet, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginSubmitChanges'. + /// + /// The IAsyncResult returned from 'BeginSubmitChanges'. + /// The collection of change-set entry elements returned from 'SubmitChanges'. + IEnumerable EndSubmitChanges(IAsyncResult result); + } + + internal sealed class NorthwindEntityContainer : EntityContainer + { + + public NorthwindEntityContainer() + { + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.Edit); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + } + } + } +} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb new file mode 100644 index 000000000..955aaaebc --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb @@ -0,0 +1,2708 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34209 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Compare Binary +Option Infer On +Option Strict On +Option Explicit On + +Imports CodeFirstModels +Imports OpenRiaServices +Imports OpenRiaServices.Client +Imports OpenRiaServices.Client.Authentication +Imports System +Imports System.Collections.Generic +Imports System.ComponentModel +Imports System.ComponentModel.DataAnnotations +Imports System.Linq +Imports System.Runtime.Serialization +Imports System.ServiceModel +Imports System.Threading.Tasks + +Namespace EFCoreModels.Northwind + + ''' + ''' The 'Category' entity class. + ''' + + Partial Public NotInheritable Class Category + Inherits Entity + + Private _categoryID As Integer + + Private _categoryName As String + + Private _description As String + + Private _picture() As Byte + + Private _products As EntityCollection(Of Product) + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnCategoryIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnCategoryIDChanged() + End Sub + Partial Private Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnCategoryNameChanged() + End Sub + Partial Private Sub OnDescriptionChanging(ByVal value As String) + End Sub + Partial Private Sub OnDescriptionChanged() + End Sub + Partial Private Sub OnPictureChanging(ByVal value() As Byte) + End Sub + Partial Private Sub OnPictureChanged() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the 'CategoryID' value. + ''' + + Public Property CategoryID() As Integer + Get + Return Me._categoryID + End Get + Set + If ((Me._categoryID = Value) _ + = False) Then + Me.OnCategoryIDChanging(Value) + Me.ValidateProperty("CategoryID", Value) + Me._categoryID = Value + Me.RaisePropertyChanged("CategoryID") + Me.OnCategoryIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, Value) = False) Then + Me.OnCategoryNameChanging(Value) + Me.RaiseDataMemberChanging("CategoryName") + Me.ValidateProperty("CategoryName", Value) + Me._categoryName = Value + Me.RaiseDataMemberChanged("CategoryName") + Me.OnCategoryNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Description' value. + ''' + + Public Property Description() As String + Get + Return Me._description + End Get + Set + If (String.Equals(Me._description, Value) = False) Then + Me.OnDescriptionChanging(Value) + Me.RaiseDataMemberChanging("Description") + Me.ValidateProperty("Description", Value) + Me._description = Value + Me.RaiseDataMemberChanged("Description") + Me.OnDescriptionChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Picture' value. + ''' + + Public Property Picture() As Byte() + Get + Return Me._picture + End Get + Set + If (Object.Equals(Me._picture, Value) = False) Then + Me.OnPictureChanging(Value) + Me.RaiseDataMemberChanging("Picture") + Me.ValidateProperty("Picture", Value) + Me._picture = Value + Me.RaiseDataMemberChanged("Picture") + Me.OnPictureChanged() + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + + Public ReadOnly Property Products() As EntityCollection(Of Product) + Get + If (Me._products Is Nothing) Then + Me._products = New EntityCollection(Of Product)(Me, "Products", AddressOf Me.FilterProducts, AddressOf Me.AttachProducts, AddressOf Me.DetachProducts) + End If + Return Me._products + End Get + End Property + + Private Sub AttachProducts(ByVal entity As Product) + entity.Category = Me + End Sub + + Private Sub DetachProducts(ByVal entity As Product) + entity.Category = Nothing + End Sub + + Private Function FilterProducts(ByVal entity As Product) As Boolean + Return Object.Equals(entity.CategoryID, Me.CategoryID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._categoryID + End Function + End Class + + ''' + ''' The 'Customer' entity class. + ''' + + Partial Public NotInheritable Class Customer + Inherits Entity + + Private _address As String + + Private _city As String + + Private _companyName As String + + Private _contactName As String + + Private _contactTitle As String + + Private _country As String + + Private _customerID As String + + Private _fax As String + + Private _orders As EntityCollection(Of Order) + + Private _phone As String + + Private _postalCode As String + + Private _region As String + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnAddressChanging(ByVal value As String) + End Sub + Partial Private Sub OnAddressChanged() + End Sub + Partial Private Sub OnCityChanging(ByVal value As String) + End Sub + Partial Private Sub OnCityChanged() + End Sub + Partial Private Sub OnCompanyNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnCompanyNameChanged() + End Sub + Partial Private Sub OnContactNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnContactNameChanged() + End Sub + Partial Private Sub OnContactTitleChanging(ByVal value As String) + End Sub + Partial Private Sub OnContactTitleChanged() + End Sub + Partial Private Sub OnCountryChanging(ByVal value As String) + End Sub + Partial Private Sub OnCountryChanged() + End Sub + Partial Private Sub OnCustomerIDChanging(ByVal value As String) + End Sub + Partial Private Sub OnCustomerIDChanged() + End Sub + Partial Private Sub OnFaxChanging(ByVal value As String) + End Sub + Partial Private Sub OnFaxChanged() + End Sub + Partial Private Sub OnPhoneChanging(ByVal value As String) + End Sub + Partial Private Sub OnPhoneChanged() + End Sub + Partial Private Sub OnPostalCodeChanging(ByVal value As String) + End Sub + Partial Private Sub OnPostalCodeChanged() + End Sub + Partial Private Sub OnRegionChanging(ByVal value As String) + End Sub + Partial Private Sub OnRegionChanged() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the 'Address' value. + ''' + + Public Property Address() As String + Get + Return Me._address + End Get + Set + If (String.Equals(Me._address, Value) = False) Then + Me.OnAddressChanging(Value) + Me.RaiseDataMemberChanging("Address") + Me.ValidateProperty("Address", Value) + Me._address = Value + Me.RaiseDataMemberChanged("Address") + Me.OnAddressChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'City' value. + ''' + + Public Property City() As String + Get + Return Me._city + End Get + Set + If (String.Equals(Me._city, Value) = False) Then + Me.OnCityChanging(Value) + Me.RaiseDataMemberChanging("City") + Me.ValidateProperty("City", Value) + Me._city = Value + Me.RaiseDataMemberChanged("City") + Me.OnCityChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CompanyName' value. + ''' + + Public Property CompanyName() As String + Get + Return Me._companyName + End Get + Set + If (String.Equals(Me._companyName, Value) = False) Then + Me.OnCompanyNameChanging(Value) + Me.RaiseDataMemberChanging("CompanyName") + Me.ValidateProperty("CompanyName", Value) + Me._companyName = Value + Me.RaiseDataMemberChanged("CompanyName") + Me.OnCompanyNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ContactName' value. + ''' + + Public Property ContactName() As String + Get + Return Me._contactName + End Get + Set + If (String.Equals(Me._contactName, Value) = False) Then + Me.OnContactNameChanging(Value) + Me.RaiseDataMemberChanging("ContactName") + Me.ValidateProperty("ContactName", Value) + Me._contactName = Value + Me.RaiseDataMemberChanged("ContactName") + Me.OnContactNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ContactTitle' value. + ''' + + Public Property ContactTitle() As String + Get + Return Me._contactTitle + End Get + Set + If (String.Equals(Me._contactTitle, Value) = False) Then + Me.OnContactTitleChanging(Value) + Me.RaiseDataMemberChanging("ContactTitle") + Me.ValidateProperty("ContactTitle", Value) + Me._contactTitle = Value + Me.RaiseDataMemberChanged("ContactTitle") + Me.OnContactTitleChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Country' value. + ''' + + Public Property Country() As String + Get + Return Me._country + End Get + Set + If (String.Equals(Me._country, Value) = False) Then + Me.OnCountryChanging(Value) + Me.RaiseDataMemberChanging("Country") + Me.ValidateProperty("Country", Value) + Me._country = Value + Me.RaiseDataMemberChanged("Country") + Me.OnCountryChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CustomerID' value. + ''' + + Public Property CustomerID() As String + Get + Return Me._customerID + End Get + Set + If (String.Equals(Me._customerID, Value) = False) Then + Me.OnCustomerIDChanging(Value) + Me.ValidateProperty("CustomerID", Value) + Me._customerID = Value + Me.RaisePropertyChanged("CustomerID") + Me.OnCustomerIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Fax' value. + ''' + + Public Property Fax() As String + Get + Return Me._fax + End Get + Set + If (String.Equals(Me._fax, Value) = False) Then + Me.OnFaxChanging(Value) + Me.RaiseDataMemberChanging("Fax") + Me.ValidateProperty("Fax", Value) + Me._fax = Value + Me.RaiseDataMemberChanged("Fax") + Me.OnFaxChanged() + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + + Public ReadOnly Property Orders() As EntityCollection(Of Order) + Get + If (Me._orders Is Nothing) Then + Me._orders = New EntityCollection(Of Order)(Me, "Orders", AddressOf Me.FilterOrders, AddressOf Me.AttachOrders, AddressOf Me.DetachOrders) + End If + Return Me._orders + End Get + End Property + + ''' + ''' Gets or sets the 'Phone' value. + ''' + + Public Property Phone() As String + Get + Return Me._phone + End Get + Set + If (String.Equals(Me._phone, Value) = False) Then + Me.OnPhoneChanging(Value) + Me.RaiseDataMemberChanging("Phone") + Me.ValidateProperty("Phone", Value) + Me._phone = Value + Me.RaiseDataMemberChanged("Phone") + Me.OnPhoneChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'PostalCode' value. + ''' + + Public Property PostalCode() As String + Get + Return Me._postalCode + End Get + Set + If (String.Equals(Me._postalCode, Value) = False) Then + Me.OnPostalCodeChanging(Value) + Me.RaiseDataMemberChanging("PostalCode") + Me.ValidateProperty("PostalCode", Value) + Me._postalCode = Value + Me.RaiseDataMemberChanged("PostalCode") + Me.OnPostalCodeChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Region' value. + ''' + + Public Property Region() As String + Get + Return Me._region + End Get + Set + If (String.Equals(Me._region, Value) = False) Then + Me.OnRegionChanging(Value) + Me.RaiseDataMemberChanging("Region") + Me.ValidateProperty("Region", Value) + Me._region = Value + Me.RaiseDataMemberChanged("Region") + Me.OnRegionChanged() + End If + End Set + End Property + + Private Sub AttachOrders(ByVal entity As Order) + entity.Customer = Me + End Sub + + Private Sub DetachOrders(ByVal entity As Order) + entity.Customer = Nothing + End Sub + + Private Function FilterOrders(ByVal entity As Order) As Boolean + Return Object.Equals(entity.CustomerID, Me.CustomerID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._customerID + End Function + End Class + + ''' + ''' The 'Order' entity class. + ''' + + Partial Public NotInheritable Class Order + Inherits Entity + + Private _customer As EntityRef(Of Customer) + + Private _customerID As String + + Private _employeeID As Nullable(Of Integer) + + Private _formattedName As String + + Private _freight As Nullable(Of Decimal) + + Private _order_Details As EntityCollection(Of Order_Detail) + + Private _orderDate As Nullable(Of DateTime) + + Private _orderID As Integer + + Private _requiredDate As Nullable(Of DateTime) + + Private _shipAddress As String + + Private _shipCity As String + + Private _shipCountry As String + + Private _shipName As String + + Private _shippedDate As Nullable(Of DateTime) + + Private _shipPostalCode As String + + Private _shipRegion As String + + Private _shipVia As Nullable(Of Integer) + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnCustomerIDChanging(ByVal value As String) + End Sub + Partial Private Sub OnCustomerIDChanged() + End Sub + Partial Private Sub OnEmployeeIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Partial Private Sub OnEmployeeIDChanged() + End Sub + Partial Private Sub OnFormattedNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnFormattedNameChanged() + End Sub + Partial Private Sub OnFreightChanging(ByVal value As Nullable(Of Decimal)) + End Sub + Partial Private Sub OnFreightChanged() + End Sub + Partial Private Sub OnOrderDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Partial Private Sub OnOrderDateChanged() + End Sub + Partial Private Sub OnOrderIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnOrderIDChanged() + End Sub + Partial Private Sub OnRequiredDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Partial Private Sub OnRequiredDateChanged() + End Sub + Partial Private Sub OnShipAddressChanging(ByVal value As String) + End Sub + Partial Private Sub OnShipAddressChanged() + End Sub + Partial Private Sub OnShipCityChanging(ByVal value As String) + End Sub + Partial Private Sub OnShipCityChanged() + End Sub + Partial Private Sub OnShipCountryChanging(ByVal value As String) + End Sub + Partial Private Sub OnShipCountryChanged() + End Sub + Partial Private Sub OnShipNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnShipNameChanged() + End Sub + Partial Private Sub OnShippedDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Partial Private Sub OnShippedDateChanged() + End Sub + Partial Private Sub OnShipPostalCodeChanging(ByVal value As String) + End Sub + Partial Private Sub OnShipPostalCodeChanged() + End Sub + Partial Private Sub OnShipRegionChanging(ByVal value As String) + End Sub + Partial Private Sub OnShipRegionChanged() + End Sub + Partial Private Sub OnShipViaChanging(ByVal value As Nullable(Of Integer)) + End Sub + Partial Private Sub OnShipViaChanged() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + + Public Property Customer() As Customer + Get + If (Me._customer Is Nothing) Then + Me._customer = New EntityRef(Of Customer)(Me, "Customer", AddressOf Me.FilterCustomer) + End If + Return Me._customer.Entity + End Get + Set + Dim previous As Customer = Me.Customer + If (Object.Equals(previous, Value) = False) Then + Me.ValidateProperty("Customer", Value) + If (Not (previous) Is Nothing) Then + Me._customer.Entity = Nothing + previous.Orders.Remove(Me) + End If + If (Not (Value) Is Nothing) Then + Me.CustomerID = Value.CustomerID + Else + Me.CustomerID = CType(Nothing, String) + End If + Me._customer.Entity = Value + If (Not (Value) Is Nothing) Then + Value.Orders.Add(Me) + End If + Me.RaisePropertyChanged("Customer") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CustomerID' value. + ''' + + Public Property CustomerID() As String + Get + Return Me._customerID + End Get + Set + If (String.Equals(Me._customerID, Value) = False) Then + Me.OnCustomerIDChanging(Value) + Me.RaiseDataMemberChanging("CustomerID") + Me.ValidateProperty("CustomerID", Value) + Me._customerID = Value + Me.RaiseDataMemberChanged("CustomerID") + Me.OnCustomerIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'EmployeeID' value. + ''' + + Public Property EmployeeID() As Nullable(Of Integer) + Get + Return Me._employeeID + End Get + Set + If (Me._employeeID.Equals(Value) = False) Then + Me.OnEmployeeIDChanging(Value) + Me.RaiseDataMemberChanging("EmployeeID") + Me.ValidateProperty("EmployeeID", Value) + Me._employeeID = Value + Me.RaiseDataMemberChanged("EmployeeID") + Me.OnEmployeeIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'FormattedName' value. + ''' + + Public Property FormattedName() As String + Get + Return Me._formattedName + End Get + Set + If (String.Equals(Me._formattedName, Value) = False) Then + Me.OnFormattedNameChanging(Value) + Me.ValidateProperty("FormattedName", Value) + Me._formattedName = Value + Me.RaisePropertyChanged("FormattedName") + Me.OnFormattedNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Freight' value. + ''' + + Public Property Freight() As Nullable(Of Decimal) + Get + Return Me._freight + End Get + Set + If (Me._freight.Equals(Value) = False) Then + Me.OnFreightChanging(Value) + Me.RaiseDataMemberChanging("Freight") + Me.ValidateProperty("Freight", Value) + Me._freight = Value + Me.RaiseDataMemberChanged("Freight") + Me.OnFreightChanged() + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + + Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) + Get + If (Me._order_Details Is Nothing) Then + Me._order_Details = New EntityCollection(Of Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + End If + Return Me._order_Details + End Get + End Property + + ''' + ''' Gets or sets the 'OrderDate' value. + ''' + + Public Property OrderDate() As Nullable(Of DateTime) + Get + Return Me._orderDate + End Get + Set + If (Me._orderDate.Equals(Value) = False) Then + Me.OnOrderDateChanging(Value) + Me.RaiseDataMemberChanging("OrderDate") + Me.ValidateProperty("OrderDate", Value) + Me._orderDate = Value + Me.RaiseDataMemberChanged("OrderDate") + Me.OnOrderDateChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderID' value. + ''' + + Public Property OrderID() As Integer + Get + Return Me._orderID + End Get + Set + If ((Me._orderID = Value) _ + = False) Then + Me.OnOrderIDChanging(Value) + Me.ValidateProperty("OrderID", Value) + Me._orderID = Value + Me.RaisePropertyChanged("OrderID") + Me.OnOrderIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RequiredDate' value. + ''' + + Public Property RequiredDate() As Nullable(Of DateTime) + Get + Return Me._requiredDate + End Get + Set + If (Me._requiredDate.Equals(Value) = False) Then + Me.OnRequiredDateChanging(Value) + Me.RaiseDataMemberChanging("RequiredDate") + Me.ValidateProperty("RequiredDate", Value) + Me._requiredDate = Value + Me.RaiseDataMemberChanged("RequiredDate") + Me.OnRequiredDateChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipAddress' value. + ''' + + Public Property ShipAddress() As String + Get + Return Me._shipAddress + End Get + Set + If (String.Equals(Me._shipAddress, Value) = False) Then + Me.OnShipAddressChanging(Value) + Me.RaiseDataMemberChanging("ShipAddress") + Me.ValidateProperty("ShipAddress", Value) + Me._shipAddress = Value + Me.RaiseDataMemberChanged("ShipAddress") + Me.OnShipAddressChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipCity' value. + ''' + + Public Property ShipCity() As String + Get + Return Me._shipCity + End Get + Set + If (String.Equals(Me._shipCity, Value) = False) Then + Me.OnShipCityChanging(Value) + Me.RaiseDataMemberChanging("ShipCity") + Me.ValidateProperty("ShipCity", Value) + Me._shipCity = Value + Me.RaiseDataMemberChanged("ShipCity") + Me.OnShipCityChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipCountry' value. + ''' + + Public Property ShipCountry() As String + Get + Return Me._shipCountry + End Get + Set + If (String.Equals(Me._shipCountry, Value) = False) Then + Me.OnShipCountryChanging(Value) + Me.RaiseDataMemberChanging("ShipCountry") + Me.ValidateProperty("ShipCountry", Value) + Me._shipCountry = Value + Me.RaiseDataMemberChanged("ShipCountry") + Me.OnShipCountryChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipName' value. + ''' + + Public Property ShipName() As String + Get + Return Me._shipName + End Get + Set + If (String.Equals(Me._shipName, Value) = False) Then + Me.OnShipNameChanging(Value) + Me.RaiseDataMemberChanging("ShipName") + Me.ValidateProperty("ShipName", Value) + Me._shipName = Value + Me.RaiseDataMemberChanged("ShipName") + Me.OnShipNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShippedDate' value. + ''' + + Public Property ShippedDate() As Nullable(Of DateTime) + Get + Return Me._shippedDate + End Get + Set + If (Me._shippedDate.Equals(Value) = False) Then + Me.OnShippedDateChanging(Value) + Me.RaiseDataMemberChanging("ShippedDate") + Me.ValidateProperty("ShippedDate", Value) + Me._shippedDate = Value + Me.RaiseDataMemberChanged("ShippedDate") + Me.OnShippedDateChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipPostalCode' value. + ''' + + Public Property ShipPostalCode() As String + Get + Return Me._shipPostalCode + End Get + Set + If (String.Equals(Me._shipPostalCode, Value) = False) Then + Me.OnShipPostalCodeChanging(Value) + Me.RaiseDataMemberChanging("ShipPostalCode") + Me.ValidateProperty("ShipPostalCode", Value) + Me._shipPostalCode = Value + Me.RaiseDataMemberChanged("ShipPostalCode") + Me.OnShipPostalCodeChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipRegion' value. + ''' + + Public Property ShipRegion() As String + Get + Return Me._shipRegion + End Get + Set + If (String.Equals(Me._shipRegion, Value) = False) Then + Me.OnShipRegionChanging(Value) + Me.RaiseDataMemberChanging("ShipRegion") + Me.ValidateProperty("ShipRegion", Value) + Me._shipRegion = Value + Me.RaiseDataMemberChanged("ShipRegion") + Me.OnShipRegionChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipVia' value. + ''' + + Public Property ShipVia() As Nullable(Of Integer) + Get + Return Me._shipVia + End Get + Set + If (Me._shipVia.Equals(Value) = False) Then + Me.OnShipViaChanging(Value) + Me.RaiseDataMemberChanging("ShipVia") + Me.ValidateProperty("ShipVia", Value) + Me._shipVia = Value + Me.RaiseDataMemberChanged("ShipVia") + Me.OnShipViaChanged() + End If + End Set + End Property + + Private Function FilterCustomer(ByVal entity As Customer) As Boolean + Return Object.Equals(entity.CustomerID, Me.CustomerID) + End Function + + Private Sub AttachOrder_Details(ByVal entity As Order_Detail) + entity.Order = Me + End Sub + + Private Sub DetachOrder_Details(ByVal entity As Order_Detail) + entity.Order = Nothing + End Sub + + Private Function FilterOrder_Details(ByVal entity As Order_Detail) As Boolean + Return Object.Equals(entity.OrderID, Me.OrderID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._orderID + End Function + End Class + + ''' + ''' The 'Order_Detail' entity class. + ''' + + Partial Public NotInheritable Class Order_Detail + Inherits Entity + + Private _discount As Single + + Private _order As EntityRef(Of Order) + + Private _orderID As Integer + + Private _product As EntityRef(Of Product) + + Private _productID As Integer + + Private _quantity As Short + + Private _unitPrice As Decimal + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnDiscountChanging(ByVal value As Single) + End Sub + Partial Private Sub OnDiscountChanged() + End Sub + Partial Private Sub OnOrderIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnOrderIDChanged() + End Sub + Partial Private Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnProductIDChanged() + End Sub + Partial Private Sub OnQuantityChanging(ByVal value As Short) + End Sub + Partial Private Sub OnQuantityChanged() + End Sub + Partial Private Sub OnUnitPriceChanging(ByVal value As Decimal) + End Sub + Partial Private Sub OnUnitPriceChanged() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the 'Discount' value. + ''' + + Public Property Discount() As Single + Get + Return Me._discount + End Get + Set + If ((Me._discount = Value) _ + = False) Then + Me.OnDiscountChanging(Value) + Me.RaiseDataMemberChanging("Discount") + Me.ValidateProperty("Discount", Value) + Me._discount = Value + Me.RaiseDataMemberChanged("Discount") + Me.OnDiscountChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + + Public Property Order() As Order + Get + If (Me._order Is Nothing) Then + Me._order = New EntityRef(Of Order)(Me, "Order", AddressOf Me.FilterOrder) + End If + Return Me._order.Entity + End Get + Set + Dim previous As Order = Me.Order + If (Object.Equals(previous, Value) = False) Then + Me.ValidateProperty("Order", Value) + If (Not (previous) Is Nothing) Then + Me._order.Entity = Nothing + previous.Order_Details.Remove(Me) + End If + If (Not (Value) Is Nothing) Then + Me.OrderID = Value.OrderID + Else + Me.OrderID = CType(Nothing, Integer) + End If + Me._order.Entity = Value + If (Not (Value) Is Nothing) Then + Value.Order_Details.Add(Me) + End If + Me.RaisePropertyChanged("Order") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderID' value. + ''' + + Public Property OrderID() As Integer + Get + Return Me._orderID + End Get + Set + If ((Me._orderID = Value) _ + = False) Then + Me.OnOrderIDChanging(Value) + Me.RaiseDataMemberChanging("OrderID") + Me.ValidateProperty("OrderID", Value) + Me._orderID = Value + Me.RaiseDataMemberChanged("OrderID") + Me.OnOrderIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + + Public Property Product() As Product + Get + If (Me._product Is Nothing) Then + Me._product = New EntityRef(Of Product)(Me, "Product", AddressOf Me.FilterProduct) + End If + Return Me._product.Entity + End Get + Set + Dim previous As Product = Me.Product + If (Object.Equals(previous, Value) = False) Then + Me.ValidateProperty("Product", Value) + If (Not (previous) Is Nothing) Then + Me._product.Entity = Nothing + previous.Order_Details.Remove(Me) + End If + If (Not (Value) Is Nothing) Then + Me.ProductID = Value.ProductID + Else + Me.ProductID = CType(Nothing, Integer) + End If + Me._product.Entity = Value + If (Not (Value) Is Nothing) Then + Value.Order_Details.Add(Me) + End If + Me.RaisePropertyChanged("Product") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = Value) _ + = False) Then + Me.OnProductIDChanging(Value) + Me.RaiseDataMemberChanging("ProductID") + Me.ValidateProperty("ProductID", Value) + Me._productID = Value + Me.RaiseDataMemberChanged("ProductID") + Me.OnProductIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Quantity' value. + ''' + + Public Property Quantity() As Short + Get + Return Me._quantity + End Get + Set + If ((Me._quantity = Value) _ + = False) Then + Me.OnQuantityChanging(Value) + Me.RaiseDataMemberChanging("Quantity") + Me.ValidateProperty("Quantity", Value) + Me._quantity = Value + Me.RaiseDataMemberChanged("Quantity") + Me.OnQuantityChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitPrice' value. + ''' + + Public Property UnitPrice() As Decimal + Get + Return Me._unitPrice + End Get + Set + If ((Me._unitPrice = Value) _ + = False) Then + Me.OnUnitPriceChanging(Value) + Me.RaiseDataMemberChanging("UnitPrice") + Me.ValidateProperty("UnitPrice", Value) + Me._unitPrice = Value + Me.RaiseDataMemberChanged("UnitPrice") + Me.OnUnitPriceChanged() + End If + End Set + End Property + + Private Function FilterOrder(ByVal entity As Order) As Boolean + Return Object.Equals(entity.OrderID, Me.OrderID) + End Function + + Private Function FilterProduct(ByVal entity As Product) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return EntityKey.Create(Me._orderID, Me._productID) + End Function + End Class + + ''' + ''' The 'Product' entity class. + ''' + + Partial Public NotInheritable Class Product + Inherits Entity + + Private _category As EntityRef(Of Category) + + Private _categoryID As Nullable(Of Integer) + + Private _categoryName As String + + Private _discontinued As Boolean + + Private _order_Details As EntityCollection(Of Order_Detail) + + Private _productID As Integer + + Private _productName As String + + Private _quantityPerUnit As String + + Private _reorderLevel As Nullable(Of Short) + + Private _resolveMethod As String + + Private _supplierID As Nullable(Of Integer) + + Private _supplierName As String + + Private _unitPrice As Nullable(Of Decimal) + + Private _unitsInStock As Nullable(Of Short) + + Private _unitsOnOrder As Nullable(Of Short) + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnCategoryIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Partial Private Sub OnCategoryIDChanged() + End Sub + Partial Private Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnCategoryNameChanged() + End Sub + Partial Private Sub OnDiscontinuedChanging(ByVal value As Boolean) + End Sub + Partial Private Sub OnDiscontinuedChanged() + End Sub + Partial Private Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnProductIDChanged() + End Sub + Partial Private Sub OnProductNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnProductNameChanged() + End Sub + Partial Private Sub OnQuantityPerUnitChanging(ByVal value As String) + End Sub + Partial Private Sub OnQuantityPerUnitChanged() + End Sub + Partial Private Sub OnReorderLevelChanging(ByVal value As Nullable(Of Short)) + End Sub + Partial Private Sub OnReorderLevelChanged() + End Sub + Partial Private Sub OnResolveMethodChanging(ByVal value As String) + End Sub + Partial Private Sub OnResolveMethodChanged() + End Sub + Partial Private Sub OnSupplierIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Partial Private Sub OnSupplierIDChanged() + End Sub + Partial Private Sub OnSupplierNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnSupplierNameChanged() + End Sub + Partial Private Sub OnUnitPriceChanging(ByVal value As Nullable(Of Decimal)) + End Sub + Partial Private Sub OnUnitPriceChanged() + End Sub + Partial Private Sub OnUnitsInStockChanging(ByVal value As Nullable(Of Short)) + End Sub + Partial Private Sub OnUnitsInStockChanged() + End Sub + Partial Private Sub OnUnitsOnOrderChanging(ByVal value As Nullable(Of Short)) + End Sub + Partial Private Sub OnUnitsOnOrderChanged() + End Sub + Partial Private Sub OnDiscontinueProductInvoking() + End Sub + Partial Private Sub OnDiscontinueProductInvoked() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + + Public Property Category() As Category + Get + If (Me._category Is Nothing) Then + Me._category = New EntityRef(Of Category)(Me, "Category", AddressOf Me.FilterCategory) + End If + Return Me._category.Entity + End Get + Set + Dim previous As Category = Me.Category + If (Object.Equals(previous, Value) = False) Then + Me.ValidateProperty("Category", Value) + If (Not (previous) Is Nothing) Then + Me._category.Entity = Nothing + previous.Products.Remove(Me) + End If + If (Not (Value) Is Nothing) Then + Me.CategoryID = Value.CategoryID + Else + Me.CategoryID = CType(Nothing, Nullable(Of Integer)) + End If + Me._category.Entity = Value + If (Not (Value) Is Nothing) Then + Value.Products.Add(Me) + End If + Me.RaisePropertyChanged("Category") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryID' value. + ''' + + Public Property CategoryID() As Nullable(Of Integer) + Get + Return Me._categoryID + End Get + Set + If (Me._categoryID.Equals(Value) = False) Then + Me.OnCategoryIDChanging(Value) + Me.RaiseDataMemberChanging("CategoryID") + Me.ValidateProperty("CategoryID", Value) + Me._categoryID = Value + Me.RaiseDataMemberChanged("CategoryID") + Me.OnCategoryIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, Value) = False) Then + Me.OnCategoryNameChanging(Value) + Me.ValidateProperty("CategoryName", Value) + Me._categoryName = Value + Me.RaisePropertyChanged("CategoryName") + Me.OnCategoryNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Discontinued' value. + ''' + + Public Property Discontinued() As Boolean + Get + Return Me._discontinued + End Get + Set + If ((Me._discontinued = Value) _ + = False) Then + Me.OnDiscontinuedChanging(Value) + Me.RaiseDataMemberChanging("Discontinued") + Me.ValidateProperty("Discontinued", Value) + Me._discontinued = Value + Me.RaiseDataMemberChanged("Discontinued") + Me.OnDiscontinuedChanged() + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + + Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) + Get + If (Me._order_Details Is Nothing) Then + Me._order_Details = New EntityCollection(Of Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + End If + Return Me._order_Details + End Get + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = Value) _ + = False) Then + Me.OnProductIDChanging(Value) + Me.ValidateProperty("ProductID", Value) + Me._productID = Value + Me.RaisePropertyChanged("ProductID") + Me.OnProductIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductName' value. + ''' + + Public Property ProductName() As String + Get + Return Me._productName + End Get + Set + If (String.Equals(Me._productName, Value) = False) Then + Me.OnProductNameChanging(Value) + Me.RaiseDataMemberChanging("ProductName") + Me.ValidateProperty("ProductName", Value) + Me._productName = Value + Me.RaiseDataMemberChanged("ProductName") + Me.OnProductNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'QuantityPerUnit' value. + ''' + + Public Property QuantityPerUnit() As String + Get + Return Me._quantityPerUnit + End Get + Set + If (String.Equals(Me._quantityPerUnit, Value) = False) Then + Me.OnQuantityPerUnitChanging(Value) + Me.RaiseDataMemberChanging("QuantityPerUnit") + Me.ValidateProperty("QuantityPerUnit", Value) + Me._quantityPerUnit = Value + Me.RaiseDataMemberChanged("QuantityPerUnit") + Me.OnQuantityPerUnitChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ReorderLevel' value. + ''' + + Public Property ReorderLevel() As Nullable(Of Short) + Get + Return Me._reorderLevel + End Get + Set + If (Me._reorderLevel.Equals(Value) = False) Then + Me.OnReorderLevelChanging(Value) + Me.RaiseDataMemberChanging("ReorderLevel") + Me.ValidateProperty("ReorderLevel", Value) + Me._reorderLevel = Value + Me.RaiseDataMemberChanged("ReorderLevel") + Me.OnReorderLevelChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ResolveMethod' value. + ''' + + Public Property ResolveMethod() As String + Get + Return Me._resolveMethod + End Get + Set + If (String.Equals(Me._resolveMethod, Value) = False) Then + Me.OnResolveMethodChanging(Value) + Me.RaiseDataMemberChanging("ResolveMethod") + Me.ValidateProperty("ResolveMethod", Value) + Me._resolveMethod = Value + Me.RaiseDataMemberChanged("ResolveMethod") + Me.OnResolveMethodChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierID' value. + ''' + + Public Property SupplierID() As Nullable(Of Integer) + Get + Return Me._supplierID + End Get + Set + If (Me._supplierID.Equals(Value) = False) Then + Me.OnSupplierIDChanging(Value) + Me.RaiseDataMemberChanging("SupplierID") + Me.ValidateProperty("SupplierID", Value) + Me._supplierID = Value + Me.RaiseDataMemberChanged("SupplierID") + Me.OnSupplierIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierName' value. + ''' + + Public Property SupplierName() As String + Get + Return Me._supplierName + End Get + Set + If (String.Equals(Me._supplierName, Value) = False) Then + Me.OnSupplierNameChanging(Value) + Me.ValidateProperty("SupplierName", Value) + Me._supplierName = Value + Me.RaisePropertyChanged("SupplierName") + Me.OnSupplierNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitPrice' value. + ''' + + Public Property UnitPrice() As Nullable(Of Decimal) + Get + Return Me._unitPrice + End Get + Set + If (Me._unitPrice.Equals(Value) = False) Then + Me.OnUnitPriceChanging(Value) + Me.RaiseDataMemberChanging("UnitPrice") + Me.ValidateProperty("UnitPrice", Value) + Me._unitPrice = Value + Me.RaiseDataMemberChanged("UnitPrice") + Me.OnUnitPriceChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitsInStock' value. + ''' + + Public Property UnitsInStock() As Nullable(Of Short) + Get + Return Me._unitsInStock + End Get + Set + If (Me._unitsInStock.Equals(Value) = False) Then + Me.OnUnitsInStockChanging(Value) + Me.RaiseDataMemberChanging("UnitsInStock") + Me.ValidateProperty("UnitsInStock", Value) + Me._unitsInStock = Value + Me.RaiseDataMemberChanged("UnitsInStock") + Me.OnUnitsInStockChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitsOnOrder' value. + ''' + + Public Property UnitsOnOrder() As Nullable(Of Short) + Get + Return Me._unitsOnOrder + End Get + Set + If (Me._unitsOnOrder.Equals(Value) = False) Then + Me.OnUnitsOnOrderChanging(Value) + Me.RaiseDataMemberChanging("UnitsOnOrder") + Me.ValidateProperty("UnitsOnOrder", Value) + Me._unitsOnOrder = Value + Me.RaiseDataMemberChanged("UnitsOnOrder") + Me.OnUnitsOnOrderChanged() + End If + End Set + End Property + + ''' + ''' Gets a value indicating whether the 'DiscontinueProduct' action has been invoked on this entity. + ''' + + Public ReadOnly Property IsDiscontinueProductInvoked() As Boolean + Get + Return MyBase.IsActionInvoked("DiscontinueProduct") + End Get + End Property + + ''' + ''' Gets a value indicating whether the 'DiscontinueProduct' method can be invoked on this entity. + ''' + + Public ReadOnly Property CanDiscontinueProduct() As Boolean + Get + Return MyBase.CanInvokeAction("DiscontinueProduct") + End Get + End Property + + Private Function FilterCategory(ByVal entity As Category) As Boolean + Return Object.Equals(entity.CategoryID, Me.CategoryID) + End Function + + Private Sub AttachOrder_Details(ByVal entity As Order_Detail) + entity.Product = Me + End Sub + + Private Sub DetachOrder_Details(ByVal entity As Order_Detail) + entity.Product = Nothing + End Sub + + Private Function FilterOrder_Details(ByVal entity As Order_Detail) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._productID + End Function + + ''' + ''' Invokes the 'DiscontinueProduct' action on this entity. + ''' + + Public Sub DiscontinueProduct() + Me.OnDiscontinueProductInvoking() + MyBase.InvokeAction("DiscontinueProduct") + Me.OnDiscontinueProductInvoked() + End Sub + End Class + + ''' + ''' The 'ProductInfo' entity class. + ''' + + Partial Public NotInheritable Class ProductInfo + Inherits Entity + + Private _categoryName As String + + Private _productID As Integer + + Private _productName As String + + Private _supplierName As String + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnCategoryNameChanged() + End Sub + Partial Private Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnProductIDChanged() + End Sub + Partial Private Sub OnProductNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnProductNameChanged() + End Sub + Partial Private Sub OnSupplierNameChanging(ByVal value As String) + End Sub + Partial Private Sub OnSupplierNameChanged() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, Value) = False) Then + Me.OnCategoryNameChanging(Value) + Me.ValidateProperty("CategoryName", Value) + Me._categoryName = Value + Me.RaisePropertyChanged("CategoryName") + Me.OnCategoryNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = Value) _ + = False) Then + Me.OnProductIDChanging(Value) + Me.ValidateProperty("ProductID", Value) + Me._productID = Value + Me.RaisePropertyChanged("ProductID") + Me.OnProductIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductName' value. + ''' + + Public Property ProductName() As String + Get + Return Me._productName + End Get + Set + If (String.Equals(Me._productName, Value) = False) Then + Me.OnProductNameChanging(Value) + Me.RaiseDataMemberChanging("ProductName") + Me.ValidateProperty("ProductName", Value) + Me._productName = Value + Me.RaiseDataMemberChanged("ProductName") + Me.OnProductNameChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierName' value. + ''' + + Public Property SupplierName() As String + Get + Return Me._supplierName + End Get + Set + If (String.Equals(Me._supplierName, Value) = False) Then + Me.OnSupplierNameChanging(Value) + Me.ValidateProperty("SupplierName", Value) + Me._supplierName = Value + Me.RaisePropertyChanged("SupplierName") + Me.OnSupplierNameChanged() + End If + End Set + End Property + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._productID + End Function + End Class + + ''' + ''' The 'Region' entity class. + ''' + + Partial Public NotInheritable Class Region + Inherits Entity + + Private _regionDescription As String + + Private _regionID As Integer + + Private _territories As EntityCollection(Of Territory) + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnRegionDescriptionChanging(ByVal value As String) + End Sub + Partial Private Sub OnRegionDescriptionChanged() + End Sub + Partial Private Sub OnRegionIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnRegionIDChanged() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the 'RegionDescription' value. + ''' + + Public Property RegionDescription() As String + Get + Return Me._regionDescription + End Get + Set + If (String.Equals(Me._regionDescription, Value) = False) Then + Me.OnRegionDescriptionChanging(Value) + Me.RaiseDataMemberChanging("RegionDescription") + Me.ValidateProperty("RegionDescription", Value) + Me._regionDescription = Value + Me.RaiseDataMemberChanged("RegionDescription") + Me.OnRegionDescriptionChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RegionID' value. + ''' + + Public Property RegionID() As Integer + Get + Return Me._regionID + End Get + Set + If ((Me._regionID = Value) _ + = False) Then + Me.OnRegionIDChanging(Value) + Me.ValidateProperty("RegionID", Value) + Me._regionID = Value + Me.RaisePropertyChanged("RegionID") + Me.OnRegionIDChanged() + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + + Public ReadOnly Property Territories() As EntityCollection(Of Territory) + Get + If (Me._territories Is Nothing) Then + Me._territories = New EntityCollection(Of Territory)(Me, "Territories", AddressOf Me.FilterTerritories, AddressOf Me.AttachTerritories, AddressOf Me.DetachTerritories) + End If + Return Me._territories + End Get + End Property + + Private Sub AttachTerritories(ByVal entity As Territory) + entity.Region = Me + End Sub + + Private Sub DetachTerritories(ByVal entity As Territory) + entity.Region = Nothing + End Sub + + Private Function FilterTerritories(ByVal entity As Territory) As Boolean + Return Object.Equals(entity.RegionID, Me.RegionID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._regionID + End Function + End Class + + ''' + ''' The 'Territory' entity class. + ''' + + Partial Public NotInheritable Class Territory + Inherits Entity + + Private _region As EntityRef(Of Region) + + Private _regionID As Integer + + Private _territoryDescription As String + + Private _territoryID As String + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + Partial Private Sub OnRegionIDChanging(ByVal value As Integer) + End Sub + Partial Private Sub OnRegionIDChanged() + End Sub + Partial Private Sub OnTerritoryDescriptionChanging(ByVal value As String) + End Sub + Partial Private Sub OnTerritoryDescriptionChanged() + End Sub + Partial Private Sub OnTerritoryIDChanging(ByVal value As String) + End Sub + Partial Private Sub OnTerritoryIDChanged() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated() + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + + Public Property Region() As Region + Get + If (Me._region Is Nothing) Then + Me._region = New EntityRef(Of Region)(Me, "Region", AddressOf Me.FilterRegion) + End If + Return Me._region.Entity + End Get + Set + Dim previous As Region = Me.Region + If (Object.Equals(previous, Value) = False) Then + Me.ValidateProperty("Region", Value) + If (Not (previous) Is Nothing) Then + Me._region.Entity = Nothing + previous.Territories.Remove(Me) + End If + If (Not (Value) Is Nothing) Then + Me.RegionID = Value.RegionID + Else + Me.RegionID = CType(Nothing, Integer) + End If + Me._region.Entity = Value + If (Not (Value) Is Nothing) Then + Value.Territories.Add(Me) + End If + Me.RaisePropertyChanged("Region") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RegionID' value. + ''' + + Public Property RegionID() As Integer + Get + Return Me._regionID + End Get + Set + If ((Me._regionID = Value) _ + = False) Then + Me.OnRegionIDChanging(Value) + Me.RaiseDataMemberChanging("RegionID") + Me.ValidateProperty("RegionID", Value) + Me._regionID = Value + Me.RaiseDataMemberChanged("RegionID") + Me.OnRegionIDChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TerritoryDescription' value. + ''' + + Public Property TerritoryDescription() As String + Get + Return Me._territoryDescription + End Get + Set + If (String.Equals(Me._territoryDescription, Value) = False) Then + Me.OnTerritoryDescriptionChanging(Value) + Me.RaiseDataMemberChanging("TerritoryDescription") + Me.ValidateProperty("TerritoryDescription", Value) + Me._territoryDescription = Value + Me.RaiseDataMemberChanged("TerritoryDescription") + Me.OnTerritoryDescriptionChanged() + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TerritoryID' value. + ''' + + Public Property TerritoryID() As String + Get + Return Me._territoryID + End Get + Set + If (String.Equals(Me._territoryID, Value) = False) Then + Me.OnTerritoryIDChanging(Value) + Me.ValidateProperty("TerritoryID", Value) + Me._territoryID = Value + Me.RaisePropertyChanged("TerritoryID") + Me.OnTerritoryIDChanged() + End If + End Set + End Property + + Private Function FilterRegion(ByVal entity As Region) As Boolean + Return Object.Equals(entity.RegionID, Me.RegionID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._territoryID + End Function + End Class +End Namespace + +Namespace TestDomainServices.EFCore + + ''' + ''' The DomainContext corresponding to the 'Northwind' DomainService. + ''' + Partial Public NotInheritable Class Northwind + Inherits DomainContext + +#Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Partial Private Sub OnCreated() + End Sub + +#End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + Me.New(New Uri("TestDomainServices-EFCore-Northwind.svc", UriKind.Relative)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified service URI. + ''' + ''' The Northwind service URI. + Public Sub New(ByVal serviceUri As Uri) + Me.New(DomainContext.CreateDomainClient(GetType(INorthwindContract), serviceUri, False)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified . + ''' + ''' The DomainClient instance to use for this DomainContext. + Public Sub New(ByVal domainClient As DomainClient) + MyBase.New(domainClient) + Me.OnCreated() + End Sub + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Categories() As EntitySet(Of Category) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Category) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Customers() As EntitySet(Of Customer) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Customer) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Order_Details() As EntitySet(Of Order_Detail) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Order_Detail) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Orders() As EntitySet(Of Order) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Order) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Products() As EntitySet(Of Product) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Product) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property ProductInfos() As EntitySet(Of ProductInfo) + Get + Return MyBase.EntityContainer.GetEntitySet(Of ProductInfo) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Regions() As EntitySet(Of Region) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Region) + End Get + End Property + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetCategoriesQuery() As EntityQuery(Of Category) + Me.ValidateMethod("GetCategoriesQuery", Nothing) + Return MyBase.CreateQuery(Of Category)("GetCategories", Nothing, False, True) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetCustomersQuery() As EntityQuery(Of Customer) + Me.ValidateMethod("GetCustomersQuery", Nothing) + Return MyBase.CreateQuery(Of Customer)("GetCustomers", Nothing, False, True) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetOrderDetailsQuery() As EntityQuery(Of Order_Detail) + Me.ValidateMethod("GetOrderDetailsQuery", Nothing) + Return MyBase.CreateQuery(Of Order_Detail)("GetOrderDetails", Nothing, False, True) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetOrdersQuery() As EntityQuery(Of Order) + Me.ValidateMethod("GetOrdersQuery", Nothing) + Return MyBase.CreateQuery(Of Order)("GetOrders", Nothing, False, True) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductById' query. + ''' + ''' The value for the 'id' parameter of the query. + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductByIdQuery(ByVal id As Integer) As EntityQuery(Of Product) + Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() + parameters.Add("id", id) + Me.ValidateMethod("GetProductByIdQuery", parameters) + Return MyBase.CreateQuery(Of Product)("GetProductById", parameters, False, False) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductInfosQuery() As EntityQuery(Of ProductInfo) + Me.ValidateMethod("GetProductInfosQuery", Nothing) + Return MyBase.CreateQuery(Of ProductInfo)("GetProductInfos", Nothing, False, True) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductsQuery() As EntityQuery(Of Product) + Me.ValidateMethod("GetProductsQuery", Nothing) + Return MyBase.CreateQuery(Of Product)("GetProducts", Nothing, False, True) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegionById' query. + ''' + ''' The value for the 'id' parameter of the query. + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetRegionByIdQuery(ByVal id As Integer) As EntityQuery(Of Region) + Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() + parameters.Add("id", id) + Me.ValidateMethod("GetRegionByIdQuery", parameters) + Return MyBase.CreateQuery(Of Region)("GetRegionById", parameters, False, False) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetRegionsQuery() As EntityQuery(Of Region) + Me.ValidateMethod("GetRegionsQuery", Nothing) + Return MyBase.CreateQuery(Of Region)("GetRegions", Nothing, False, True) + End Function + + ''' + ''' Invokes the 'DiscontinueProduct' method of the specified entity. + ''' + ''' The entity instance. + Public Sub DiscontinueProduct(ByVal product As Product) + product.DiscontinueProduct + End Sub + + ''' + ''' Creates a new EntityContainer for this DomainContext's EntitySets. + ''' + ''' A new container instance. + Protected Overrides Function CreateEntityContainer() As EntityContainer + Return New NorthwindEntityContainer() + End Function + + ''' + ''' Service contract for the 'Northwind' DomainService. + ''' + + Public Interface INorthwindContract + + ''' + ''' Asynchronously invokes the 'GetCategories' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetCategories(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetCategories'. + ''' + ''' The IAsyncResult returned from 'BeginGetCategories'. + ''' The 'QueryResult' returned from the 'GetCategories' operation. + Function EndGetCategories(ByVal result As IAsyncResult) As QueryResult(Of Category) + + ''' + ''' Asynchronously invokes the 'GetCustomers' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetCustomers(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetCustomers'. + ''' + ''' The IAsyncResult returned from 'BeginGetCustomers'. + ''' The 'QueryResult' returned from the 'GetCustomers' operation. + Function EndGetCustomers(ByVal result As IAsyncResult) As QueryResult(Of Customer) + + ''' + ''' Asynchronously invokes the 'GetOrderDetails' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetOrderDetails(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetOrderDetails'. + ''' + ''' The IAsyncResult returned from 'BeginGetOrderDetails'. + ''' The 'QueryResult' returned from the 'GetOrderDetails' operation. + Function EndGetOrderDetails(ByVal result As IAsyncResult) As QueryResult(Of Order_Detail) + + ''' + ''' Asynchronously invokes the 'GetOrders' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetOrders(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetOrders'. + ''' + ''' The IAsyncResult returned from 'BeginGetOrders'. + ''' The 'QueryResult' returned from the 'GetOrders' operation. + Function EndGetOrders(ByVal result As IAsyncResult) As QueryResult(Of Order) + + ''' + ''' Asynchronously invokes the 'GetProductById' operation. + ''' + ''' The value for the 'id' parameter of this action. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetProductById(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductById'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductById'. + ''' The 'QueryResult' returned from the 'GetProductById' operation. + Function EndGetProductById(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetProductInfos' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetProductInfos(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductInfos'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductInfos'. + ''' The 'QueryResult' returned from the 'GetProductInfos' operation. + Function EndGetProductInfos(ByVal result As IAsyncResult) As QueryResult(Of ProductInfo) + + ''' + ''' Asynchronously invokes the 'GetProducts' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetProducts(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProducts'. + ''' + ''' The IAsyncResult returned from 'BeginGetProducts'. + ''' The 'QueryResult' returned from the 'GetProducts' operation. + Function EndGetProducts(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetRegionById' operation. + ''' + ''' The value for the 'id' parameter of this action. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetRegionById(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetRegionById'. + ''' + ''' The IAsyncResult returned from 'BeginGetRegionById'. + ''' The 'QueryResult' returned from the 'GetRegionById' operation. + Function EndGetRegionById(ByVal result As IAsyncResult) As QueryResult(Of Region) + + ''' + ''' Asynchronously invokes the 'GetRegions' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginGetRegions(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetRegions'. + ''' + ''' The IAsyncResult returned from 'BeginGetRegions'. + ''' The 'QueryResult' returned from the 'GetRegions' operation. + Function EndGetRegions(ByVal result As IAsyncResult) As QueryResult(Of Region) + + ''' + ''' Asynchronously invokes the 'SubmitChanges' operation. + ''' + ''' The change-set to submit. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + + Function BeginSubmitChanges(ByVal changeSet As IEnumerable(Of ChangeSetEntry), ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginSubmitChanges'. + ''' + ''' The IAsyncResult returned from 'BeginSubmitChanges'. + ''' The collection of change-set entry elements returned from 'SubmitChanges'. + Function EndSubmitChanges(ByVal result As IAsyncResult) As IEnumerable(Of ChangeSetEntry) + End Interface + + Friend NotInheritable Class NorthwindEntityContainer + Inherits EntityContainer + + Public Sub New() + MyBase.New + Me.CreateEntitySet(Of Category)(EntitySetOperations.All) + Me.CreateEntitySet(Of Customer)(EntitySetOperations.All) + Me.CreateEntitySet(Of Order)(EntitySetOperations.All) + Me.CreateEntitySet(Of Order_Detail)(EntitySetOperations.All) + Me.CreateEntitySet(Of Product)(EntitySetOperations.All) + Me.CreateEntitySet(Of ProductInfo)(EntitySetOperations.Edit) + Me.CreateEntitySet(Of Region)(EntitySetOperations.All) + Me.CreateEntitySet(Of Territory)(EntitySetOperations.All) + End Sub + End Class + End Class +End Namespace From 464e2ccb66aaabd6e30c782f36e7e43e5d3637e3 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Fri, 18 Feb 2022 12:19:12 +0100 Subject: [PATCH 36/99] Attempt at finding foreign key members in TypeDescriptor --- ...eDescriptor.cs => EFCoreTypeDescriptor.cs} | 64 ++++++++++++------- ...sDomainServiceEFCoreDescriptionProvider.cs | 2 +- .../Test/DomainServiceDescriptionTest.cs | 2 +- ...Services.Common.DomainServices.Test.csproj | 9 +++ 4 files changed, 52 insertions(+), 25 deletions(-) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesEFCoreTypeDescriptor.cs => EFCoreTypeDescriptor.cs} (81%) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs similarity index 81% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs index 199c15f32..3c37f2fa3 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs @@ -14,20 +14,21 @@ namespace OpenRiaServices.EntityFrameworkCore /// /// CustomTypeDescriptor for LINQ To Entities /// - internal class LinqToEntitiesEFCoreTypeDescriptor : TypeDescriptorBase + internal class EFCoreTypeDescriptor : TypeDescriptorBase { private readonly LinqToEntitiesEFCoreTypeDescriptionContext _typeDescriptionContext; private readonly IEntityType _entityType; private readonly IProperty _timestampProperty; private readonly bool _keyIsEditable; + private Dictionary _foreignKeyMembers; // TODO: change to List / HashSet - public LinqToEntitiesEFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescriptionContext, IEntityType entityType, ICustomTypeDescriptor parent) + public EFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescriptionContext, IEntityType entityType, ICustomTypeDescriptor parent) : base(parent) { this._typeDescriptionContext = typeDescriptionContext; this._entityType = entityType; - var timestampMembers = entityType.GetProperties().Where(p => p.IsConcurrencyToken && p.ValueGenerated == ValueGenerated.OnAddOrUpdate).ToArray(); + var timestampMembers = entityType.GetProperties().Where(p => IsTimestampProperty(p)).ToArray(); if (timestampMembers.Length == 1) { this._timestampProperty = timestampMembers[0]; @@ -37,19 +38,36 @@ public LinqToEntitiesEFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionCon { // if any FK member of any association is also part of the primary key, then the key cannot be marked // Editable(false) - var fk = entityType.GetNavigations().SelectMany(n => n.ForeignKey.Properties).ToHashSet(); + _foreignKeyMembers = entityType.GetNavigations() + .Where(n => n.IsDependentToPrincipal()) + .SelectMany(n => n.ForeignKey.Properties) + .ToDictionary(x => x.Name); //this._foreignKeyMembers - //foreach (EdmProperty foreignKeyMember in this._foreignKeyMembers) - //{ - // if (entityType.KeyMembers.Contains(foreignKeyMember)) - // { - // this._keyIsEditable = true; - // break; - // } - //} + + foreach(var key in entityType.GetKeys()) + { + foreach (var keyMember in key.Properties) + { + if (_foreignKeyMembers.ContainsKey(keyMember.Name)) + { + this._keyIsEditable = true; + break; + } + } + } } } + /// + /// Check if a property is a "Timestamp" property (rowversion or similar) + /// + /// + /// + private static bool IsTimestampProperty(IProperty p) + { + return p.IsConcurrencyToken && p.ValueGenerated == ValueGenerated.OnAddOrUpdate; + } + /// /// Gets the metadata context /// @@ -171,16 +189,16 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor // Add RTO to this member if required. If this type has a timestamp // member that member should be the ONLY member we apply RTO to. // Dont apply RTO if it is an association member. - //bool isForeignKeyMember = this._foreignKeyMembers != null && this._foreignKeyMembers.Contains(member); - //if ((this._timestampProperty == null || this._timestampProperty == property) && - // (inferRoundtripOriginalAttribute || isForeignKeyMember) && - // pd.Attributes[typeof(AssociationAttribute)] == null) - //{ - // if (pd.Attributes[typeof(RoundtripOriginalAttribute)] == null) - // { - // attributes.Add(new RoundtripOriginalAttribute()); - // } - //} + bool isForeignKeyMember = this._foreignKeyMembers != null && this._foreignKeyMembers.ContainsKey(property.Name); + if ((this._timestampProperty == null || this._timestampProperty == property) && + (inferRoundtripOriginalAttribute || isForeignKeyMember) && + pd.Attributes[typeof(AssociationAttribute)] == null) + { + if (pd.Attributes[typeof(RoundtripOriginalAttribute)] == null) + { + attributes.Add(new RoundtripOriginalAttribute()); + } + } } // Add the Editable attribute if required @@ -224,7 +242,7 @@ internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) return true; } - + return false; } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs index 0cff6904f..5444db8e7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs @@ -50,7 +50,7 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom { // TODO: ... // only add an LTE TypeDescriptor if the type is an EF Entity or ComplexType - td = new LinqToEntitiesEFCoreTypeDescriptor(this._typeDescriptionContext, entityType, parent); + td = new EFCoreTypeDescriptor(this._typeDescriptionContext, entityType, parent); } else { diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index b927a2a96..2283a0fee 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -360,7 +360,7 @@ public void EFCoreTypeDescriptor_ExcludedEntityMembers() { // TODO: Not applicable to EF CORE so might be removed PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(EFCorePocoEntity_IEntityChangeTracker))["EntityState"]; - Assert.IsTrue(LinqToEntitiesEFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); + Assert.IsTrue(EFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index 310b044a4..855803890 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -38,6 +38,12 @@ Always + + Always + + + Always + Always @@ -580,6 +586,9 @@ + + + TextTemplatingFileGenerator From c72bd7a31a74ea3104c774abaa8f92e265911d33 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Fri, 18 Feb 2022 16:17:24 +0100 Subject: [PATCH 37/99] Fix AttachAsModifiedInternal --- .../Test/Client.Test/Data/UpdateTests.cs | 2 +- .../Framework/DbDomainServiceEFCore.cs | 2 +- .../Framework/ObjectContextUtilitiesEFCore.cs | 40 ++++++++++--------- .../Northwind/EFCore_Northwind.cs | 27 +++++++++++++ 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs index 840127a86..2542c1c4c 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs @@ -1939,7 +1939,7 @@ public void SimpleUpdateDeleteConflict() this.EnqueueCompletion(() => so2); EnqueueCallback(delegate { - Assert.AreEqual(Resource.DomainContext_SubmitOperationFailed_Conflicts, so2.Error.Message); + Assert.AreEqual(Resource.DomainContext_SubmitOperationFailed_Conflicts, so2.Error?.Message); Entity[] entitiesInConflict = so2.EntitiesInError.ToArray(); Assert.AreEqual(1, so2.ChangeSet.RemovedEntities.Count, "Unexpected amount of removed entities."); Assert.AreEqual(1, entitiesInConflict.Length, "Unexpected amount of entities in conflict."); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs index 7acf33727..3b1de8e68 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs @@ -225,7 +225,7 @@ private void SetChangeSetConflicts(Dictionary opera // TODO: make async loading of tate var dbValues = stateEntry.GetDatabaseValues(); operationInConflict.StoreEntity = dbValues?.ToObject(); - operationInConflict.IsDeleteConflict = operationInConflict.StoreEntity == null; + operationInConflict.IsDeleteConflict = dbValues == null; // PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); List membersInConflict = new List(); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs index c74256ecc..57670fcea 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs @@ -1,6 +1,9 @@ using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using System.Linq; using Microsoft.EntityFrameworkCore.ChangeTracking; +using OpenRiaServices.Server; namespace OpenRiaServices.EntityFrameworkCore { @@ -10,31 +13,32 @@ namespace OpenRiaServices.EntityFrameworkCore /// internal static class ObjectContextUtilitiesEFCore { - public static EntityEntry AttachAsModifiedInternal(object current, object original, ChangeTracker objectContext) { var stateEntry = objectContext.Context.Entry(current); // ObjectStateManager.GetObjectStateEntry(current); - - // TODO: The code below may be needed based on how RoundTripOriginalAttribute behaves in EF Core + // Apply original vaules + var originalValues = objectContext.Context.Entry(original).CurrentValues; // For any members that don't have RoundtripOriginal applied, EF can't determine modification // state by doing value comparisons. To avoid losing updates in these cases, we must explicitly // mark such members as modified. - //Type entityType = current.GetType(); - //PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType); - //AttributeCollection attributes = TypeDescriptor.GetAttributes(entityType); - //bool isRoundtripType = attributes[typeof(RoundtripOriginalAttribute)] != null; - //foreach (var fieldMetadata in stateEntry.CurrentValues.DataRecordInfo.FieldMetadata) - //{ - // string memberName = stateEntry.CurrentValues.GetName(fieldMetadata.Ordinal); - // PropertyDescriptor property = properties[memberName]; - // if (property != null && - // (property.Attributes[typeof(RoundtripOriginalAttribute)] == null && !isRoundtripType) && - // property.Attributes[typeof(ExcludeAttribute)] == null) - // { - // stateEntry.SetModifiedProperty(memberName); - // } - //} + Type entityType = current.GetType(); + PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType); + AttributeCollection attributes = TypeDescriptor.GetAttributes(entityType); + bool isRoundtripType = attributes[typeof(RoundtripOriginalAttribute)] != null; + + foreach (var memberName in stateEntry.CurrentValues.Properties) + { + stateEntry.OriginalValues[memberName.Name] = originalValues[memberName]; + + PropertyDescriptor property = properties[memberName.Name]; + if (property != null && + (property.Attributes[typeof(RoundtripOriginalAttribute)] == null && !isRoundtripType) && + property.Attributes[typeof(ExcludeAttribute)] == null) + { + stateEntry.Property(memberName.Name).IsModified = true; + } + } return stateEntry; } } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index 49cd3ce64..2db8cb5a7 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -122,6 +122,7 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) case "KeepCurrent": // Client Wins //objectContext.Refresh(RefreshMode.ClientWins, product); // TODO + ResolveProductWithMerge(entryInConflict); // TODO: Is this correcy??? break; case "RefreshCurrent": // Store wins @@ -138,6 +139,7 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) // objectContext.Refresh(RefreshMode.StoreWins, product); // TODO return false; case "": + ResolveProductWithMerge(entryInConflict); // TODO: Is this correcy??? // objectContext.Refresh(RefreshMode.ClientWins, product); // TODO break; default: @@ -149,6 +151,31 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) return true; } + private void RefreshClientWins(EntityEntry entry) + { + // Keep a collection of all modified properties and their values. + PropertyValues currentValues = entry.CurrentValues; + PropertyValues originalValues = entry.OriginalValues; + PropertyValues dbValues = entry.GetDatabaseValues(); + if (dbValues == null) + return; + + // Reset all properties to database values, except modified values which are keept + List> modifiedMembers = new List>(); + foreach (var property in currentValues.Properties) + { + object currValue = currentValues[property.Name]; + object origValue = originalValues[property.Name]; + object dbValue = dbValues[property.Name]; + + originalValues[property.Name] = dbValue; + if (object.Equals(currValue, origValue)) + { + currentValues[property.Name] = dbValue; + } + } + } + private bool ResolveProductWithMerge(EntityEntry entry) { // Keep a collection of all modified properties and their values. From 382cef3dbb266614c00ac0ecb1e4c11c87d8d5e2 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Fri, 18 Feb 2022 16:17:39 +0100 Subject: [PATCH 38/99] fix running test on low ram --- src/Test/WebsiteFullTrust/Web.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Test/WebsiteFullTrust/Web.config b/src/Test/WebsiteFullTrust/Web.config index 39581d94b..a456d6400 100644 --- a/src/Test/WebsiteFullTrust/Web.config +++ b/src/Test/WebsiteFullTrust/Web.config @@ -50,7 +50,7 @@ - + From 5e78301a2442215842df7da15fe41111beaede4b Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Fri, 18 Feb 2022 20:09:09 +0100 Subject: [PATCH 39/99] fix NRE in SetChangeSetConflicts and add code for EnumerateAsync and --- .../Test/Client.Test/Data/UpdateTests.cs | 2 +- .../Framework/DbDomainServiceEFCore.cs | 57 +++++++------------ .../Framework/EFCoreTypeDescriptor.cs | 16 ++++-- .../Framework/QueryHelperEFCore.cs | 16 ++++++ 4 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs index 2542c1c4c..b066eabc1 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs @@ -3078,7 +3078,7 @@ public virtual void ResolveTest_DeleteUpdateConflict_Bug597087() Assert.IsInstanceOfType(so.Error, typeof(DomainOperationException)); DomainOperationException ex = so.Error as DomainOperationException; - Assert.AreEqual(Resource.DomainContext_SubmitOperationFailed_Conflicts, so.Error.Message); + Assert.AreEqual(Resource.DomainContext_SubmitOperationFailed_Conflicts, so.Error?.Message); Assert.AreEqual(1, so.EntitiesInError.Count()); EntityConflict conflict = so.EntitiesInError.Single().EntityConflict; Assert.IsTrue(conflict.IsDeleted); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs index 3b1de8e68..25dd0970f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs @@ -47,7 +47,7 @@ protected virtual TContext CreateDbContext() { return new TContext(); } - + /// /// Gets the /// @@ -86,7 +86,15 @@ protected override ValueTask CountAsync(IQueryable query, Cancellatio /// A new enumerable with the results of the enumerated enumerable. protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) { - return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); + // TODO: Determine if we get into if statement + if (enumerable is IAsyncEnumerable asyncEnumerable) + { + return QueryHelperEFCore.EnumerateAsyncEnumerable(asyncEnumerable, estimatedResultCount, cancellationToken); + } + else + { + return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); + } } @@ -200,8 +208,8 @@ private void SetChangeSetConflicts(Dictionary opera { foreach (var conflictEntry in operationConflictMap) { - EntityEntry stateEntry = conflictEntry.Key; - + EntityEntry stateEntry = conflictEntry.Key; + if (stateEntry.State == EntityState.Unchanged) { continue; @@ -210,16 +218,6 @@ private void SetChangeSetConflicts(Dictionary opera // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. ChangeSetEntry operationInConflict = conflictEntry.Value; - // TODO: Look into DbDomainService.SetChangeSetConflicts it looks quite different and contains other logic such as - // loading store entity - // It might be possible to use "NoTracking" load to find database version - // - this would include getting keys of entity (using stateEntry.Metadata.GetKeys ? ) - // - then creating an expression comparing an X.Key1 = A && X.Key2 == 2 and so on - // - and doing a NoTracking load (some if it woud need to be in a generic method for eas of use) - // another approach would be to create an instance of the same type as X and use - // valeus obtained from stateEntry.GetDatabaseValues() to set it's values - // throw new NotImplementedException(); - // Determine which members are in conflict by comparing original values to the current DB values // // TODO: Populate store entity conflictEntry.Value.StoreEntity // TODO: make async loading of tate @@ -227,33 +225,18 @@ private void SetChangeSetConflicts(Dictionary opera operationInConflict.StoreEntity = dbValues?.ToObject(); operationInConflict.IsDeleteConflict = dbValues == null; - // PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); - List membersInConflict = new List(); - object originalValue; - //PropertyDescriptor pd; - foreach (var prop in stateEntry.OriginalValues.Properties) + if (dbValues != null) { - originalValue = stateEntry.OriginalValues[prop.Name]; - if (originalValue is DBNull) - { - originalValue = null; - } - - string propertyName = prop.Name; - //pd = propDescriptors[propertyName]; - //if (pd == null) - //{ - // // This might happen in the case of a private model - // // member that isn't mapped - // continue; - //} - - if (!object.Equals(originalValue, dbValues[prop.Name])) + List membersInConflict = new List(); + foreach (var property in stateEntry.OriginalValues.Properties) { - membersInConflict.Add(prop.Name); + if (!object.Equals(stateEntry.OriginalValues[property.Name], dbValues[property.Name])) + { + membersInConflict.Add(property.Name); + } } + operationInConflict.ConflictMembers = membersInConflict; } - operationInConflict.ConflictMembers = membersInConflict; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs index 3c37f2fa3..9c8583631 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs @@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore; using System.Linq; using OpenRiaServices.Server; -//using System.Data.Entity.Core.Objects.DataClasses; using Microsoft.EntityFrameworkCore.Metadata; namespace OpenRiaServices.EntityFrameworkCore @@ -28,7 +27,7 @@ public EFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescr this._typeDescriptionContext = typeDescriptionContext; this._entityType = entityType; - var timestampMembers = entityType.GetProperties().Where(p => IsTimestampProperty(p)).ToArray(); + var timestampMembers = entityType.GetProperties().Where(p => IsConcurrencyTimestamp(p)).ToArray(); if (timestampMembers.Length == 1) { this._timestampProperty = timestampMembers[0]; @@ -61,11 +60,16 @@ public EFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescr /// /// Check if a property is a "Timestamp" property (rowversion or similar) /// - /// - /// - private static bool IsTimestampProperty(IProperty p) + /// /// Since EF doesn't expose "timestamp" as a first class + /// concept, we use the below criteria to infer this for ourselves. + /// + private static bool IsConcurrencyTimestamp(IProperty p) { - return p.IsConcurrencyToken && p.ValueGenerated == ValueGenerated.OnAddOrUpdate; + //IsConcurrencyTimestamp + return p.IsConcurrencyToken + // && p.GetMaxLength() == 8 + // && p.IsFixedLength + && p.ValueGenerated == ValueGenerated.OnAddOrUpdate; } /// diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs index 64a16198e..0ef976f5b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs @@ -3,6 +3,8 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Query.Internal; +using System.Collections.Generic; +using System; namespace OpenRiaServices.EntityFrameworkCore { @@ -16,5 +18,19 @@ public static ValueTask CountAsync(IQueryable query, CancellationToke else return new ValueTask(query.Count()); } + + internal static async ValueTask> EnumerateAsyncEnumerable(IAsyncEnumerable asyncEnumerable, int estimatedResultCount, CancellationToken cancellationToken) + { + await using (var enumerator = asyncEnumerable.GetAsyncEnumerator(cancellationToken)) + { + List result = new List(capacity: estimatedResultCount); + while (await enumerator.MoveNextAsync().ConfigureAwait(false)) + { + result.Add(enumerator.Current); + } + + return result; + } + } } } From ca3607a26f5934a29d16abafa236fc994ea70597 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 19 Feb 2022 14:00:38 +0100 Subject: [PATCH 40/99] add more missing concurrencytoken (for product) --- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 46 +++++++++---------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index e512f52b1..214ac8a1c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -131,7 +131,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasName("Region"); entity.Property(e => e.CustomerID) - .HasColumnName("CustomerID") .HasMaxLength(5) .IsFixedLength() .IsConcurrencyToken(); @@ -145,26 +144,20 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasMaxLength(40) .IsConcurrencyToken(); - entity.Property(e => e.ContactName).HasMaxLength(30) - .IsConcurrencyToken(); + entity.Property(e => e.ContactName).HasMaxLength(30).IsConcurrencyToken(); - entity.Property(e => e.ContactTitle).HasMaxLength(30) - .IsConcurrencyToken(); + entity.Property(e => e.ContactTitle).HasMaxLength(30).IsConcurrencyToken(); - entity.Property(e => e.Country).HasMaxLength(15) - .IsConcurrencyToken(); + entity.Property(e => e.Country).HasMaxLength(15).IsConcurrencyToken(); - entity.Property(e => e.Fax).HasMaxLength(24) - .IsConcurrencyToken(); + entity.Property(e => e.Fax).HasMaxLength(24).IsConcurrencyToken(); - entity.Property(e => e.Phone).HasMaxLength(24) - .IsConcurrencyToken(); + entity.Property(e => e.Phone).HasMaxLength(24).IsConcurrencyToken(); - entity.Property(e => e.PostalCode).HasMaxLength(10) - .IsConcurrencyToken(); + entity.Property(e => e.PostalCode).HasMaxLength(10).IsConcurrencyToken(); + + entity.Property(e => e.Region).HasMaxLength(15).IsConcurrencyToken(); - entity.Property(e => e.Region).HasMaxLength(15) - .IsConcurrencyToken(); }); modelBuilder.Entity(entity => @@ -371,30 +364,33 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasIndex(e => e.SupplierID) .HasName("SuppliersProducts"); - entity.Property(e => e.ProductID).HasColumnName("ProductID"); + entity.Property(e => e.ProductID).IsConcurrencyToken(); - entity.Property(e => e.CategoryID).HasColumnName("CategoryID"); + entity.Property(e => e.CategoryID).IsConcurrencyToken(); entity.Property(e => e.Discontinued) - .IsRequired(); + .IsRequired() + .IsConcurrencyToken(); entity.Property(e => e.ProductName) .IsRequired() - .HasMaxLength(40); + .HasMaxLength(40) + .IsConcurrencyToken(); - entity.Property(e => e.QuantityPerUnit).HasMaxLength(20); + entity.Property(e => e.QuantityPerUnit).HasMaxLength(20).IsConcurrencyToken(); - entity.Property(e => e.ReorderLevel).HasDefaultValueSql("(0)"); + entity.Property(e => e.ReorderLevel).HasDefaultValueSql("(0)").IsConcurrencyToken(); - entity.Property(e => e.SupplierID).HasColumnName("SupplierID"); + entity.Property(e => e.SupplierID).HasColumnName("SupplierID").IsConcurrencyToken(); entity.Property(e => e.UnitPrice) .HasColumnType("money") - .HasDefaultValueSql("(0)"); + .HasDefaultValueSql("(0)") + .IsConcurrencyToken(); - entity.Property(e => e.UnitsInStock).HasDefaultValueSql("(0)"); + entity.Property(e => e.UnitsInStock).HasDefaultValueSql("(0)").IsConcurrencyToken(); - entity.Property(e => e.UnitsOnOrder).HasDefaultValueSql("(0)"); + entity.Property(e => e.UnitsOnOrder).HasDefaultValueSql("(0)").IsConcurrencyToken(); entity.HasOne(d => d.Category) .WithMany(p => p.Products) From e494fc41c88882c95a288a15880e7600617b7053 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 19 Feb 2022 14:02:08 +0100 Subject: [PATCH 41/99] increase timeout for debugging client tests --- .../Framework/Web/WcfDomainClientFactory.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/OpenRiaServices.Client.Web/Framework/Web/WcfDomainClientFactory.cs b/src/OpenRiaServices.Client.Web/Framework/Web/WcfDomainClientFactory.cs index ef35e1801..8cff51e49 100644 --- a/src/OpenRiaServices.Client.Web/Framework/Web/WcfDomainClientFactory.cs +++ b/src/OpenRiaServices.Client.Web/Framework/Web/WcfDomainClientFactory.cs @@ -203,7 +203,9 @@ protected virtual ChannelFactory CreateChannelFactory(Uri { // in debug mode set the timeout to a higher number to // facilitate debugging - factory.Endpoint.Binding.OpenTimeout = TimeSpan.FromMinutes(5); + factory.Endpoint.Binding.OpenTimeout = TimeSpan.FromMinutes(10); + factory.Endpoint.Binding.ReceiveTimeout = TimeSpan.FromMinutes(10); + factory.Endpoint.Binding.SendTimeout = TimeSpan.FromMinutes(10); } #endif } From 206e846dbf9ed16cf36a176fdcbf53eebead63bf Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 19 Feb 2022 14:06:39 +0100 Subject: [PATCH 42/99] handle EFCore same as EF in update tests --- .../Test/Client.Test/Data/UpdateTests.cs | 12 ++++++------ .../Northwind/EFCore_Northwind.cs | 3 +-- .../OpenRiaServices.Common.Test/UnitTestBase.cs | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs index b066eabc1..bb649329b 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs @@ -3149,7 +3149,7 @@ public virtual void ResolveTest_MultipleInstances_MixedResolveMethods() EnqueueCallback(delegate { Product[] products = nw2.Products.ToArray(); - if (this.ProviderType == ProviderType.EF) + if (this.ProviderType == ProviderType.EF || ProviderType == ProviderType.EFCore) { // Verify Product0 changes was not synced back to the client since resubmit still fails with conflict Assert.IsNull(products[0].EntityConflict); @@ -3201,7 +3201,7 @@ public virtual void ResolveTest_MultipleInstances_MixedResolveMethods() delegate { Product[] products = nw1.Products.ToArray(); - if (this.ProviderType == ProviderType.EF) + if (this.ProviderType == ProviderType.EF || ProviderType == ProviderType.EFCore) { // verify nw2 changes are not persisted Assert.AreEqual(nw1NewUnitPrice[0], products[0].UnitPrice); @@ -3284,7 +3284,7 @@ public virtual void ResolveTest_MultipleInstances_ReturnTrueFalse() Product[] products = nw2.Products.ToArray(); EntityConflict conflict = null; - if (this.ProviderType == ProviderType.EF) + if (this.ProviderType == ProviderType.EF || ProviderType == ProviderType.EFCore) { // EF only supports getting the first conflict so only Product0's conflicts will be generated and only // its resolve method is called. Hence the conflict is resolved successfully the first round. When resubmit @@ -3388,7 +3388,7 @@ public virtual void ResolveTest_MultipleInstances_ReturnTrueTrue() EnqueueCallback(delegate { Product[] products = nw2.Products.ToArray(); - if (this.ProviderType == ProviderType.EF) + if (this.ProviderType == ProviderType.EF || ProviderType == ProviderType.EFCore) { // EF only supports getting the first conflict so only Product0's conflicts will be generated and only // its resolve method is called. Hence the conflict is resolved successfully the first round. When resubmit @@ -3434,7 +3434,7 @@ public virtual void ResolveTest_MultipleInstances_ReturnTrueTrue() delegate { Product[] products = nw1.Products.ToArray(); - if (ProviderType == ProviderType.EF) + if (ProviderType == ProviderType.EF || ProviderType == ProviderType.EFCore) { // verify store values are not changed since submit failed Assert.AreEqual(nw1NewUnitPrice[0], products[0].UnitPrice); @@ -3585,7 +3585,7 @@ public virtual void ResolveTest_MultipleInstances_FirstSucceedsSecondThrows() DomainOperationException ex = so.Error as DomainOperationException; Product[] products = nw2.Products.ToArray(); - if (this.ProviderType == ProviderType.EF) + if (this.ProviderType == ProviderType.EF || ProviderType == ProviderType.EFCore) { // EF only supports getting the first conflict, so Product0's conflicts will be generated during first submit, // then they are resolved server side and resubmit is called. Product1's conflicts will then be generated. Since diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index 2db8cb5a7..a7e5cd844 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -122,7 +122,7 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) case "KeepCurrent": // Client Wins //objectContext.Refresh(RefreshMode.ClientWins, product); // TODO - ResolveProductWithMerge(entryInConflict); // TODO: Is this correcy??? + RefreshClientWins(entryInConflict); // TODO: Is this correcy??? break; case "RefreshCurrent": // Store wins @@ -161,7 +161,6 @@ private void RefreshClientWins(EntityEntry entry) return; // Reset all properties to database values, except modified values which are keept - List> modifiedMembers = new List>(); foreach (var property in currentValues.Properties) { object currValue = currentValues[property.Name]; diff --git a/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs b/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs index 59e5edc05..7cbcc3909 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs @@ -41,6 +41,7 @@ protected UnitTestBase() /// and cannot be used from partial trust unit tests /// [SecuritySafeCritical] + [DebuggerStepThrough] public static class Assert { // --- IsTrue --- From 3685ca85525b3b1ca68baa367e7ce387218442c5 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 19 Feb 2022 15:28:13 +0100 Subject: [PATCH 43/99] Fix "KeepKurrent" logic --- .../Framework/QueryHelperEFCore.cs | 13 ++++------ .../Northwind/EFCore_Northwind.cs | 25 ++++++------------- .../UnitTestBase.cs | 2 +- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs index 0ef976f5b..14dee4d05 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs @@ -21,16 +21,13 @@ public static ValueTask CountAsync(IQueryable query, CancellationToke internal static async ValueTask> EnumerateAsyncEnumerable(IAsyncEnumerable asyncEnumerable, int estimatedResultCount, CancellationToken cancellationToken) { - await using (var enumerator = asyncEnumerable.GetAsyncEnumerator(cancellationToken)) + List result = new List(capacity: estimatedResultCount); + await foreach (var item in asyncEnumerable.ConfigureAwait(false).WithCancellation(cancellationToken)) { - List result = new List(capacity: estimatedResultCount); - while (await enumerator.MoveNextAsync().ConfigureAwait(false)) - { - result.Add(enumerator.Current); - } - - return result; + result.Add(item); } + + return result; } } } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index a7e5cd844..628b4b199 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -121,13 +121,11 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) return this.ResolveProductWithMerge(entryInConflict); case "KeepCurrent": // Client Wins - //objectContext.Refresh(RefreshMode.ClientWins, product); // TODO - RefreshClientWins(entryInConflict); // TODO: Is this correcy??? + RefreshClientWins(entryInConflict); break; case "RefreshCurrent": // Store wins DbContext.Entry(product).Reload(); - // objectContext.Refresh(RefreshMode.StoreWins, product); // TODO break; case "ReturnTrueNoResolve": return true; @@ -136,11 +134,9 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) case "ReturnFalseWithResolve": // Store Wins DbContext.Entry(product).Reload(); - // objectContext.Refresh(RefreshMode.StoreWins, product); // TODO return false; case "": - ResolveProductWithMerge(entryInConflict); // TODO: Is this correcy??? - // objectContext.Refresh(RefreshMode.ClientWins, product); // TODO + RefreshClientWins(entryInConflict); break; default: { @@ -151,26 +147,21 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) return true; } + // Reset all properties to database values, except modified values which are keept private void RefreshClientWins(EntityEntry entry) { - // Keep a collection of all modified properties and their values. - PropertyValues currentValues = entry.CurrentValues; - PropertyValues originalValues = entry.OriginalValues; PropertyValues dbValues = entry.GetDatabaseValues(); if (dbValues == null) return; - // Reset all properties to database values, except modified values which are keept - foreach (var property in currentValues.Properties) + foreach (var prop in entry.Properties) { - object currValue = currentValues[property.Name]; - object origValue = originalValues[property.Name]; - object dbValue = dbValues[property.Name]; + object dbValue = dbValues[prop.Metadata.Name]; - originalValues[property.Name] = dbValue; - if (object.Equals(currValue, origValue)) + prop.OriginalValue = dbValue; + if (object.Equals(prop.CurrentValue, prop.OriginalValue)) { - currentValues[property.Name] = dbValue; + prop.CurrentValue = dbValue; } } } diff --git a/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs b/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs index 7cbcc3909..3a0bf03cd 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs @@ -42,7 +42,7 @@ protected UnitTestBase() /// [SecuritySafeCritical] [DebuggerStepThrough] - public static class Assert + private static class OldAssert { // --- IsTrue --- public static void IsTrue(bool condition) From 55e66225a1f47bd032603bf74841fa1f495a5492 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 19 Feb 2022 15:45:38 +0100 Subject: [PATCH 44/99] create nupkg on build --- ...Services.Server.EntityFrameworkCore.csproj | 104 +++++++++--------- 1 file changed, 49 insertions(+), 55 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 6fa9d2631..469c7a392 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -1,56 +1,50 @@  - - - net472 - $(DefineConstants);SERVERFX;DBCONTEXT; - True - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - - - True - True - DbResource.resx - - - MetadataResource.resx - True - True - - - ResourceEFCore.resx - True - True - - - - - - - - ResXFileCodeGenerator - DbResource.Designer.cs - Designer - - - ResXFileCodeGenerator - MetadataResource.Designer.cs - System.Data.Mapping - - - ResXFileCodeGenerator - ResourceEFCore.Designer.cs - - - \ No newline at end of file + + netstandard2.0 + $(DefineConstants);SERVERFX;DBCONTEXT; + True + true + ..\..\..\NuGet\bin\ + + + + + + + + + True + True + DbResource.resx + + + MetadataResource.resx + True + True + + + ResourceEFCore.resx + True + True + + + + + + + + ResXFileCodeGenerator + DbResource.Designer.cs + Designer + + + ResXFileCodeGenerator + MetadataResource.Designer.cs + System.Data.Mapping + + + ResXFileCodeGenerator + ResourceEFCore.Designer.cs + + + \ No newline at end of file From 2567b67a3ee3d142b1d7f202143b99ce9b5653eb Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 19 Feb 2022 20:40:58 +0100 Subject: [PATCH 45/99] Remove unneeded classes from EFCore adventureworks --- .../Data/CrossDomainServiceQueryTests.cs | 5 +- .../Test/Client.Test/TestUris.cs | 1 + .../Framework/App.config | 13 - ...qToEntitiesEFCoreTypeDescriptionContext.cs | 1 - .../DbContextModel/AdventureWorks/Address.cs | 29 -- .../AdventureWorks/AddressType.cs | 20 - .../AdventureWorksPartialClasses.cs | 48 ++ .../AdventureWorks/AdventureworksContext.cs | 456 ++---------------- .../AdventureWorks/BillOfMaterials.cs | 28 -- .../DbContextModel/AdventureWorks/Contact.cs | 4 +- .../AdventureWorks/ContactCreditCard.cs | 17 - .../AdventureWorks/ContactType.cs | 19 - .../AdventureWorks/CountryRegion.cs | 21 - .../AdventureWorks/CountryRegionCurrency.cs | 21 - .../AdventureWorks/CreditCard.cs | 24 - .../DbContextModel/AdventureWorks/Culture.cs | 21 - .../DbContextModel/AdventureWorks/Currency.cs | 21 - .../AdventureWorks/CurrencyRate.cs | 28 -- .../DbContextModel/AdventureWorks/Customer.cs | 24 - .../AdventureWorks/CustomerAddress.cs | 19 - .../AdventureWorks/Department.cs | 22 - .../DbContextModel/AdventureWorks/Document.cs | 33 -- .../DbContextModel/AdventureWorks/Employee.cs | 10 +- .../AdventureWorks/EmployeeAddress.cs | 18 - .../EmployeeDepartmentHistory.cs | 22 - .../AdventureWorks/EmployeePayHistory.cs | 21 - .../AdventureWorks/Illustration.cs | 18 - .../AdventureWorks/Individual.cs | 19 - .../AdventureWorks/JobCandidate.cs | 19 - .../DbContextModel/AdventureWorks/Location.cs | 23 - .../DbContextModel/AdventureWorks/Product.cs | 9 +- .../AdventureWorks/ProductCategory.cs | 20 - .../AdventureWorks/ProductCostHistory.cs | 22 - .../AdventureWorks/ProductDescription.cs | 20 - .../AdventureWorks/ProductDocument.cs | 17 - .../AdventureWorks/ProductInventory.cs | 23 - .../AdventureWorks/ProductListPriceHistory.cs | 22 - .../AdventureWorks/ProductModel.cs | 24 - .../ProductModelIllustration.cs | 17 - .../ProductModelProductDescriptionCulture.cs | 20 - .../AdventureWorks/ProductPhoto.cs | 22 - .../AdventureWorks/ProductProductPhoto.cs | 18 - .../AdventureWorks/ProductReview.cs | 28 -- .../AdventureWorks/ProductSubcategory.cs | 4 +- .../AdventureWorks/ProductVendor.cs | 30 -- ...urchaseOrderHeader.cs => PurchaseOrder.cs} | 10 +- .../AdventureWorks/PurchaseOrderDetail.cs | 10 +- .../AdventureWorks/SalesOrderDetail.cs | 29 -- .../AdventureWorks/SalesOrderHeader.cs | 54 --- .../SalesOrderHeaderSalesReason.cs | 17 - .../AdventureWorks/SalesPerson.cs | 7 +- .../AdventureWorks/SalesPersonQuotaHistory.cs | 21 - .../AdventureWorks/SalesReason.cs | 22 - .../AdventureWorks/SalesTaxRate.cs | 24 - .../AdventureWorks/SalesTerritory.cs | 4 +- .../AdventureWorks/SalesTerritoryHistory.cs | 22 - .../AdventureWorks/ScrapReason.cs | 19 - .../DbContextModel/AdventureWorks/Shift.cs | 23 - .../AdventureWorks/ShipMethod.cs | 24 - .../AdventureWorks/ShoppingCartItem.cs | 23 - .../AdventureWorks/SpecialOffer.cs | 34 -- .../AdventureWorks/SpecialOfferProduct.cs | 18 - .../AdventureWorks/StateProvince.cs | 28 -- .../DbContextModel/AdventureWorks/Store.cs | 23 - .../AdventureWorks/StoreContact.cs | 19 - .../AdventureWorks/TransactionHistory.cs | 27 -- .../TransactionHistoryArchive.cs | 27 -- .../AdventureWorks/UnitMeasure.cs | 21 - .../DbContextModel/AdventureWorks/Vendor.cs | 27 -- .../AdventureWorks/VendorAddress.cs | 18 - .../AdventureWorks/VendorContact.cs | 18 - .../AdventureWorks/WorkOrder.cs | 27 -- .../AdventureWorks/WorkOrderRouting.cs | 33 -- .../Test/DbContextModel/efpt.config.json | 350 ++------------ .../AdventureWorks/EFCore_Catalog.cs | 142 ++++++ 75 files changed, 329 insertions(+), 2113 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs create mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs rename src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/{PurchaseOrderHeader.cs => PurchaseOrder.cs} (82%) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs index 6ab4048ea..b487e6ecd 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs @@ -585,12 +585,12 @@ protected override Northwind CreateNorthwind() } } /** TODO: - * copy EFQueryTests, do we want the added test from that one + * copy EFQueryTests, do we want the added test from that one */ [TestClass] public class EFCoreQueryTests : CrossDomainServiceQueryTests { public EFCoreQueryTests() - : base(TestURIs.EFCore_Catalog, ProviderType.EFCore) + : base(TestURIs.EFCore_Catalog, /* TODO: remove? EFCore and only have a single provider type */ProviderType.EF) { } @@ -599,5 +599,4 @@ protected override Northwind CreateNorthwind() return new Northwind(TestURIs.EFCore_Northwind); } } - **/ } diff --git a/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs b/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs index ac62f1d0e..084113140 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/TestUris.cs @@ -31,6 +31,7 @@ public static class TestURIs // EF Core public static readonly Uri EFCore_Northwind = new Uri(RootURI, "TestDomainServices-EFCore-Northwind.svc"); public static readonly Uri EFCore_Northwind_CUD = new Uri(RootURI, "TestDomainServices-EFCore-Northwind_CUD.svc"); + public static readonly Uri EFCore_Catalog = new Uri(RootURI, "TestDomainServices-EFCore-Catalog.svc"); // LTS public static readonly Uri LTS_Catalog = new Uri(RootURI, "TestDomainServices-LTS-Catalog.svc"); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config deleted file mode 100644 index 01f6c9b5f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/App.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - -
- - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index 836d9508c..bf1456130 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -32,7 +32,6 @@ public LinqToEntitiesEFCoreTypeDescriptionContext(Type contextType) this._contextType = contextType; } - // TODO: Add model property _context.Model public IModel Model { get diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs deleted file mode 100644 index ee51e60a0..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Address.cs +++ /dev/null @@ -1,29 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Address", Schema = "Person")] - public partial class Address - { - public int AddressID { get; set; } - [Required] - [StringLength(60)] - public string AddressLine1 { get; set; } - [StringLength(60)] - public string AddressLine2 { get; set; } - [Required] - [StringLength(30)] - public string City { get; set; } - public int StateProvinceID { get; set; } - [Required] - [StringLength(15)] - public string PostalCode { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs deleted file mode 100644 index efe76515f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AddressType.cs +++ /dev/null @@ -1,20 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("AddressType", Schema = "Person")] - public partial class AddressType - { - public int AddressTypeID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs new file mode 100644 index 000000000..5960c8bbf --- /dev/null +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureWorksPartialClasses.cs @@ -0,0 +1,48 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; + +// These assembly attributes allow us to serialize different CLR types into the same contract +[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks", + ClrNamespace = "EFCoreModels.AdventureWorks")] + +namespace EFCoreModels.AdventureWorks +{ + + public class EmployeeInfo + { + public static EmployeeInfo CreateEmployeeInfo(int employeeID, string firstName, string lastName, int territoryID) + { + EmployeeInfo empInfo = new EmployeeInfo(); + empInfo.EmployeeID = employeeID; + empInfo.FirstName = firstName; + empInfo.LastName = lastName; + empInfo.TerritoryID = territoryID; + return empInfo; + } + + [Key] + public int EmployeeID + { + get; + set; + } + + public string FirstName + { + get; + set; + } + public string LastName + { + get; + set; + } + public int TerritoryID + { + get; + set; + } + } +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs index d1df2a117..cbf706650 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { public partial class AdventureworksContext : DbContext { @@ -16,73 +16,18 @@ public AdventureworksContext(DbContextOptions options) { } - public virtual DbSet
Address { get; set; } - public virtual DbSet AddressType { get; set; } - public virtual DbSet BillOfMaterials { get; set; } - public virtual DbSet Contact { get; set; } - public virtual DbSet ContactCreditCard { get; set; } - public virtual DbSet ContactType { get; set; } - public virtual DbSet CountryRegion { get; set; } - public virtual DbSet CountryRegionCurrency { get; set; } - public virtual DbSet CreditCard { get; set; } - public virtual DbSet Culture { get; set; } - public virtual DbSet Currency { get; set; } - public virtual DbSet CurrencyRate { get; set; } - public virtual DbSet Customer { get; set; } - public virtual DbSet CustomerAddress { get; set; } - public virtual DbSet Department { get; set; } - public virtual DbSet Document { get; set; } - public virtual DbSet Employee { get; set; } - public virtual DbSet EmployeeAddress { get; set; } - public virtual DbSet EmployeeDepartmentHistory { get; set; } - public virtual DbSet EmployeePayHistory { get; set; } - public virtual DbSet Illustration { get; set; } - public virtual DbSet Individual { get; set; } - public virtual DbSet JobCandidate { get; set; } - public virtual DbSet Location { get; set; } - public virtual DbSet Product { get; set; } - public virtual DbSet ProductCategory { get; set; } - public virtual DbSet ProductCostHistory { get; set; } - public virtual DbSet ProductDescription { get; set; } - public virtual DbSet ProductDocument { get; set; } - public virtual DbSet ProductInventory { get; set; } - public virtual DbSet ProductListPriceHistory { get; set; } - public virtual DbSet ProductModel { get; set; } - public virtual DbSet ProductModelIllustration { get; set; } - public virtual DbSet ProductModelProductDescriptionCulture { get; set; } - public virtual DbSet ProductPhoto { get; set; } - public virtual DbSet ProductProductPhoto { get; set; } - public virtual DbSet ProductReview { get; set; } - public virtual DbSet ProductSubcategory { get; set; } - public virtual DbSet ProductVendor { get; set; } - public virtual DbSet PurchaseOrderDetail { get; set; } - public virtual DbSet PurchaseOrderHeader { get; set; } - public virtual DbSet SalesOrderDetail { get; set; } - public virtual DbSet SalesOrderHeader { get; set; } - public virtual DbSet SalesOrderHeaderSalesReason { get; set; } - public virtual DbSet SalesPerson { get; set; } - public virtual DbSet SalesPersonQuotaHistory { get; set; } - public virtual DbSet SalesReason { get; set; } - public virtual DbSet SalesTaxRate { get; set; } - public virtual DbSet SalesTerritory { get; set; } - public virtual DbSet SalesTerritoryHistory { get; set; } - public virtual DbSet ScrapReason { get; set; } - public virtual DbSet Shift { get; set; } - public virtual DbSet ShipMethod { get; set; } - public virtual DbSet ShoppingCartItem { get; set; } - public virtual DbSet SpecialOffer { get; set; } - public virtual DbSet SpecialOfferProduct { get; set; } - public virtual DbSet StateProvince { get; set; } - public virtual DbSet Store { get; set; } - public virtual DbSet StoreContact { get; set; } - public virtual DbSet TransactionHistory { get; set; } - public virtual DbSet TransactionHistoryArchive { get; set; } - public virtual DbSet UnitMeasure { get; set; } - public virtual DbSet Vendor { get; set; } - public virtual DbSet VendorAddress { get; set; } - public virtual DbSet VendorContact { get; set; } - public virtual DbSet WorkOrder { get; set; } - public virtual DbSet WorkOrderRouting { get; set; } + + public virtual DbSet Contacts { get; set; } + public virtual DbSet Employees { get; set; } + public virtual DbSet Products { get; set; } + public virtual DbSet ProductSubcategories { get; set; } + + public virtual DbSet PurchaseOrderDetails { get; set; } + public virtual DbSet PurchaseOrders { get; set; } + + public virtual DbSet SalesPersons { get; set; } + public virtual DbSet SalesTerritories { get; set; } + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { @@ -94,156 +39,25 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnModelCreating(ModelBuilder modelBuilder) { - modelBuilder.Entity
(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.UnitMeasureCode).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.PasswordHash).IsUnicode(false); - - entity.Property(e => e.PasswordSalt).IsUnicode(false); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.CurrencyCode).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.CultureID).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.CurrencyCode).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.FromCurrencyCode).IsFixedLength(); - - entity.Property(e => e.ToCurrencyCode).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.AccountNumber).IsUnicode(false); - - entity.Property(e => e.CustomerType).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.Revision).IsFixedLength(); - }); modelBuilder.Entity(entity => { - entity.HasNoKey(); - entity.Property(e => e.Gender).IsFixedLength(); entity.Property(e => e.MaritalStatus).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); + entity.HasOne(e => e.Contact) + .WithMany() + .HasForeignKey(e => e.ContactID) + .HasConstraintName("FK_Employee_Contact_ContactID"); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); + entity.HasOne(e => e.Manager) + .WithMany() + .HasForeignKey(e => e.ManagerID); }); modelBuilder.Entity(entity => { - entity.HasNoKey(); - entity.Property(e => e.Class).IsFixedLength(); entity.Property(e => e.ProductLine).IsFixedLength(); @@ -253,230 +67,52 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.Style).IsFixedLength(); entity.Property(e => e.WeightUnitMeasureCode).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.CultureID).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.UnitMeasureCode).IsFixedLength(); + entity.HasOne(e => e.ProductSubcategory) + .WithMany() + .HasForeignKey(e => e.ProductSubcategoryID) +// .HasConstraintName() +; }); modelBuilder.Entity(entity => { - entity.HasNoKey(); - }); + entity.HasKey(e => e.PurchaseOrderDetailID); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); + entity.HasOne(e => e.PurchaseOrder) + .WithMany(e => e.PurchaseOrderDetails) + .HasForeignKey(e => e.PurchaseOrderDetailID) + .HasConstraintName("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID"); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); + entity.HasOne(e => e.Product) + .WithMany() + .HasForeignKey(e => e.ProductID) + .HasConstraintName("FK_PurchaseOrderDetail_Product_ProductID"); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { - entity.HasNoKey(); - - entity.Property(e => e.CreditCardApprovalCode).IsUnicode(false); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); + entity.HasKey(e => e.PurchaseOrderID); }); modelBuilder.Entity(entity => { - entity.HasNoKey(); - }); + entity.HasKey(e => e.SalesPersonID); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); + entity.HasOne(e => e.Employee) + .WithOne(e => e.SalesPerson) + .HasForeignKey(e => e.SalesPersonID) + .HasConstraintName("FK_SalesPerson_Employee_SalesPersonID") + .IsRequired(); - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); + entity.HasOne(e => e.SalesTerritory) + .WithMany() + .HasForeignKey(e => e.TerritoryID); }); modelBuilder.Entity(entity => { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.StateProvinceCode).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.TransactionType).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.TransactionType).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - - entity.Property(e => e.UnitMeasureCode).IsFixedLength(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); - }); - - modelBuilder.Entity(entity => - { - entity.HasNoKey(); + entity.HasKey(e => e.TerritoryID); }); OnModelCreatingPartial(modelBuilder); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs deleted file mode 100644 index be4908c92..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/BillOfMaterials.cs +++ /dev/null @@ -1,28 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("BillOfMaterials", Schema = "Production")] - public partial class BillOfMaterials - { - public int BillOfMaterialsID { get; set; } - public int? ProductAssemblyID { get; set; } - public int ComponentID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? EndDate { get; set; } - [Required] - [StringLength(3)] - public string UnitMeasureCode { get; set; } - public short BOMLevel { get; set; } - [Column(TypeName = "decimal(8, 2)")] - public decimal PerAssemblyQty { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs index 76c616cdb..29945dae5 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Contact.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("Contact", Schema = "Person")] public partial class Contact @@ -40,4 +40,4 @@ public partial class Contact [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs deleted file mode 100644 index cf8c5302c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactCreditCard.cs +++ /dev/null @@ -1,17 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ContactCreditCard", Schema = "Sales")] - public partial class ContactCreditCard - { - public int ContactID { get; set; } - public int CreditCardID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs deleted file mode 100644 index 5a1ca0677..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ContactType.cs +++ /dev/null @@ -1,19 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ContactType", Schema = "Person")] - public partial class ContactType - { - public int ContactTypeID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs deleted file mode 100644 index 431a98c03..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegion.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("CountryRegion", Schema = "Person")] - public partial class CountryRegion - { - [Required] - [StringLength(3)] - public string CountryRegionCode { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs deleted file mode 100644 index 5889c662d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CountryRegionCurrency.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("CountryRegionCurrency", Schema = "Sales")] - public partial class CountryRegionCurrency - { - [Required] - [StringLength(3)] - public string CountryRegionCode { get; set; } - [Required] - [StringLength(3)] - public string CurrencyCode { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs deleted file mode 100644 index 24ac5c4a6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CreditCard.cs +++ /dev/null @@ -1,24 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("CreditCard", Schema = "Sales")] - public partial class CreditCard - { - public int CreditCardID { get; set; } - [Required] - [StringLength(50)] - public string CardType { get; set; } - [Required] - [StringLength(25)] - public string CardNumber { get; set; } - public byte ExpMonth { get; set; } - public short ExpYear { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs deleted file mode 100644 index 9c1be5806..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Culture.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Culture", Schema = "Production")] - public partial class Culture - { - [Required] - [StringLength(6)] - public string CultureID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs deleted file mode 100644 index 50ab87988..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Currency.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Currency", Schema = "Sales")] - public partial class Currency - { - [Required] - [StringLength(3)] - public string CurrencyCode { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs deleted file mode 100644 index 67825a221..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CurrencyRate.cs +++ /dev/null @@ -1,28 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("CurrencyRate", Schema = "Sales")] - public partial class CurrencyRate - { - public int CurrencyRateID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime CurrencyRateDate { get; set; } - [Required] - [StringLength(3)] - public string FromCurrencyCode { get; set; } - [Required] - [StringLength(3)] - public string ToCurrencyCode { get; set; } - [Column(TypeName = "money")] - public decimal AverageRate { get; set; } - [Column(TypeName = "money")] - public decimal EndOfDayRate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs deleted file mode 100644 index adbeedfc0..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Customer.cs +++ /dev/null @@ -1,24 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Customer", Schema = "Sales")] - public partial class Customer - { - public int CustomerID { get; set; } - public int? TerritoryID { get; set; } - [Required] - [StringLength(10)] - public string AccountNumber { get; set; } - [Required] - [StringLength(1)] - public string CustomerType { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs deleted file mode 100644 index 068816191..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/CustomerAddress.cs +++ /dev/null @@ -1,19 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("CustomerAddress", Schema = "Sales")] - public partial class CustomerAddress - { - public int CustomerID { get; set; } - public int AddressID { get; set; } - public int AddressTypeID { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs deleted file mode 100644 index 9e1056591..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Department.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Department", Schema = "HumanResources")] - public partial class Department - { - public short DepartmentID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Required] - [StringLength(50)] - public string GroupName { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs deleted file mode 100644 index 75e053b8d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Document.cs +++ /dev/null @@ -1,33 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Document", Schema = "Production")] - public partial class Document - { - public int DocumentID { get; set; } - [Required] - [StringLength(50)] - public string Title { get; set; } - [Required] - [StringLength(400)] - public string FileName { get; set; } - [Required] - [StringLength(8)] - public string FileExtension { get; set; } - [Required] - [StringLength(5)] - public string Revision { get; set; } - public int ChangeNumber { get; set; } - public byte Status { get; set; } - public string DocumentSummary { get; set; } - [Column("Document")] - public byte[] Document1 { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs index 965e47058..fb9064a0f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Employee.cs @@ -3,8 +3,9 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using OpenRiaServices.Server; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("Employee", Schema = "HumanResources")] public partial class Employee @@ -38,5 +39,10 @@ public partial class Employee public Guid rowguid { get; set; } [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } + + [Include] + public virtual Employee Manager { get; set; } + public virtual Contact Contact { get; set; } + public virtual SalesPerson SalesPerson { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs deleted file mode 100644 index a40152cc5..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeAddress.cs +++ /dev/null @@ -1,18 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("EmployeeAddress", Schema = "HumanResources")] - public partial class EmployeeAddress - { - public int EmployeeID { get; set; } - public int AddressID { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs deleted file mode 100644 index 853d8da1c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeeDepartmentHistory.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("EmployeeDepartmentHistory", Schema = "HumanResources")] - public partial class EmployeeDepartmentHistory - { - public int EmployeeID { get; set; } - public short DepartmentID { get; set; } - public byte ShiftID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? EndDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs deleted file mode 100644 index 3842b92b6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/EmployeePayHistory.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("EmployeePayHistory", Schema = "HumanResources")] - public partial class EmployeePayHistory - { - public int EmployeeID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime RateChangeDate { get; set; } - [Column(TypeName = "money")] - public decimal Rate { get; set; } - public byte PayFrequency { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs deleted file mode 100644 index 676d92ab2..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Illustration.cs +++ /dev/null @@ -1,18 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Illustration", Schema = "Production")] - public partial class Illustration - { - public int IllustrationID { get; set; } - [Column(TypeName = "xml")] - public string Diagram { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs deleted file mode 100644 index 81f7ab7e4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Individual.cs +++ /dev/null @@ -1,19 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Individual", Schema = "Sales")] - public partial class Individual - { - public int CustomerID { get; set; } - public int ContactID { get; set; } - [Column(TypeName = "xml")] - public string Demographics { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs deleted file mode 100644 index 5aa510e79..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/JobCandidate.cs +++ /dev/null @@ -1,19 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("JobCandidate", Schema = "HumanResources")] - public partial class JobCandidate - { - public int JobCandidateID { get; set; } - public int? EmployeeID { get; set; } - [Column(TypeName = "xml")] - public string Resume { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs deleted file mode 100644 index 3ff90d05c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Location.cs +++ /dev/null @@ -1,23 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Location", Schema = "Production")] - public partial class Location - { - public short LocationID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "money")] - public decimal CostRate { get; set; } - [Column(TypeName = "decimal(8, 2)")] - public decimal Availability { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs index df509f6a6..5a388171b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs @@ -3,8 +3,9 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using OpenRiaServices.Server; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("Product", Schema = "Production")] public partial class Product @@ -20,6 +21,7 @@ public partial class Product public bool FinishedGoodsFlag { get; set; } [StringLength(15)] public string Color { get; set; } + [Exclude] public short SafetyStockLevel { get; set; } public short ReorderPoint { get; set; } [Column(TypeName = "money")] @@ -32,6 +34,7 @@ public partial class Product public string SizeUnitMeasureCode { get; set; } [StringLength(3)] public string WeightUnitMeasureCode { get; set; } + [RoundtripOriginal] [Column(TypeName = "decimal(8, 2)")] public decimal? Weight { get; set; } public int DaysToManufacture { get; set; } @@ -52,5 +55,7 @@ public partial class Product public Guid rowguid { get; set; } [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } + + public ProductSubcategory ProductSubcategory { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs deleted file mode 100644 index c8b2dfcb4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCategory.cs +++ /dev/null @@ -1,20 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductCategory", Schema = "Production")] - public partial class ProductCategory - { - public int ProductCategoryID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs deleted file mode 100644 index 568d75784..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductCostHistory.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductCostHistory", Schema = "Production")] - public partial class ProductCostHistory - { - public int ProductID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? EndDate { get; set; } - [Column(TypeName = "money")] - public decimal StandardCost { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs deleted file mode 100644 index 9930cc36f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDescription.cs +++ /dev/null @@ -1,20 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductDescription", Schema = "Production")] - public partial class ProductDescription - { - public int ProductDescriptionID { get; set; } - [Required] - [StringLength(400)] - public string Description { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs deleted file mode 100644 index e4c36afa3..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductDocument.cs +++ /dev/null @@ -1,17 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductDocument", Schema = "Production")] - public partial class ProductDocument - { - public int ProductID { get; set; } - public int DocumentID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs deleted file mode 100644 index 9a1fd9d4d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductInventory.cs +++ /dev/null @@ -1,23 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductInventory", Schema = "Production")] - public partial class ProductInventory - { - public int ProductID { get; set; } - public short LocationID { get; set; } - [Required] - [StringLength(10)] - public string Shelf { get; set; } - public byte Bin { get; set; } - public short Quantity { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs deleted file mode 100644 index 49c37f5a8..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductListPriceHistory.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductListPriceHistory", Schema = "Production")] - public partial class ProductListPriceHistory - { - public int ProductID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? EndDate { get; set; } - [Column(TypeName = "money")] - public decimal ListPrice { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs deleted file mode 100644 index 0343f4538..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModel.cs +++ /dev/null @@ -1,24 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductModel", Schema = "Production")] - public partial class ProductModel - { - public int ProductModelID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "xml")] - public string CatalogDescription { get; set; } - [Column(TypeName = "xml")] - public string Instructions { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs deleted file mode 100644 index 34645dbd7..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelIllustration.cs +++ /dev/null @@ -1,17 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductModelIllustration", Schema = "Production")] - public partial class ProductModelIllustration - { - public int ProductModelID { get; set; } - public int IllustrationID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs deleted file mode 100644 index 43ce57fa9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductModelProductDescriptionCulture.cs +++ /dev/null @@ -1,20 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductModelProductDescriptionCulture", Schema = "Production")] - public partial class ProductModelProductDescriptionCulture - { - public int ProductModelID { get; set; } - public int ProductDescriptionID { get; set; } - [Required] - [StringLength(6)] - public string CultureID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs deleted file mode 100644 index 1b57e0709..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductPhoto.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductPhoto", Schema = "Production")] - public partial class ProductPhoto - { - public int ProductPhotoID { get; set; } - public byte[] ThumbNailPhoto { get; set; } - [StringLength(50)] - public string ThumbnailPhotoFileName { get; set; } - public byte[] LargePhoto { get; set; } - [StringLength(50)] - public string LargePhotoFileName { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs deleted file mode 100644 index aaddb75ec..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductProductPhoto.cs +++ /dev/null @@ -1,18 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductProductPhoto", Schema = "Production")] - public partial class ProductProductPhoto - { - public int ProductID { get; set; } - public int ProductPhotoID { get; set; } - public bool Primary { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs deleted file mode 100644 index 149d39827..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductReview.cs +++ /dev/null @@ -1,28 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductReview", Schema = "Production")] - public partial class ProductReview - { - public int ProductReviewID { get; set; } - public int ProductID { get; set; } - [Required] - [StringLength(50)] - public string ReviewerName { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ReviewDate { get; set; } - [Required] - [StringLength(50)] - public string EmailAddress { get; set; } - public int Rating { get; set; } - [StringLength(3850)] - public string Comments { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs index 50daa5841..cf6525f28 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductSubcategory.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("ProductSubcategory", Schema = "Production")] public partial class ProductSubcategory @@ -18,4 +18,4 @@ public partial class ProductSubcategory [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs deleted file mode 100644 index e25a0c61f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ProductVendor.cs +++ /dev/null @@ -1,30 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ProductVendor", Schema = "Purchasing")] - public partial class ProductVendor - { - public int ProductID { get; set; } - public int VendorID { get; set; } - public int AverageLeadTime { get; set; } - [Column(TypeName = "money")] - public decimal StandardPrice { get; set; } - [Column(TypeName = "money")] - public decimal? LastReceiptCost { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? LastReceiptDate { get; set; } - public int MinOrderQty { get; set; } - public int MaxOrderQty { get; set; } - public int? OnOrderQty { get; set; } - [Required] - [StringLength(3)] - public string UnitMeasureCode { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs similarity index 82% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderHeader.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs index bee9017ab..278303215 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderHeader.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrder.cs @@ -3,11 +3,12 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using OpenRiaServices.Server; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("PurchaseOrderHeader", Schema = "Purchasing")] - public partial class PurchaseOrderHeader + public partial class PurchaseOrder { public int PurchaseOrderID { get; set; } public byte RevisionNumber { get; set; } @@ -29,5 +30,8 @@ public partial class PurchaseOrderHeader public decimal TotalDue { get; set; } [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } + + [Include] + public ICollection PurchaseOrderDetails { get; set; } = new HashSet(); } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs index 01fab3f5d..82c90e064 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/PurchaseOrderDetail.cs @@ -3,8 +3,9 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using OpenRiaServices.Server; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("PurchaseOrderDetail", Schema = "Purchasing")] public partial class PurchaseOrderDetail @@ -27,5 +28,10 @@ public partial class PurchaseOrderDetail public decimal StockedQty { get; set; } [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } + + [Include] + public Product Product { get; set; } + + public PurchaseOrder PurchaseOrder { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs deleted file mode 100644 index 22e628067..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderDetail.cs +++ /dev/null @@ -1,29 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SalesOrderDetail", Schema = "Sales")] - public partial class SalesOrderDetail - { - public int SalesOrderID { get; set; } - public int SalesOrderDetailID { get; set; } - [StringLength(25)] - public string CarrierTrackingNumber { get; set; } - public short OrderQty { get; set; } - public int ProductID { get; set; } - public int SpecialOfferID { get; set; } - [Column(TypeName = "money")] - public decimal UnitPrice { get; set; } - [Column(TypeName = "money")] - public decimal UnitPriceDiscount { get; set; } - [Column(TypeName = "decimal(38, 6)")] - public decimal LineTotal { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs deleted file mode 100644 index 51f31fc48..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeader.cs +++ /dev/null @@ -1,54 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SalesOrderHeader", Schema = "Sales")] - public partial class SalesOrderHeader - { - public int SalesOrderID { get; set; } - public byte RevisionNumber { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime OrderDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime DueDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? ShipDate { get; set; } - public byte Status { get; set; } - public bool OnlineOrderFlag { get; set; } - [Required] - [StringLength(25)] - public string SalesOrderNumber { get; set; } - [StringLength(25)] - public string PurchaseOrderNumber { get; set; } - [StringLength(15)] - public string AccountNumber { get; set; } - public int CustomerID { get; set; } - public int ContactID { get; set; } - public int? SalesPersonID { get; set; } - public int? TerritoryID { get; set; } - public int BillToAddressID { get; set; } - public int ShipToAddressID { get; set; } - public int ShipMethodID { get; set; } - public int? CreditCardID { get; set; } - [StringLength(15)] - public string CreditCardApprovalCode { get; set; } - public int? CurrencyRateID { get; set; } - [Column(TypeName = "money")] - public decimal SubTotal { get; set; } - [Column(TypeName = "money")] - public decimal TaxAmt { get; set; } - [Column(TypeName = "money")] - public decimal Freight { get; set; } - [Column(TypeName = "money")] - public decimal TotalDue { get; set; } - [StringLength(128)] - public string Comment { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs deleted file mode 100644 index cf90b2f2f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesOrderHeaderSalesReason.cs +++ /dev/null @@ -1,17 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SalesOrderHeaderSalesReason", Schema = "Sales")] - public partial class SalesOrderHeaderSalesReason - { - public int SalesOrderID { get; set; } - public int SalesReasonID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs index 2056591ee..b59f97c2d 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPerson.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("SalesPerson", Schema = "Sales")] public partial class SalesPerson @@ -24,5 +24,8 @@ public partial class SalesPerson public Guid rowguid { get; set; } [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } + + public Employee Employee { get; set; } + public SalesTerritory SalesTerritory { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs deleted file mode 100644 index 8d8672a55..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesPersonQuotaHistory.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SalesPersonQuotaHistory", Schema = "Sales")] - public partial class SalesPersonQuotaHistory - { - public int SalesPersonID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime QuotaDate { get; set; } - [Column(TypeName = "money")] - public decimal SalesQuota { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs deleted file mode 100644 index 098f051f1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesReason.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SalesReason", Schema = "Sales")] - public partial class SalesReason - { - public int SalesReasonID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Required] - [StringLength(50)] - public string ReasonType { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs deleted file mode 100644 index 26c56e6ff..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTaxRate.cs +++ /dev/null @@ -1,24 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SalesTaxRate", Schema = "Sales")] - public partial class SalesTaxRate - { - public int SalesTaxRateID { get; set; } - public int StateProvinceID { get; set; } - public byte TaxType { get; set; } - [Column(TypeName = "money")] - public decimal TaxRate { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs index 2fff70867..396bd65e4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritory.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace EFCoreModels.AdventureWorks.AdventureWorks +namespace EFCoreModels.AdventureWorks { [Table("SalesTerritory", Schema = "Sales")] public partial class SalesTerritory @@ -31,4 +31,4 @@ public partial class SalesTerritory [Column(TypeName = "smalldatetime")] public DateTime ModifiedDate { get; set; } } -} \ No newline at end of file +} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs deleted file mode 100644 index d5048d4f1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SalesTerritoryHistory.cs +++ /dev/null @@ -1,22 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SalesTerritoryHistory", Schema = "Sales")] - public partial class SalesTerritoryHistory - { - public int SalesPersonID { get; set; } - public int TerritoryID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? EndDate { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs deleted file mode 100644 index 78d58e7c6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ScrapReason.cs +++ /dev/null @@ -1,19 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ScrapReason", Schema = "Production")] - public partial class ScrapReason - { - public short ScrapReasonID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs deleted file mode 100644 index f34bc885b..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Shift.cs +++ /dev/null @@ -1,23 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Shift", Schema = "HumanResources")] - public partial class Shift - { - public byte ShiftID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartTime { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime EndTime { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs deleted file mode 100644 index 4c25976ec..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShipMethod.cs +++ /dev/null @@ -1,24 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ShipMethod", Schema = "Purchasing")] - public partial class ShipMethod - { - public int ShipMethodID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "money")] - public decimal ShipBase { get; set; } - [Column(TypeName = "money")] - public decimal ShipRate { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs deleted file mode 100644 index cea76b5c9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/ShoppingCartItem.cs +++ /dev/null @@ -1,23 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("ShoppingCartItem", Schema = "Sales")] - public partial class ShoppingCartItem - { - public int ShoppingCartItemID { get; set; } - [Required] - [StringLength(50)] - public string ShoppingCartID { get; set; } - public int Quantity { get; set; } - public int ProductID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime DateCreated { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs deleted file mode 100644 index 3a9ba0c1c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOffer.cs +++ /dev/null @@ -1,34 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SpecialOffer", Schema = "Sales")] - public partial class SpecialOffer - { - public int SpecialOfferID { get; set; } - [Required] - [StringLength(255)] - public string Description { get; set; } - [Column(TypeName = "money")] - public decimal DiscountPct { get; set; } - [Required] - [StringLength(50)] - public string Type { get; set; } - [Required] - [StringLength(50)] - public string Category { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime EndDate { get; set; } - public int MinQty { get; set; } - public int? MaxQty { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs deleted file mode 100644 index 0676de783..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/SpecialOfferProduct.cs +++ /dev/null @@ -1,18 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("SpecialOfferProduct", Schema = "Sales")] - public partial class SpecialOfferProduct - { - public int SpecialOfferID { get; set; } - public int ProductID { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs deleted file mode 100644 index e8ddefc02..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StateProvince.cs +++ /dev/null @@ -1,28 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("StateProvince", Schema = "Person")] - public partial class StateProvince - { - public int StateProvinceID { get; set; } - [Required] - [StringLength(3)] - public string StateProvinceCode { get; set; } - [Required] - [StringLength(3)] - public string CountryRegionCode { get; set; } - public bool IsOnlyStateProvinceFlag { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - public int TerritoryID { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs deleted file mode 100644 index 08505ba63..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Store.cs +++ /dev/null @@ -1,23 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Store", Schema = "Sales")] - public partial class Store - { - public int CustomerID { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - public int? SalesPersonID { get; set; } - [Column(TypeName = "xml")] - public string Demographics { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs deleted file mode 100644 index 564e81fac..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/StoreContact.cs +++ /dev/null @@ -1,19 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("StoreContact", Schema = "Sales")] - public partial class StoreContact - { - public int CustomerID { get; set; } - public int ContactID { get; set; } - public int ContactTypeID { get; set; } - public Guid rowguid { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs deleted file mode 100644 index 7c2d5a277..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistory.cs +++ /dev/null @@ -1,27 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("TransactionHistory", Schema = "Production")] - public partial class TransactionHistory - { - public int TransactionID { get; set; } - public int ProductID { get; set; } - public int ReferenceOrderID { get; set; } - public int ReferenceOrderLineID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime TransactionDate { get; set; } - [Required] - [StringLength(1)] - public string TransactionType { get; set; } - public int Quantity { get; set; } - [Column(TypeName = "money")] - public decimal ActualCost { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs deleted file mode 100644 index 301e8549d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/TransactionHistoryArchive.cs +++ /dev/null @@ -1,27 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("TransactionHistoryArchive", Schema = "Production")] - public partial class TransactionHistoryArchive - { - public int TransactionID { get; set; } - public int ProductID { get; set; } - public int ReferenceOrderID { get; set; } - public int ReferenceOrderLineID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime TransactionDate { get; set; } - [Required] - [StringLength(1)] - public string TransactionType { get; set; } - public int Quantity { get; set; } - [Column(TypeName = "money")] - public decimal ActualCost { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs deleted file mode 100644 index d222e6197..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/UnitMeasure.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("UnitMeasure", Schema = "Production")] - public partial class UnitMeasure - { - [Required] - [StringLength(3)] - public string UnitMeasureCode { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs deleted file mode 100644 index a9328aabb..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Vendor.cs +++ /dev/null @@ -1,27 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("Vendor", Schema = "Purchasing")] - public partial class Vendor - { - public int VendorID { get; set; } - [Required] - [StringLength(15)] - public string AccountNumber { get; set; } - [Required] - [StringLength(50)] - public string Name { get; set; } - public byte CreditRating { get; set; } - public bool PreferredVendorStatus { get; set; } - public bool ActiveFlag { get; set; } - [StringLength(1024)] - public string PurchasingWebServiceURL { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs deleted file mode 100644 index 9dc0e988c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorAddress.cs +++ /dev/null @@ -1,18 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("VendorAddress", Schema = "Purchasing")] - public partial class VendorAddress - { - public int VendorID { get; set; } - public int AddressID { get; set; } - public int AddressTypeID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs deleted file mode 100644 index 3b02b2ba4..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/VendorContact.cs +++ /dev/null @@ -1,18 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("VendorContact", Schema = "Purchasing")] - public partial class VendorContact - { - public int VendorID { get; set; } - public int ContactID { get; set; } - public int ContactTypeID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs deleted file mode 100644 index cbf94c35d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrder.cs +++ /dev/null @@ -1,27 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("WorkOrder", Schema = "Production")] - public partial class WorkOrder - { - public int WorkOrderID { get; set; } - public int ProductID { get; set; } - public int OrderQty { get; set; } - public int StockedQty { get; set; } - public short ScrappedQty { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime StartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? EndDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime DueDate { get; set; } - public short? ScrapReasonID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs deleted file mode 100644 index babc67b63..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/WorkOrderRouting.cs +++ /dev/null @@ -1,33 +0,0 @@ -// This file has been auto generated by EF Core Power Tools. -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace EFCoreModels.AdventureWorks.AdventureWorks -{ - [Table("WorkOrderRouting", Schema = "Production")] - public partial class WorkOrderRouting - { - public int WorkOrderID { get; set; } - public int ProductID { get; set; } - public short OperationSequence { get; set; } - public short LocationID { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ScheduledStartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ScheduledEndDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? ActualStartDate { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime? ActualEndDate { get; set; } - [Column(TypeName = "decimal(9, 4)")] - public decimal? ActualResourceHrs { get; set; } - [Column(TypeName = "money")] - public decimal PlannedCost { get; set; } - [Column(TypeName = "money")] - public decimal? ActualCost { get; set; } - [Column(TypeName = "smalldatetime")] - public DateTime ModifiedDate { get; set; } - } -} \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json index 198ed47ce..f4edfdd69 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json @@ -1,303 +1,51 @@ { - "CodeGenerationMode": 1, - "ContextClassName": "AdventureworksContext", - "ContextNamespace": null, - "DefaultDacpacSchema": null, - "FilterSchemas": false, - "IncludeConnectionString": true, - "ModelNamespace": null, - "OutputContextPath": "AdventureWorks", - "OutputPath": "AdventureWorks", - "ProjectRootNamespace": "EFCoreModels.AdventureWorks", - "Schemas": null, - "SelectedHandlebarsLanguage": 0, - "SelectedToBeGenerated": 0, - "Tables": [ - { - "Name": "[HumanResources].[Department]", - "ObjectType": 0 - }, - { - "Name": "[HumanResources].[Employee]", - "ObjectType": 0 - }, - { - "Name": "[HumanResources].[EmployeeAddress]", - "ObjectType": 0 - }, - { - "Name": "[HumanResources].[EmployeeDepartmentHistory]", - "ObjectType": 0 - }, - { - "Name": "[HumanResources].[EmployeePayHistory]", - "ObjectType": 0 - }, - { - "Name": "[HumanResources].[JobCandidate]", - "ObjectType": 0 - }, - { - "Name": "[HumanResources].[Shift]", - "ObjectType": 0 - }, - { - "Name": "[Person].[Address]", - "ObjectType": 0 - }, - { - "Name": "[Person].[AddressType]", - "ObjectType": 0 - }, - { - "Name": "[Person].[Contact]", - "ObjectType": 0 - }, - { - "Name": "[Person].[ContactType]", - "ObjectType": 0 - }, - { - "Name": "[Person].[CountryRegion]", - "ObjectType": 0 - }, - { - "Name": "[Person].[StateProvince]", - "ObjectType": 0 - }, - { - "Name": "[Production].[BillOfMaterials]", - "ObjectType": 0 - }, - { - "Name": "[Production].[Culture]", - "ObjectType": 0 - }, - { - "Name": "[Production].[Document]", - "ObjectType": 0 - }, - { - "Name": "[Production].[Illustration]", - "ObjectType": 0 - }, - { - "Name": "[Production].[Location]", - "ObjectType": 0 - }, - { - "Name": "[Production].[Product]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductCategory]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductCostHistory]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductDescription]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductDocument]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductInventory]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductListPriceHistory]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductModel]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductModelIllustration]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductModelProductDescriptionCulture]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductPhoto]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductProductPhoto]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductReview]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ProductSubcategory]", - "ObjectType": 0 - }, - { - "Name": "[Production].[ScrapReason]", - "ObjectType": 0 - }, - { - "Name": "[Production].[TransactionHistory]", - "ObjectType": 0 - }, - { - "Name": "[Production].[TransactionHistoryArchive]", - "ObjectType": 0 - }, - { - "Name": "[Production].[UnitMeasure]", - "ObjectType": 0 - }, - { - "Name": "[Production].[WorkOrder]", - "ObjectType": 0 - }, - { - "Name": "[Production].[WorkOrderRouting]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[ProductVendor]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[PurchaseOrderDetail]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[PurchaseOrderHeader]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[ShipMethod]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[Vendor]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[VendorAddress]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[VendorContact]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[ContactCreditCard]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[CountryRegionCurrency]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[CreditCard]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[Currency]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[CurrencyRate]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[Customer]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[CustomerAddress]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[Individual]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesOrderDetail]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesOrderHeader]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesOrderHeaderSalesReason]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesPerson]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesPersonQuotaHistory]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesReason]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesTaxRate]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesTerritory]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SalesTerritoryHistory]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[ShoppingCartItem]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SpecialOffer]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[SpecialOfferProduct]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[Store]", - "ObjectType": 0 - }, - { - "Name": "[Sales].[StoreContact]", - "ObjectType": 0 - } - ], - "UiHint": "AdventureWorks (WebsiteFullTrust)", - "UseBoolPropertiesWithoutDefaultSql": false, - "UseDatabaseNames": true, - "UseDbContextSplitting": false, - "UseFluentApiOnly": false, - "UseHandleBars": false, - "UseHierarchyId": false, - "UseInflector": true, - "UseLegacyPluralizer": true, - "UseManyToManyEntity": false, - "UseNoConstructor": false, - "UseNoDefaultConstructor": false, - "UseNoNavigations": false, - "UseNoObjectFilter": false, - "UseNodaTime": false, - "UseNullableReferences": false, - "UseSchemaFolders": false, - "UseSpatial": false + "CodeGenerationMode": 1, + "ContextClassName": "AdventureworksContext", + "ContextNamespace": null, + "DefaultDacpacSchema": null, + "FilterSchemas": false, + "IncludeConnectionString": true, + "ModelNamespace": null, + "OutputContextPath": "AdventureWorks", + "OutputPath": "AdventureWorks", + "ProjectRootNamespace": "EFCoreModels", + "Schemas": null, + "SelectedHandlebarsLanguage": 0, + "SelectedToBeGenerated": 0, + "Tables": [ + { + "Name": "[HumanResources].[Employee]", + "ObjectType": 0 + }, + { + "Name": "[Production].[Product]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[PurchaseOrderDetail]", + "ObjectType": 0 + }, + { + "Name": "[Purchasing].[PurchaseOrderHeader]", + "ObjectType": 0 + } + ], + "UiHint": "AdventureWorks (WebsiteFullTrust)", + "UseBoolPropertiesWithoutDefaultSql": false, + "UseDatabaseNames": true, + "UseDbContextSplitting": false, + "UseFluentApiOnly": false, + "UseHandleBars": false, + "UseHierarchyId": false, + "UseInflector": true, + "UseLegacyPluralizer": true, + "UseManyToManyEntity": false, + "UseNoConstructor": false, + "UseNoDefaultConstructor": false, + "UseNoNavigations": false, + "UseNoObjectFilter": false, + "UseNodaTime": false, + "UseNullableReferences": false, + "UseSchemaFolders": false, + "UseSpatial": false } \ No newline at end of file diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs new file mode 100644 index 000000000..a4f1bb08d --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs @@ -0,0 +1,142 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Runtime.Serialization; +using OpenRiaServices.EntityFrameworkCore; +using OpenRiaServices.Server; +using EFCoreModels.AdventureWorks; +using Microsoft.EntityFrameworkCore; + +namespace TestDomainServices.EFCore +{ + [EnableClientAccess] + public partial class Catalog : DbDomainServiceEFCore + { + protected override AdventureworksContext CreateDbContext() + { + return new AdventureworksContext(); + } + + #region Product methods + [Query] + public IQueryable GetProducts() + { + return from p in this.DbContext.Products + select p; + } + + [Query] + [OutputCache(OutputCacheLocation.Server, duration: 5)] + public IQueryable GetProductsWithCaching() + { + return from p in this.DbContext.Products + select p; + } + + [Query] + public IQueryable GetProductsWithCustomTotalCount(out int totalCount) + { + totalCount = 6; + return from p in this.DbContext.Products + select p; + } + + [Query] + public IQueryable GetProductsByCategory(int subCategoryID) + { + return from p in this.DbContext.Products + where p.ProductSubcategory.ProductSubcategoryID == subCategoryID + select p; + } + + [Insert] + public void AddProduct(Product product) + { + this.DbContext.Products.Add(product); + } + + [Update] + public void UpdateProduct(Product current) + { + this.DbContext.Products.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + [Delete] + public void DeleteProduct(Product current) + { + this.DbContext.Products.Attach(current); + this.DbContext.Products.Remove(current); + } + #endregion + + #region PurchaseOrder methods + [Query] + public IQueryable GetPurchaseOrders() + { + return this.DbContext.PurchaseOrders.Include("PurchaseOrderDetails").Include("PurchaseOrderDetails.Product"); + } + + [Insert] + public void AddPurchaseOrder(PurchaseOrder purchaseOrder) + { + this.DbContext.PurchaseOrders.Add(purchaseOrder); + } + + [Update] + public void UpdatePurchaseOrder(PurchaseOrder current) + { + this.DbContext.PurchaseOrders.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + [Delete] + public void DeletePurchaseOrder(PurchaseOrder current) + { + this.DbContext.PurchaseOrders.Attach(current); + this.DbContext.PurchaseOrders.Remove(current); + } + #endregion + + #region PurchaseOrderDetail methods + [Insert] + public void InsertPurchaseOrderDetail(PurchaseOrderDetail purchaseOrderDetail) + { + this.DbContext.PurchaseOrderDetails.Add(purchaseOrderDetail); + } + + [Update] + public void UpdatePurchaseOrderDetail(PurchaseOrderDetail current) + { + this.DbContext.PurchaseOrderDetails.AttachAsModified(current, this.ChangeSet.GetOriginal(current), this.DbContext); + } + + [Delete] + public void DeletePurchaseOrderDetail(PurchaseOrderDetail current) + { + this.DbContext.PurchaseOrderDetails.Attach(current); + this.DbContext.PurchaseOrderDetails.Remove(current); + } + #endregion + + #region Employee methods + [Query] + public IQueryable GetEmployees() + { + return this.DbContext.Employees; + } + + [Query] + public IEnumerable GetEmployeeInfos() + { + var results = from e in this.DbContext.Employees + select new + { + e.EmployeeID, + e.Contact.FirstName, + e.Contact.LastName, + e.SalesPerson.SalesTerritory.TerritoryID + }; + return results as IEnumerable; + } + #endregion + } +} From fbcbfeee4306f2c3b4f722461e5e8fc51fa36f43 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sat, 19 Feb 2022 20:41:07 +0100 Subject: [PATCH 46/99] delete unused code --- .../Test/CodeFirstModel/App.config | 13 --- .../Test/CodeFirstModel/Category.cs | 24 ------ .../Test/CodeFirstModel/Customer.cs | 52 ------------ .../CodeFirstModel/CustomerDemographic.cs | 20 ----- .../Test/CodeFirstModel/DbContextModel.cs | 81 ------------------- .../EFCoreCodeFirstModels_dont_care.csproj | 37 --------- .../Test/CodeFirstModel/Employee.cs | 45 ----------- .../CodeFirstModel/EmployeeTerritories.cs | 14 ---- .../Test/CodeFirstModel/Order.cs | 69 ---------------- .../Test/CodeFirstModel/Order_Detail.cs | 33 -------- .../Test/CodeFirstModel/Product.cs | 65 --------------- .../Test/CodeFirstModel/ProductInfo.cs | 48 ----------- .../CodeFirstModel/Properties/AssemblyInfo.cs | 13 --- .../Test/CodeFirstModel/Region.cs | 22 ----- .../Test/CodeFirstModel/Shipper.cs | 19 ----- .../Test/CodeFirstModel/Supplier.cs | 28 ------- .../Test/CodeFirstModel/Territory.cs | 23 ------ 17 files changed, 606 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels_dont_care.csproj delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config deleted file mode 100644 index ba200051a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/App.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - -
- - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs deleted file mode 100644 index e981a6c45..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Category.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - - public partial class Category - { - public Category() - { - this.Products = new HashSet(); - } - - [ConcurrencyCheck] - public int CategoryID { get; set; } - [Required] - [StringLength(15)] - public string CategoryName { get; set; } - public string Description { get; set; } - public byte[] Picture { get; set; } - - public virtual ICollection Products { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs deleted file mode 100644 index 47d6cf2c1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Customer.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - - public partial class Customer - { - public Customer() - { - this.Orders = new HashSet(); - this.CustomerDemographics = new HashSet(); - } - - [StringLength(15)] - [ConcurrencyCheck] - public string CustomerID { get; set; } - [StringLength(40)] - [ConcurrencyCheck] - public string CompanyName { get; set; } - [StringLength(30)] - [ConcurrencyCheck] - public string ContactName { get; set; } - [StringLength(30)] - [ConcurrencyCheck] - public string ContactTitle { get; set; } - [StringLength(60)] - [ConcurrencyCheck] - public string Address { get; set; } - [StringLength(15)] - [ConcurrencyCheck] - public string City { get; set; } - [StringLength(15)] - [ConcurrencyCheck] - public string Region { get; set; } - [StringLength(10)] - [ConcurrencyCheck] - public string PostalCode { get; set; } - [StringLength(15)] - [ConcurrencyCheck] - public string Country { get; set; } - [StringLength(24)] - [ConcurrencyCheck] - public string Phone { get; set; } - [StringLength(24)] - [ConcurrencyCheck] - public string Fax { get; set; } - - public virtual ICollection Orders { get; set; } - public virtual ICollection CustomerDemographics { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs deleted file mode 100644 index 8e29139a1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/CustomerDemographic.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - - public partial class CustomerDemographic - { - public CustomerDemographic() - { - this.Customers = new HashSet(); - } - - [Key] - public string CustomerTypeID { get; set; } - public string CustomerDesc { get; set; } - - public virtual ICollection Customers { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs deleted file mode 100644 index e048db8bb..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/DbContextModel.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System.ComponentModel.DataAnnotations.Schema; -using System.Runtime.Serialization; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata; -using System.Configuration; - -// These assembly attributes allow us to serialize different CLR types into the same contract -[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", - ClrNamespace = "CodeFirstModels")] - -namespace CodeFirstModels -{ - public partial class EFCoreCFNorthwindEntities : DbContext - { - private string _connection; - - public EFCoreCFNorthwindEntities() - : this("name=Northwind") - { - - } - - public EFCoreCFNorthwindEntities(string connection) - { - _connection = connection; - } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder.UseSqlServer(_connection); - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.Entity() - .HasMany(c => c.Orders) - .WithOne(c => c.Shipper) - .HasForeignKey(c => c.ShipVia); - - modelBuilder.Entity().ToTable("Order Details"); - - modelBuilder.Entity().ToTable("Region"); - - modelBuilder.Entity() - .HasKey(et => new { et.EmployeeID, et.TerritoryID }); - - // In EF Core 3.1 a M2M link entity is required. This should not be needed in EF Core 5 and upwards - modelBuilder.Entity() - .HasOne(bc => bc.Employee) - .WithMany(b => b.EmployeeTerritories) - .HasForeignKey(bc => bc.EmployeeID); - - modelBuilder.Entity() - .HasOne(bc => bc.Territory) - .WithMany(c => c.EmployeeTerritories) - .HasForeignKey(bc => bc.TerritoryID); - - modelBuilder.Entity() - .Property(r => r.RegionID) - .ValueGeneratedNever(); - - modelBuilder.Entity() - .HasKey(r => r.RegionID); - - } - - public DbSet Categories { get; set; } - public DbSet CustomerDemographics { get; set; } - public DbSet Customers { get; set; } - public DbSet Employees { get; set; } - public DbSet Order_Details { get; set; } - public DbSet Orders { get; set; } - public DbSet Products { get; set; } - public DbSet Regions { get; set; } - public DbSet Shippers { get; set; } - public DbSet Suppliers { get; set; } - public DbSet Territories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels_dont_care.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels_dont_care.csproj deleted file mode 100644 index 9e302dd4d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EFCoreCodeFirstModels_dont_care.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - 618 - CodeFirstModels - CodeFirstModels - net472 - $(DefineConstants);DBCONTEXT - 1.0.0.0 - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs deleted file mode 100644 index 38146376c..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Employee.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - - public partial class Employee - { - public Employee() - { - this.Employees1 = new HashSet(); - this.Orders = new HashSet(); - this.EmployeeTerritories = new HashSet(); - } - - [Key] - [Column("EmployeeID")] - public int EmployeeID { get; set; } - public string LastName { get; set; } - public string FirstName { get; set; } - public string Title { get; set; } - public string TitleOfCourtesy { get; set; } - public Nullable BirthDate { get; set; } - public Nullable HireDate { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Region { get; set; } - public string PostalCode { get; set; } - public string Country { get; set; } - public string HomePhone { get; set; } - public string Extension { get; set; } - public byte[] Photo { get; set; } - public string Notes { get; set; } - [ForeignKey("Employees1")] - public Nullable ReportsTo { get; set; } - public string PhotoPath { get; set; } - - public virtual ICollection Employees1 { get; set; } - public virtual Employee Employee1 { get; set; } - - public virtual ICollection Orders { get; set; } - public virtual ICollection EmployeeTerritories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs deleted file mode 100644 index 21e1f1f49..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/EmployeeTerritories.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace CodeFirstModels -{ - public partial class EmployeeTerritory - { - public int EmployeeID { get; set; } - - public Employee Employee { get; set; } - - public int TerritoryID { get; set; } - - public Territory Territory { get; set; } - - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs deleted file mode 100644 index a24677d06..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order.cs +++ /dev/null @@ -1,69 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Runtime.Serialization; - using OpenRiaServices.Server; - - public partial class Order - { - public Order() - { - this.Order_Details = new HashSet(); - } - - [ConcurrencyCheck] - public int OrderID { get; set; } - [StringLength(5)] - [ConcurrencyCheck] - public string CustomerID { get; set; } - [ConcurrencyCheck] - public Nullable EmployeeID { get; set; } - [ConcurrencyCheck] - public Nullable OrderDate { get; set; } - [ConcurrencyCheck] - public Nullable RequiredDate { get; set; } - [ConcurrencyCheck] - public Nullable ShippedDate { get; set; } - [ConcurrencyCheck] - public Nullable ShipVia { get; set; } - [ConcurrencyCheck] - public Nullable Freight { get; set; } - [StringLength(40)] - [ConcurrencyCheck] - public string ShipName { get; set; } - [StringLength(60)] - [ConcurrencyCheck] - public string ShipAddress { get; set; } - [StringLength(15)] - [ConcurrencyCheck] - public string ShipCity { get; set; } - [StringLength(15)] - [ConcurrencyCheck] - public string ShipRegion { get; set; } - [StringLength(10)] - [ConcurrencyCheck] - public string ShipPostalCode { get; set; } - [StringLength(15)] - [ConcurrencyCheck] - public string ShipCountry { get; set; } - - public virtual Customer Customer { get; set; } - public virtual Employee Employee { get; set; } - [Include] - public virtual ICollection Order_Details { get; set; } - public virtual Shipper Shipper { get; set; } - - // Calculated property. Used to test that user-defined properties work properly. - [NotMapped] - public string FormattedName - { - get - { - return "OrderID: " + this.OrderID.ToString(); - } - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs deleted file mode 100644 index 72d35f454..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Order_Detail.cs +++ /dev/null @@ -1,33 +0,0 @@ - - -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using OpenRiaServices.Server; - using System.ComponentModel.DataAnnotations.Schema; - public partial class Order_Detail - { - [Key] - [Column(Order=0)] - [ConcurrencyCheck] - public int OrderID { get; set; } - [Key] - [Column(Order = 1)] - [ConcurrencyCheck] - public int ProductID { get; set; } - [ConcurrencyCheck] - public decimal UnitPrice { get; set; } - [ConcurrencyCheck] - public short Quantity { get; set; } - [ConcurrencyCheck] - public float Discount { get; set; } - - [ForeignKey("OrderID")] - public virtual Order Order { get; set; } - [Include] - [ForeignKey("ProductID")] - public virtual Product Product { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs deleted file mode 100644 index 04dcd9db0..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Product.cs +++ /dev/null @@ -1,65 +0,0 @@ - - -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using System.ComponentModel.DataAnnotations.Schema; - using System.Runtime.Serialization; - using OpenRiaServices.Server; - - public partial class Product - { - public Product() - { - this.Order_Details = new HashSet(); - } - - public int ProductID { get; set; } - [Required] - [StringLength(40)] - [ConcurrencyCheck] - public string ProductName { get; set; } - [ConcurrencyCheck] - public Nullable SupplierID { get; set; } - [ConcurrencyCheck] - public Nullable CategoryID { get; set; } - [StringLength(20)] - [ConcurrencyCheck] - public string QuantityPerUnit { get; set; } - [ConcurrencyCheck] - public Nullable UnitPrice { get; set; } - [ConcurrencyCheck] - public Nullable UnitsInStock { get; set; } - [ConcurrencyCheck] - public Nullable UnitsOnOrder { get; set; } - [ConcurrencyCheck] - public Nullable ReorderLevel { get; set; } - [ConcurrencyCheck] - public bool Discontinued { get; set; } - - [Include("CategoryName", "CategoryName")] - public virtual Category Category { get; set; } - - public virtual ICollection Order_Details { get; set; } - - [Include("CompanyName", "SupplierName")] - public virtual Supplier Supplier { get; set; } - - private string _resolveMethod = String.Empty; - [DataMember] - [NotMapped] - public string ResolveMethod - { - get - { - return _resolveMethod; - } - set - { - _resolveMethod = value; - } - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs deleted file mode 100644 index 447677bd5..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/ProductInfo.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.ComponentModel.DataAnnotations; - -namespace CodeFirstModels -{ - public class ProductInfo - { - public static ProductInfo CreateProductInfo(int productID, string productName, string categoryName, string supplierName) - { - ProductInfo prodInfo = new ProductInfo(); - prodInfo.ProductID = productID; - prodInfo.ProductName = productName; - prodInfo.CategoryName = categoryName; - prodInfo.SupplierName = supplierName; - return prodInfo; - } - - [Key] - public int ProductID - { - get; - set; - } - - public string ProductName - { - get; - set; - } - - [Editable(false)] - public string CategoryName - { - get; - set; - } - - [Editable(false)] - public string SupplierName - { - get; - set; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs deleted file mode 100644 index 16eb2068a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security; - -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM componenets. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a122da4b-cec9-4958-a0aa-ebf197bc5cfd")] diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs deleted file mode 100644 index 6583f12fa..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Region.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace CodeFirstModels -{ - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - using OpenRiaServices.Server; - - public partial class Region - { - public Region() - { - this.Territories = new HashSet(); - } - - public int RegionID { get; set; } - [StringLength(50)] - public string RegionDescription { get; set; } - - [Composition] - [Include] - public virtual ICollection Territories { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs deleted file mode 100644 index 5d87c110b..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Shipper.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - - public partial class Shipper - { - public Shipper() - { - this.Orders = new HashSet(); - } - - public int ShipperID { get; set; } - public string CompanyName { get; set; } - public string Phone { get; set; } - - public virtual ICollection Orders { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs deleted file mode 100644 index 124899a01..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Supplier.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - - public partial class Supplier - { - public Supplier() - { - this.Products = new HashSet(); - } - - public int SupplierID { get; set; } - public string CompanyName { get; set; } - public string ContactName { get; set; } - public string ContactTitle { get; set; } - public string Address { get; set; } - public string City { get; set; } - public string Region { get; set; } - public string PostalCode { get; set; } - public string Country { get; set; } - public string Phone { get; set; } - public string Fax { get; set; } - public string HomePage { get; set; } - - public virtual ICollection Products { get; set; } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs deleted file mode 100644 index 28a4aa38f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/CodeFirstModel/Territory.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace CodeFirstModels -{ - using System; - using System.Collections.Generic; - using System.ComponentModel.DataAnnotations; - - public partial class Territory - { - public Territory() - { - this.EmployeeTerritories = new HashSet(); - } - - [StringLength(20)] - public string TerritoryID { get; set; } - [StringLength(50)] - public string TerritoryDescription { get; set; } - public int RegionID { get; set; } - - public virtual Region Region { get; set; } - public virtual ICollection EmployeeTerritories { get; set; } - } -} From 3552474cac574700230bbe90c1b3386ba94413f7 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sun, 20 Feb 2022 11:09:03 +0100 Subject: [PATCH 47/99] fix reverse associations --- .../Data/CrossDomainServiceQueryTests.cs | 2 +- ...inqToEntitiesEFCoreTypeDescriptionContext.cs | 4 ++-- .../AdventureWorks/AdventureworksContext.cs | 17 ++++++----------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs index b487e6ecd..751aee789 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs @@ -511,7 +511,7 @@ public void TestLoad_WithParameters() }); EnqueueCallback(delegate { - Assert.IsTrue(catalog.Products.Count == 8); + Assert.AreEqual(8, catalog.Products.Count); }); EnqueueTestComplete(); } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs index bf1456130..2a63c3311 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs @@ -112,8 +112,8 @@ internal AssociationAttribute CreateAssociationAttribute(INavigation navigationP { Debug.Assert(fk.PrincipalEntityType == navigationProperty.DeclaringEntityType); - otherKey = FormatMemberList(fk.PrincipalKey.Properties); - thisKey = FormatMemberList(fk.Properties); + thisKey = FormatMemberList(fk.PrincipalKey.Properties); + otherKey = FormatMemberList(fk.Properties); } AssociationAttribute assocAttrib = new AssociationAttribute(fk.GetConstraintName(), thisKey, otherKey); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs index cbf706650..1fd655885 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs @@ -33,7 +33,7 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { if (!optionsBuilder.IsConfigured) { - optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=AdventureWorks;Integrated Security=True;Multiple Active Result Sets=True"); + optionsBuilder.UseSqlServer("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=AdventureWorks;Integrated Security=True;MultipleActiveResultSets=True"); } } @@ -48,8 +48,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(e => e.Contact) .WithMany() - .HasForeignKey(e => e.ContactID) - .HasConstraintName("FK_Employee_Contact_ContactID"); + .HasForeignKey(e => e.ContactID); entity.HasOne(e => e.Manager) .WithMany() @@ -70,9 +69,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(e => e.ProductSubcategory) .WithMany() - .HasForeignKey(e => e.ProductSubcategoryID) -// .HasConstraintName() -; + .HasForeignKey(e => e.ProductSubcategoryID); }); modelBuilder.Entity(entity => @@ -81,13 +78,11 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(e => e.PurchaseOrder) .WithMany(e => e.PurchaseOrderDetails) - .HasForeignKey(e => e.PurchaseOrderDetailID) - .HasConstraintName("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID"); + .HasForeignKey(e => e.PurchaseOrderID); entity.HasOne(e => e.Product) .WithMany() - .HasForeignKey(e => e.ProductID) - .HasConstraintName("FK_PurchaseOrderDetail_Product_ProductID"); + .HasForeignKey(e => e.ProductID); }); modelBuilder.Entity(entity => @@ -102,7 +97,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(e => e.Employee) .WithOne(e => e.SalesPerson) .HasForeignKey(e => e.SalesPersonID) - .HasConstraintName("FK_SalesPerson_Employee_SalesPersonID") +// .HasPrincipalKey(e => e.EmployeeID) .IsRequired(); entity.HasOne(e => e.SalesTerritory) From c07c6bdaa6371b3ede7978c0646be98b952efc4e Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Sun, 20 Feb 2022 11:41:13 +0100 Subject: [PATCH 48/99] sql table ProductSubcategoryId was empty so change linq query to work as expected --- .../AdventureWorks/EFCore_Catalog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs index a4f1bb08d..0749a5419 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs @@ -45,8 +45,8 @@ public IQueryable GetProductsWithCustomTotalCount(out int totalCount) public IQueryable GetProductsByCategory(int subCategoryID) { return from p in this.DbContext.Products - where p.ProductSubcategory.ProductSubcategoryID == subCategoryID - select p; + where p.ProductSubcategoryID == subCategoryID + select p; } [Insert] From 040efbb3dec93af9908f217b5aabc55ac3db816d Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Mon, 21 Feb 2022 12:50:57 +0100 Subject: [PATCH 49/99] Remove some unused code --- .../Framework/AssociationInfo.cs | 54 ------------------- .../Framework/DbContextEFCoreExtensions.cs | 36 +++++++++++-- .../Framework/GlobalSuppressions.cs | 20 ------- .../Framework/ObjectContextUtilitiesEFCore.cs | 45 ---------------- 4 files changed, 33 insertions(+), 122 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs deleted file mode 100644 index cca96aac6..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/AssociationInfo.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace OpenRiaServices.EntityFrameworkCore -{ - /// - /// Information about an Association - /// - internal class AssociationInfo - { - /// - /// The name of the association - /// - public string Name - { - get; - set; - } - - /// - /// The key members on the FK side of the association - /// - public string[] ThisKey - { - get; - set; - } - - /// - /// The key members on the non-FK side of the association - /// - public string[] OtherKey - { - get; - set; - } - - /// - /// The foreign key role name for this association - /// - public string FKRole - { - get; - set; - } - - /// - /// Gets or sets a value indicating whether this association can have a - /// multiplicity of zero - /// - public bool IsRequired - { - get; - set; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs index 5fd230ed6..43c37a8c7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs @@ -1,6 +1,9 @@ using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; +using OpenRiaServices.Server; namespace OpenRiaServices.EntityFrameworkCore { @@ -47,11 +50,10 @@ public static void AttachAsModified(this DbSet dbSet, T current, T origina entityEntry.State = EntityState.Modified; } - // TODO: Look into this var changeTracker = dbContext.ChangeTracker; - var stateEntry = ObjectContextUtilitiesEFCore.AttachAsModifiedInternal(current, original, changeTracker); + AttachAsModifiedInternal(entityEntry, original, changeTracker); - if (stateEntry.State != EntityState.Modified) + if (entityEntry.State != EntityState.Modified) { // Ensure that when we leave this method, the entity is in a // Modified state. For example, if current and original are the @@ -93,5 +95,33 @@ public static void AttachAsModified(this DbSet dbSet, T entity, DbContext // transition the entity to the modified state entityEntry.State = EntityState.Modified; } + + private static void AttachAsModifiedInternal(EntityEntry stateEntry, T original, ChangeTracker objectContext) + where T : class + { + // Apply original vaules + var originalValues = objectContext.Context.Entry(original).CurrentValues; + + Type entityType = stateEntry.Entity.GetType(); + PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType); + AttributeCollection attributes = TypeDescriptor.GetAttributes(entityType); + bool isRoundtripType = attributes[typeof(RoundtripOriginalAttribute)] != null; + + foreach (var member in stateEntry.CurrentValues.Properties) + { + stateEntry.OriginalValues[member] = originalValues[member]; + + // For any members that don't have RoundtripOriginal applied, EF can't determine modification + // state by doing value comparisons. To avoid losing updates in these cases, we must explicitly + // mark such members as modified. + PropertyDescriptor property = properties[member.Name]; + if (property != null && + (!isRoundtripType && property.Attributes[typeof(RoundtripOriginalAttribute)] == null) && + property.Attributes[typeof(ExcludeAttribute)] == null) + { + stateEntry.Property(member.Name).IsModified = true; + } + } + } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs deleted file mode 100644 index d87514f15..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/GlobalSuppressions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -// -// To add a suppression to this file, right-click the message in the -// Error List, point to "Suppress Message(s)", and click -// "In Project Suppression File". -// You do not need to add suppressions to this file manually. - -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.LinqToEntitiesTypeDescriptor.#GetMemberAttributes(System.ComponentModel.PropertyDescriptor)")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainService`1.#CreateDbContext()", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainService`1.#DbContext", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainServiceDescriptionProviderAttribute.#DbContextType", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFrameworkCore.DbContextExtensions", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainService`1", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db", Scope = "type", Target = "OpenRiaServices.EntityFrameworkCore.DbDomainServiceDescriptionProviderAttribute", Justification = "Following the naming convention of EntityFramework.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Assemblies are delay signed.")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "OpenRiaServices.EntityFrameworkCore.AssociationInfo.#IsRequired", Justification = "Code shared with other projects.")] diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs deleted file mode 100644 index 57670fcea..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ObjectContextUtilitiesEFCore.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using Microsoft.EntityFrameworkCore.ChangeTracking; -using OpenRiaServices.Server; - -namespace OpenRiaServices.EntityFrameworkCore -{ - - /// - /// Internal utility functions for dealing with EF types and metadata - /// - internal static class ObjectContextUtilitiesEFCore - { - public static EntityEntry AttachAsModifiedInternal(object current, object original, ChangeTracker objectContext) - { - var stateEntry = objectContext.Context.Entry(current); // ObjectStateManager.GetObjectStateEntry(current); - // Apply original vaules - var originalValues = objectContext.Context.Entry(original).CurrentValues; - - // For any members that don't have RoundtripOriginal applied, EF can't determine modification - // state by doing value comparisons. To avoid losing updates in these cases, we must explicitly - // mark such members as modified. - Type entityType = current.GetType(); - PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(entityType); - AttributeCollection attributes = TypeDescriptor.GetAttributes(entityType); - bool isRoundtripType = attributes[typeof(RoundtripOriginalAttribute)] != null; - - foreach (var memberName in stateEntry.CurrentValues.Properties) - { - stateEntry.OriginalValues[memberName.Name] = originalValues[memberName]; - - PropertyDescriptor property = properties[memberName.Name]; - if (property != null && - (property.Attributes[typeof(RoundtripOriginalAttribute)] == null && !isRoundtripType) && - property.Attributes[typeof(ExcludeAttribute)] == null) - { - stateEntry.Property(memberName.Name).IsModified = true; - } - } - return stateEntry; - } - } -} From d67e0fb0f862b937ca238910fd3655c8870483cb Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Mon, 21 Feb 2022 12:57:04 +0100 Subject: [PATCH 50/99] Remove some file and link in some others to prevent duplicates --- ...rviceEFCoreDescriptionProviderAttribute.cs | 6 +- ...ovider.cs => EFCoreDescriptionProvider.cs} | 12 ++- ...ext.cs => EFCoreTypeDescriptionContext.cs} | 4 +- .../Framework/EFCoreTypeDescriptor.cs | 6 +- .../MetadataPropertyDescriptorWrapper.cs | 71 --------------- ...Services.Server.EntityFrameworkCore.csproj | 2 + .../Framework/TypeDescriptorBase.cs | 90 ------------------- 7 files changed, 15 insertions(+), 176 deletions(-) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs => EFCoreDescriptionProvider.cs} (79%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{LinqToEntitiesEFCoreTypeDescriptionContext.cs => EFCoreTypeDescriptionContext.cs} (97%) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs index 8ffbd80b8..0b917ecbb 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs @@ -22,7 +22,7 @@ public sealed class DbDomainServiceEFCoreDescriptionProviderAttribute : DomainSe /// attribute is applied to. /// public DbDomainServiceEFCoreDescriptionProviderAttribute() - : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) + : base(typeof(EFCoreDescriptionProvider)) { } @@ -32,7 +32,7 @@ public DbDomainServiceEFCoreDescriptionProviderAttribute() /// /// The LINQ To Entities ObjectContext Type. public DbDomainServiceEFCoreDescriptionProviderAttribute(Type dbContextType) - : base(typeof(LinqToEntitiesDomainServiceEFCoreDescriptionProvider)) + : base(typeof(EFCoreDescriptionProvider)) { this._dbContextType = dbContextType; } @@ -73,7 +73,7 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi this._dbContextType)); } - return new LinqToEntitiesDomainServiceEFCoreDescriptionProvider(domainServiceType, this._dbContextType, parent); + return new EFCoreDescriptionProvider(domainServiceType, this._dbContextType, parent); } /// diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs similarity index 79% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs index 5444db8e7..2b22c4616 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesDomainServiceEFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs @@ -6,15 +6,13 @@ namespace OpenRiaServices.EntityFrameworkCore { - // TODO: Remove and move code to DB context - - internal class LinqToEntitiesDomainServiceEFCoreDescriptionProvider : DomainServiceDescriptionProvider + internal class EFCoreDescriptionProvider : DomainServiceDescriptionProvider { - private static Dictionary tdpContextMap = new Dictionary(); - private readonly LinqToEntitiesEFCoreTypeDescriptionContext _typeDescriptionContext; + private static Dictionary tdpContextMap = new Dictionary(); + private readonly EFCoreTypeDescriptionContext _typeDescriptionContext; private readonly Dictionary _descriptors = new Dictionary(); - public LinqToEntitiesDomainServiceEFCoreDescriptionProvider(Type domainServiceType, Type contextType, DomainServiceDescriptionProvider parent) + public EFCoreDescriptionProvider(Type domainServiceType, Type contextType, DomainServiceDescriptionProvider parent) : base(domainServiceType, parent) { lock (tdpContextMap) @@ -22,7 +20,7 @@ public LinqToEntitiesDomainServiceEFCoreDescriptionProvider(Type domainServiceTy if (!tdpContextMap.TryGetValue(contextType, out this._typeDescriptionContext)) { // create and cache a context for this provider type - this._typeDescriptionContext = new LinqToEntitiesEFCoreTypeDescriptionContext(contextType); + this._typeDescriptionContext = new EFCoreTypeDescriptionContext(contextType); tdpContextMap.Add(contextType, this._typeDescriptionContext); } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs similarity index 97% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs index 2a63c3311..ac9b94f66 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/LinqToEntitiesEFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs @@ -13,7 +13,7 @@ namespace OpenRiaServices.EntityFrameworkCore /// /// Metadata context for LINQ To Entities domain services /// - internal class LinqToEntitiesEFCoreTypeDescriptionContext : TypeDescriptionContextBase + internal class EFCoreTypeDescriptionContext : TypeDescriptionContextBase { // private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; @@ -23,7 +23,7 @@ internal class LinqToEntitiesEFCoreTypeDescriptionContext : TypeDescriptionConte /// Constructor that accepts a LINQ To Entities context type /// /// The ObjectContext Type - public LinqToEntitiesEFCoreTypeDescriptionContext(Type contextType) + public EFCoreTypeDescriptionContext(Type contextType) { if (contextType == null) { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs index 9c8583631..631475dd4 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs @@ -15,13 +15,13 @@ namespace OpenRiaServices.EntityFrameworkCore /// internal class EFCoreTypeDescriptor : TypeDescriptorBase { - private readonly LinqToEntitiesEFCoreTypeDescriptionContext _typeDescriptionContext; + private readonly EFCoreTypeDescriptionContext _typeDescriptionContext; private readonly IEntityType _entityType; private readonly IProperty _timestampProperty; private readonly bool _keyIsEditable; private Dictionary _foreignKeyMembers; // TODO: change to List / HashSet - public EFCoreTypeDescriptor(LinqToEntitiesEFCoreTypeDescriptionContext typeDescriptionContext, IEntityType entityType, ICustomTypeDescriptor parent) + public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, IEntityType entityType, ICustomTypeDescriptor parent) : base(parent) { this._typeDescriptionContext = typeDescriptionContext; @@ -75,7 +75,7 @@ private static bool IsConcurrencyTimestamp(IProperty p) /// /// Gets the metadata context /// - public LinqToEntitiesEFCoreTypeDescriptionContext TypeDescriptionContext + public EFCoreTypeDescriptionContext TypeDescriptionContext { get { diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs deleted file mode 100644 index 970e55a41..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataPropertyDescriptorWrapper.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.ComponentModel; - -namespace OpenRiaServices.Server -{ - internal class MetadataPropertyDescriptorWrapper : PropertyDescriptor - { - private readonly PropertyDescriptor _descriptor; - - public MetadataPropertyDescriptorWrapper(PropertyDescriptor descriptor, Attribute[] attrs) - : base(descriptor, attrs) - { - this._descriptor = descriptor; - } - - public override Type ComponentType - { - get { return this._descriptor.ComponentType; } - } - - public override bool IsReadOnly - { - get { return this._descriptor.IsReadOnly; } - } - - public override Type PropertyType - { - get { return this._descriptor.PropertyType; } - } - - public override bool SupportsChangeEvents - { - get { return this._descriptor.SupportsChangeEvents; } - } - - public override void AddValueChanged(object component, EventHandler handler) - { - this._descriptor.AddValueChanged(component, handler); - } - - public override bool CanResetValue(object component) - { - return this._descriptor.CanResetValue(component); - } - - public override object GetValue(object component) - { - return this._descriptor.GetValue(component); - } - - public override void RemoveValueChanged(object component, EventHandler handler) - { - this._descriptor.RemoveValueChanged(component, handler); - } - - public override void ResetValue(object component) - { - this._descriptor.ResetValue(component); - } - - public override void SetValue(object component, object value) - { - this._descriptor.SetValue(component, value); - } - - public override bool ShouldSerializeValue(object component) - { - return this._descriptor.ShouldSerializeValue(component); - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 469c7a392..abf533a00 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -12,6 +12,8 @@ + + True True diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs deleted file mode 100644 index 0990fbae1..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptorBase.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; - -namespace OpenRiaServices.Server -{ - /// - /// CustomTypeDescriptor base type shared by LINQ To SQL and LINQ To Entities - /// - internal abstract class TypeDescriptorBase : CustomTypeDescriptor - { - private PropertyDescriptorCollection _properties; - - /// - /// Main constructor that accepts the parent custom type descriptor - /// - /// The parent custom type descriptor. - public TypeDescriptorBase(ICustomTypeDescriptor parent) - : base(parent) - { - } - - /// - /// Override of the to obtain the list - /// of properties for this type. - /// - /// - /// This method is overridden so that it can merge this class's parent attributes with those - /// it infers from the DAL-specific attributes. - /// - /// A list of properties for this type - public sealed override PropertyDescriptorCollection GetProperties() - { - // No need to lock anything... Worst case scenario we create the properties multiple times. - if (this._properties == null) - { - // Get properties from our parent - PropertyDescriptorCollection originalCollection = base.GetProperties(); - - bool customDescriptorsCreated = false; - List tempPropertyDescriptors = new List(); - - // for every property exposed by our parent, see if we have additional metadata to add - foreach (PropertyDescriptor propDescriptor in originalCollection) - { - Attribute[] newMetadata = this.GetMemberAttributes(propDescriptor).ToArray(); - if (newMetadata.Length > 0) - { - tempPropertyDescriptors.Add(new MetadataPropertyDescriptorWrapper(propDescriptor, newMetadata)); - customDescriptorsCreated = true; - } - else - { - tempPropertyDescriptors.Add(propDescriptor); - } - } - - if (customDescriptorsCreated) - { - this._properties = new PropertyDescriptorCollection(tempPropertyDescriptors.ToArray(), true); - } - else - { - this._properties = originalCollection; - } - } - - return this._properties; - } - - /// - /// Abstract method specific DAL implementations must override to return the - /// list of RIA s implied by their DAL-specific attributes - /// - /// A to examine. - /// A list of RIA attributes implied by the DAL specific attributes - protected abstract IEnumerable GetMemberAttributes(PropertyDescriptor pd); - - /// - /// Returns true if the given type is a - /// - /// The type to test - /// true if the given type is a nullable type - public static bool IsNullableType(Type type) - { - return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); - } - } -} From cff4187b55f63f63b24c7df11061a026200814d3 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 23 Feb 2022 12:22:32 +0100 Subject: [PATCH 51/99] add catalog codegen test --- .../Test/CodeGenDomainServices.cs | 12 +- .../Baselines/Default/EF/Catalog_EFCore.g.cs | 2828 +++++++++++++++++ .../Baselines/Default/EF/Catalog_EFCore.g.vb | 2644 +++++++++++++++ 3 files changed, 5483 insertions(+), 1 deletion(-) create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index e8a45acf9..05e8989ae 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -169,7 +169,7 @@ public void TestClientCodegen_EFDbCtxDomainServices_FullTypes() [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFCoreContext")] [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFCoreContext")] [TestMethod] - public void TestClientCodegen_EFCoreEFDbCtxDomainServices() + public void TestClientCodegen_EFCoreDomainServices() { string[] sharedFiles = Array.Empty(); @@ -568,6 +568,16 @@ public void TestCatalogEFDbCtxClientProxies() TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\EF", "CG_CATEFDbCtx", "Catalog_EFDbCtx.g", typeof(TestDomainServices.DbCtx.Catalog), Array.Empty(), false)); } + [DeploymentItem(@"Baselines\Default\EF", "CG_CATEFDbCtx")] + [DeploymentItem(@"ProjectPath.txt", "CG_CATEFDbCtx")] + [TestMethod] + [Description("Create client proxies for Linq to Entities domain service and compare to known good copy")] + public void TestCatalogEFCoreClientProxies() + { + // Default + TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\EF", "CG_CATEFDbCtx", "Catalog_EFCore.g", typeof(TestDomainServices.EFCore.Catalog), Array.Empty(), false)); + } + [DeploymentItem(@"Baselines\Default\Scenarios", "CG_CONFLICT_RESOLUTION")] [DeploymentItem(@"ProjectPath.txt", "CG_CONFLICT_RESOLUTION")] [TestMethod] diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs new file mode 100644 index 000000000..557a6b84c --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs @@ -0,0 +1,2828 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34209 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.AdventureWorks +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.ComponentModel.DataAnnotations; + using System.Linq; + using System.Runtime.Serialization; + using System.Threading.Tasks; + using OpenRiaServices; + using OpenRiaServices.Client; + using OpenRiaServices.Client.Authentication; + + + /// + /// The 'Employee' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks")] + public sealed partial class Employee : Entity + { + + private DateTime _birthDate; + + private int _contactID; + + private bool _currentFlag; + + private int _employeeID; + + private string _gender; + + private DateTime _hireDate; + + private string _loginID; + + private EntityRef _manager; + + private Nullable _managerID; + + private string _maritalStatus; + + private DateTime _modifiedDate; + + private string _nationalIDNumber; + + private EntityCollection _purchaseOrders; + + private EntityCollection _reports; + + private Guid _rowguid; + + private bool _salariedFlag; + + private short _sickLeaveHours; + + private string _title; + + private short _vacationHours; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnBirthDateChanging(DateTime value); + partial void OnBirthDateChanged(); + partial void OnContactIDChanging(int value); + partial void OnContactIDChanged(); + partial void OnCurrentFlagChanging(bool value); + partial void OnCurrentFlagChanged(); + partial void OnEmployeeIDChanging(int value); + partial void OnEmployeeIDChanged(); + partial void OnGenderChanging(string value); + partial void OnGenderChanged(); + partial void OnHireDateChanging(DateTime value); + partial void OnHireDateChanged(); + partial void OnLoginIDChanging(string value); + partial void OnLoginIDChanged(); + partial void OnManagerIDChanging(Nullable value); + partial void OnManagerIDChanged(); + partial void OnMaritalStatusChanging(string value); + partial void OnMaritalStatusChanged(); + partial void OnModifiedDateChanging(DateTime value); + partial void OnModifiedDateChanged(); + partial void OnNationalIDNumberChanging(string value); + partial void OnNationalIDNumberChanged(); + partial void OnrowguidChanging(Guid value); + partial void OnrowguidChanged(); + partial void OnSalariedFlagChanging(bool value); + partial void OnSalariedFlagChanged(); + partial void OnSickLeaveHoursChanging(short value); + partial void OnSickLeaveHoursChanged(); + partial void OnTitleChanging(string value); + partial void OnTitleChanged(); + partial void OnVacationHoursChanging(short value); + partial void OnVacationHoursChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Employee() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'BirthDate' value. + /// + [DataMember()] + public DateTime BirthDate + { + get + { + return this._birthDate; + } + set + { + if ((this._birthDate != value)) + { + this.OnBirthDateChanging(value); + this.RaiseDataMemberChanging("BirthDate"); + this.ValidateProperty("BirthDate", value); + this._birthDate = value; + this.RaiseDataMemberChanged("BirthDate"); + this.OnBirthDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ContactID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public int ContactID + { + get + { + return this._contactID; + } + set + { + if ((this._contactID != value)) + { + this.OnContactIDChanging(value); + this.RaiseDataMemberChanging("ContactID"); + this.ValidateProperty("ContactID", value); + this._contactID = value; + this.RaiseDataMemberChanged("ContactID"); + this.OnContactIDChanged(); + } + } + } + + /// + /// Gets or sets the 'CurrentFlag' value. + /// + [DataMember()] + public bool CurrentFlag + { + get + { + return this._currentFlag; + } + set + { + if ((this._currentFlag != value)) + { + this.OnCurrentFlagChanging(value); + this.RaiseDataMemberChanging("CurrentFlag"); + this.ValidateProperty("CurrentFlag", value); + this._currentFlag = value; + this.RaiseDataMemberChanged("CurrentFlag"); + this.OnCurrentFlagChanged(); + } + } + } + + /// + /// Gets or sets the 'EmployeeID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int EmployeeID + { + get + { + return this._employeeID; + } + set + { + if ((this._employeeID != value)) + { + this.OnEmployeeIDChanging(value); + this.ValidateProperty("EmployeeID", value); + this._employeeID = value; + this.RaisePropertyChanged("EmployeeID"); + this.OnEmployeeIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Gender' value. + /// + [DataMember()] + [Required()] + [StringLength(1)] + public string Gender + { + get + { + return this._gender; + } + set + { + if ((this._gender != value)) + { + this.OnGenderChanging(value); + this.RaiseDataMemberChanging("Gender"); + this.ValidateProperty("Gender", value); + this._gender = value; + this.RaiseDataMemberChanged("Gender"); + this.OnGenderChanged(); + } + } + } + + /// + /// Gets or sets the 'HireDate' value. + /// + [DataMember()] + public DateTime HireDate + { + get + { + return this._hireDate; + } + set + { + if ((this._hireDate != value)) + { + this.OnHireDateChanging(value); + this.RaiseDataMemberChanging("HireDate"); + this.ValidateProperty("HireDate", value); + this._hireDate = value; + this.RaiseDataMemberChanged("HireDate"); + this.OnHireDateChanged(); + } + } + } + + /// + /// Gets or sets the 'LoginID' value. + /// + [DataMember()] + [Required()] + [StringLength(256)] + public string LoginID + { + get + { + return this._loginID; + } + set + { + if ((this._loginID != value)) + { + this.OnLoginIDChanging(value); + this.RaiseDataMemberChanging("LoginID"); + this.ValidateProperty("LoginID", value); + this._loginID = value; + this.RaiseDataMemberChanged("LoginID"); + this.OnLoginIDChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Employee_Employee", "ManagerID", "EmployeeID", IsForeignKey=true)] + public Employee Manager + { + get + { + if ((this._manager == null)) + { + this._manager = new EntityRef(this, "Manager", this.FilterManager); + } + return this._manager.Entity; + } + set + { + Employee previous = this.Manager; + if ((previous != value)) + { + this.ValidateProperty("Manager", value); + if ((previous != null)) + { + this._manager.Entity = null; + previous.Reports.Remove(this); + } + if ((value != null)) + { + this.ManagerID = value.EmployeeID; + } + else + { + this.ManagerID = default(Nullable); + } + this._manager.Entity = value; + if ((value != null)) + { + value.Reports.Add(this); + } + this.RaisePropertyChanged("Manager"); + } + } + } + + /// + /// Gets or sets the 'ManagerID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public Nullable ManagerID + { + get + { + return this._managerID; + } + set + { + if ((this._managerID != value)) + { + this.OnManagerIDChanging(value); + this.RaiseDataMemberChanging("ManagerID"); + this.ValidateProperty("ManagerID", value); + this._managerID = value; + this.RaiseDataMemberChanged("ManagerID"); + this.OnManagerIDChanged(); + } + } + } + + /// + /// Gets or sets the 'MaritalStatus' value. + /// + [DataMember()] + [Required()] + [StringLength(1)] + public string MaritalStatus + { + get + { + return this._maritalStatus; + } + set + { + if ((this._maritalStatus != value)) + { + this.OnMaritalStatusChanging(value); + this.RaiseDataMemberChanging("MaritalStatus"); + this.ValidateProperty("MaritalStatus", value); + this._maritalStatus = value; + this.RaiseDataMemberChanged("MaritalStatus"); + this.OnMaritalStatusChanged(); + } + } + } + + /// + /// Gets or sets the 'ModifiedDate' value. + /// + [DataMember()] + public DateTime ModifiedDate + { + get + { + return this._modifiedDate; + } + set + { + if ((this._modifiedDate != value)) + { + this.OnModifiedDateChanging(value); + this.RaiseDataMemberChanging("ModifiedDate"); + this.ValidateProperty("ModifiedDate", value); + this._modifiedDate = value; + this.RaiseDataMemberChanged("ModifiedDate"); + this.OnModifiedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'NationalIDNumber' value. + /// + [DataMember()] + [Required()] + [StringLength(15)] + public string NationalIDNumber + { + get + { + return this._nationalIDNumber; + } + set + { + if ((this._nationalIDNumber != value)) + { + this.OnNationalIDNumberChanging(value); + this.RaiseDataMemberChanging("NationalIDNumber"); + this.ValidateProperty("NationalIDNumber", value); + this._nationalIDNumber = value; + this.RaiseDataMemberChanged("NationalIDNumber"); + this.OnNationalIDNumberChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID")] + public EntityCollection PurchaseOrders + { + get + { + if ((this._purchaseOrders == null)) + { + this._purchaseOrders = new EntityCollection(this, "PurchaseOrders", this.FilterPurchaseOrders, this.AttachPurchaseOrders, this.DetachPurchaseOrders); + } + return this._purchaseOrders; + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Employee_Employee", "EmployeeID", "ManagerID")] + public EntityCollection Reports + { + get + { + if ((this._reports == null)) + { + this._reports = new EntityCollection(this, "Reports", this.FilterReports, this.AttachReports, this.DetachReports); + } + return this._reports; + } + } + + /// + /// Gets or sets the 'rowguid' value. + /// + [DataMember()] + public Guid rowguid + { + get + { + return this._rowguid; + } + set + { + if ((this._rowguid != value)) + { + this.OnrowguidChanging(value); + this.RaiseDataMemberChanging("rowguid"); + this.ValidateProperty("rowguid", value); + this._rowguid = value; + this.RaiseDataMemberChanged("rowguid"); + this.OnrowguidChanged(); + } + } + } + + /// + /// Gets or sets the 'SalariedFlag' value. + /// + [DataMember()] + public bool SalariedFlag + { + get + { + return this._salariedFlag; + } + set + { + if ((this._salariedFlag != value)) + { + this.OnSalariedFlagChanging(value); + this.RaiseDataMemberChanging("SalariedFlag"); + this.ValidateProperty("SalariedFlag", value); + this._salariedFlag = value; + this.RaiseDataMemberChanged("SalariedFlag"); + this.OnSalariedFlagChanged(); + } + } + } + + /// + /// Gets or sets the 'SickLeaveHours' value. + /// + [DataMember()] + public short SickLeaveHours + { + get + { + return this._sickLeaveHours; + } + set + { + if ((this._sickLeaveHours != value)) + { + this.OnSickLeaveHoursChanging(value); + this.RaiseDataMemberChanging("SickLeaveHours"); + this.ValidateProperty("SickLeaveHours", value); + this._sickLeaveHours = value; + this.RaiseDataMemberChanged("SickLeaveHours"); + this.OnSickLeaveHoursChanged(); + } + } + } + + /// + /// Gets or sets the 'Title' value. + /// + [DataMember()] + [Required()] + [StringLength(50)] + public string Title + { + get + { + return this._title; + } + set + { + if ((this._title != value)) + { + this.OnTitleChanging(value); + this.RaiseDataMemberChanging("Title"); + this.ValidateProperty("Title", value); + this._title = value; + this.RaiseDataMemberChanged("Title"); + this.OnTitleChanged(); + } + } + } + + /// + /// Gets or sets the 'VacationHours' value. + /// + [DataMember()] + public short VacationHours + { + get + { + return this._vacationHours; + } + set + { + if ((this._vacationHours != value)) + { + this.OnVacationHoursChanging(value); + this.RaiseDataMemberChanging("VacationHours"); + this.ValidateProperty("VacationHours", value); + this._vacationHours = value; + this.RaiseDataMemberChanged("VacationHours"); + this.OnVacationHoursChanged(); + } + } + } + + private bool FilterManager(Employee entity) + { + return (entity.EmployeeID == this.ManagerID); + } + + private void AttachPurchaseOrders(PurchaseOrder entity) + { + entity.Employee = this; + } + + private void DetachPurchaseOrders(PurchaseOrder entity) + { + entity.Employee = null; + } + + private bool FilterPurchaseOrders(PurchaseOrder entity) + { + return (entity.EmployeeID == this.EmployeeID); + } + + private void AttachReports(Employee entity) + { + entity.Manager = this; + } + + private void DetachReports(Employee entity) + { + entity.Manager = null; + } + + private bool FilterReports(Employee entity) + { + return (entity.ManagerID == this.EmployeeID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._employeeID; + } + } + + /// + /// The 'EmployeeInfo' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks")] + public sealed partial class EmployeeInfo : Entity + { + + private int _employeeID; + + private string _firstName; + + private string _lastName; + + private int _territoryID; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnEmployeeIDChanging(int value); + partial void OnEmployeeIDChanged(); + partial void OnFirstNameChanging(string value); + partial void OnFirstNameChanged(); + partial void OnLastNameChanging(string value); + partial void OnLastNameChanged(); + partial void OnTerritoryIDChanging(int value); + partial void OnTerritoryIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public EmployeeInfo() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'EmployeeID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int EmployeeID + { + get + { + return this._employeeID; + } + set + { + if ((this._employeeID != value)) + { + this.OnEmployeeIDChanging(value); + this.ValidateProperty("EmployeeID", value); + this._employeeID = value; + this.RaisePropertyChanged("EmployeeID"); + this.OnEmployeeIDChanged(); + } + } + } + + /// + /// Gets or sets the 'FirstName' value. + /// + [DataMember()] + public string FirstName + { + get + { + return this._firstName; + } + set + { + if ((this._firstName != value)) + { + this.OnFirstNameChanging(value); + this.RaiseDataMemberChanging("FirstName"); + this.ValidateProperty("FirstName", value); + this._firstName = value; + this.RaiseDataMemberChanged("FirstName"); + this.OnFirstNameChanged(); + } + } + } + + /// + /// Gets or sets the 'LastName' value. + /// + [DataMember()] + public string LastName + { + get + { + return this._lastName; + } + set + { + if ((this._lastName != value)) + { + this.OnLastNameChanging(value); + this.RaiseDataMemberChanging("LastName"); + this.ValidateProperty("LastName", value); + this._lastName = value; + this.RaiseDataMemberChanged("LastName"); + this.OnLastNameChanged(); + } + } + } + + /// + /// Gets or sets the 'TerritoryID' value. + /// + [DataMember()] + public int TerritoryID + { + get + { + return this._territoryID; + } + set + { + if ((this._territoryID != value)) + { + this.OnTerritoryIDChanging(value); + this.RaiseDataMemberChanging("TerritoryID"); + this.ValidateProperty("TerritoryID", value); + this._territoryID = value; + this.RaiseDataMemberChanged("TerritoryID"); + this.OnTerritoryIDChanged(); + } + } + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._employeeID; + } + } + + /// + /// The 'Product' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks")] + public sealed partial class Product : Entity + { + + private string _class; + + private string _color; + + private int _daysToManufacture; + + private Nullable _discontinuedDate; + + private bool _finishedGoodsFlag; + + private decimal _listPrice; + + private bool _makeFlag; + + private DateTime _modifiedDate; + + private string _name; + + private int _productID; + + private string _productLine; + + private Nullable _productModelID; + + private string _productNumber; + + private Nullable _productSubcategoryID; + + private EntityCollection _purchaseOrderDetails; + + private short _reorderPoint; + + private Guid _rowguid; + + private Nullable _sellEndDate; + + private DateTime _sellStartDate; + + private string _size; + + private string _sizeUnitMeasureCode; + + private decimal _standardCost; + + private string _style; + + private Nullable _weight; + + private string _weightUnitMeasureCode; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnClassChanging(string value); + partial void OnClassChanged(); + partial void OnColorChanging(string value); + partial void OnColorChanged(); + partial void OnDaysToManufactureChanging(int value); + partial void OnDaysToManufactureChanged(); + partial void OnDiscontinuedDateChanging(Nullable value); + partial void OnDiscontinuedDateChanged(); + partial void OnFinishedGoodsFlagChanging(bool value); + partial void OnFinishedGoodsFlagChanged(); + partial void OnListPriceChanging(decimal value); + partial void OnListPriceChanged(); + partial void OnMakeFlagChanging(bool value); + partial void OnMakeFlagChanged(); + partial void OnModifiedDateChanging(DateTime value); + partial void OnModifiedDateChanged(); + partial void OnNameChanging(string value); + partial void OnNameChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnProductLineChanging(string value); + partial void OnProductLineChanged(); + partial void OnProductModelIDChanging(Nullable value); + partial void OnProductModelIDChanged(); + partial void OnProductNumberChanging(string value); + partial void OnProductNumberChanged(); + partial void OnProductSubcategoryIDChanging(Nullable value); + partial void OnProductSubcategoryIDChanged(); + partial void OnReorderPointChanging(short value); + partial void OnReorderPointChanged(); + partial void OnrowguidChanging(Guid value); + partial void OnrowguidChanged(); + partial void OnSellEndDateChanging(Nullable value); + partial void OnSellEndDateChanged(); + partial void OnSellStartDateChanging(DateTime value); + partial void OnSellStartDateChanged(); + partial void OnSizeChanging(string value); + partial void OnSizeChanged(); + partial void OnSizeUnitMeasureCodeChanging(string value); + partial void OnSizeUnitMeasureCodeChanged(); + partial void OnStandardCostChanging(decimal value); + partial void OnStandardCostChanged(); + partial void OnStyleChanging(string value); + partial void OnStyleChanged(); + partial void OnWeightChanging(Nullable value); + partial void OnWeightChanged(); + partial void OnWeightUnitMeasureCodeChanging(string value); + partial void OnWeightUnitMeasureCodeChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Product() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'Class' value. + /// + [DataMember()] + [StringLength(2)] + public string Class + { + get + { + return this._class; + } + set + { + if ((this._class != value)) + { + this.OnClassChanging(value); + this.RaiseDataMemberChanging("Class"); + this.ValidateProperty("Class", value); + this._class = value; + this.RaiseDataMemberChanged("Class"); + this.OnClassChanged(); + } + } + } + + /// + /// Gets or sets the 'Color' value. + /// + [DataMember()] + [StringLength(15)] + public string Color + { + get + { + return this._color; + } + set + { + if ((this._color != value)) + { + this.OnColorChanging(value); + this.RaiseDataMemberChanging("Color"); + this.ValidateProperty("Color", value); + this._color = value; + this.RaiseDataMemberChanged("Color"); + this.OnColorChanged(); + } + } + } + + /// + /// Gets or sets the 'DaysToManufacture' value. + /// + [DataMember()] + public int DaysToManufacture + { + get + { + return this._daysToManufacture; + } + set + { + if ((this._daysToManufacture != value)) + { + this.OnDaysToManufactureChanging(value); + this.RaiseDataMemberChanging("DaysToManufacture"); + this.ValidateProperty("DaysToManufacture", value); + this._daysToManufacture = value; + this.RaiseDataMemberChanged("DaysToManufacture"); + this.OnDaysToManufactureChanged(); + } + } + } + + /// + /// Gets or sets the 'DiscontinuedDate' value. + /// + [DataMember()] + public Nullable DiscontinuedDate + { + get + { + return this._discontinuedDate; + } + set + { + if ((this._discontinuedDate != value)) + { + this.OnDiscontinuedDateChanging(value); + this.RaiseDataMemberChanging("DiscontinuedDate"); + this.ValidateProperty("DiscontinuedDate", value); + this._discontinuedDate = value; + this.RaiseDataMemberChanged("DiscontinuedDate"); + this.OnDiscontinuedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'FinishedGoodsFlag' value. + /// + [DataMember()] + public bool FinishedGoodsFlag + { + get + { + return this._finishedGoodsFlag; + } + set + { + if ((this._finishedGoodsFlag != value)) + { + this.OnFinishedGoodsFlagChanging(value); + this.RaiseDataMemberChanging("FinishedGoodsFlag"); + this.ValidateProperty("FinishedGoodsFlag", value); + this._finishedGoodsFlag = value; + this.RaiseDataMemberChanged("FinishedGoodsFlag"); + this.OnFinishedGoodsFlagChanged(); + } + } + } + + /// + /// Gets or sets the 'ListPrice' value. + /// + [DataMember()] + public decimal ListPrice + { + get + { + return this._listPrice; + } + set + { + if ((this._listPrice != value)) + { + this.OnListPriceChanging(value); + this.RaiseDataMemberChanging("ListPrice"); + this.ValidateProperty("ListPrice", value); + this._listPrice = value; + this.RaiseDataMemberChanged("ListPrice"); + this.OnListPriceChanged(); + } + } + } + + /// + /// Gets or sets the 'MakeFlag' value. + /// + [DataMember()] + public bool MakeFlag + { + get + { + return this._makeFlag; + } + set + { + if ((this._makeFlag != value)) + { + this.OnMakeFlagChanging(value); + this.RaiseDataMemberChanging("MakeFlag"); + this.ValidateProperty("MakeFlag", value); + this._makeFlag = value; + this.RaiseDataMemberChanged("MakeFlag"); + this.OnMakeFlagChanged(); + } + } + } + + /// + /// Gets or sets the 'ModifiedDate' value. + /// + [DataMember()] + public DateTime ModifiedDate + { + get + { + return this._modifiedDate; + } + set + { + if ((this._modifiedDate != value)) + { + this.OnModifiedDateChanging(value); + this.RaiseDataMemberChanging("ModifiedDate"); + this.ValidateProperty("ModifiedDate", value); + this._modifiedDate = value; + this.RaiseDataMemberChanged("ModifiedDate"); + this.OnModifiedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'Name' value. + /// + [DataMember()] + [Required()] + [StringLength(50)] + public string Name + { + get + { + return this._name; + } + set + { + if ((this._name != value)) + { + this.OnNameChanging(value); + this.RaiseDataMemberChanging("Name"); + this.ValidateProperty("Name", value); + this._name = value; + this.RaiseDataMemberChanged("Name"); + this.OnNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductLine' value. + /// + [DataMember()] + [StringLength(2)] + public string ProductLine + { + get + { + return this._productLine; + } + set + { + if ((this._productLine != value)) + { + this.OnProductLineChanging(value); + this.RaiseDataMemberChanging("ProductLine"); + this.ValidateProperty("ProductLine", value); + this._productLine = value; + this.RaiseDataMemberChanged("ProductLine"); + this.OnProductLineChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductModelID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public Nullable ProductModelID + { + get + { + return this._productModelID; + } + set + { + if ((this._productModelID != value)) + { + this.OnProductModelIDChanging(value); + this.RaiseDataMemberChanging("ProductModelID"); + this.ValidateProperty("ProductModelID", value); + this._productModelID = value; + this.RaiseDataMemberChanged("ProductModelID"); + this.OnProductModelIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductNumber' value. + /// + [DataMember()] + [Required()] + [StringLength(25)] + public string ProductNumber + { + get + { + return this._productNumber; + } + set + { + if ((this._productNumber != value)) + { + this.OnProductNumberChanging(value); + this.RaiseDataMemberChanging("ProductNumber"); + this.ValidateProperty("ProductNumber", value); + this._productNumber = value; + this.RaiseDataMemberChanged("ProductNumber"); + this.OnProductNumberChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductSubcategoryID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public Nullable ProductSubcategoryID + { + get + { + return this._productSubcategoryID; + } + set + { + if ((this._productSubcategoryID != value)) + { + this.OnProductSubcategoryIDChanging(value); + this.RaiseDataMemberChanging("ProductSubcategoryID"); + this.ValidateProperty("ProductSubcategoryID", value); + this._productSubcategoryID = value; + this.RaiseDataMemberChanged("ProductSubcategoryID"); + this.OnProductSubcategoryIDChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID")] + public EntityCollection PurchaseOrderDetails + { + get + { + if ((this._purchaseOrderDetails == null)) + { + this._purchaseOrderDetails = new EntityCollection(this, "PurchaseOrderDetails", this.FilterPurchaseOrderDetails, this.AttachPurchaseOrderDetails, this.DetachPurchaseOrderDetails); + } + return this._purchaseOrderDetails; + } + } + + /// + /// Gets or sets the 'ReorderPoint' value. + /// + [DataMember()] + public short ReorderPoint + { + get + { + return this._reorderPoint; + } + set + { + if ((this._reorderPoint != value)) + { + this.OnReorderPointChanging(value); + this.RaiseDataMemberChanging("ReorderPoint"); + this.ValidateProperty("ReorderPoint", value); + this._reorderPoint = value; + this.RaiseDataMemberChanged("ReorderPoint"); + this.OnReorderPointChanged(); + } + } + } + + /// + /// Gets or sets the 'rowguid' value. + /// + [DataMember()] + public Guid rowguid + { + get + { + return this._rowguid; + } + set + { + if ((this._rowguid != value)) + { + this.OnrowguidChanging(value); + this.RaiseDataMemberChanging("rowguid"); + this.ValidateProperty("rowguid", value); + this._rowguid = value; + this.RaiseDataMemberChanged("rowguid"); + this.OnrowguidChanged(); + } + } + } + + /// + /// Gets or sets the 'SellEndDate' value. + /// + [DataMember()] + public Nullable SellEndDate + { + get + { + return this._sellEndDate; + } + set + { + if ((this._sellEndDate != value)) + { + this.OnSellEndDateChanging(value); + this.RaiseDataMemberChanging("SellEndDate"); + this.ValidateProperty("SellEndDate", value); + this._sellEndDate = value; + this.RaiseDataMemberChanged("SellEndDate"); + this.OnSellEndDateChanged(); + } + } + } + + /// + /// Gets or sets the 'SellStartDate' value. + /// + [DataMember()] + public DateTime SellStartDate + { + get + { + return this._sellStartDate; + } + set + { + if ((this._sellStartDate != value)) + { + this.OnSellStartDateChanging(value); + this.RaiseDataMemberChanging("SellStartDate"); + this.ValidateProperty("SellStartDate", value); + this._sellStartDate = value; + this.RaiseDataMemberChanged("SellStartDate"); + this.OnSellStartDateChanged(); + } + } + } + + /// + /// Gets or sets the 'Size' value. + /// + [DataMember()] + [StringLength(5)] + public string Size + { + get + { + return this._size; + } + set + { + if ((this._size != value)) + { + this.OnSizeChanging(value); + this.RaiseDataMemberChanging("Size"); + this.ValidateProperty("Size", value); + this._size = value; + this.RaiseDataMemberChanged("Size"); + this.OnSizeChanged(); + } + } + } + + /// + /// Gets or sets the 'SizeUnitMeasureCode' value. + /// + [DataMember()] + [RoundtripOriginal()] + [StringLength(3)] + public string SizeUnitMeasureCode + { + get + { + return this._sizeUnitMeasureCode; + } + set + { + if ((this._sizeUnitMeasureCode != value)) + { + this.OnSizeUnitMeasureCodeChanging(value); + this.RaiseDataMemberChanging("SizeUnitMeasureCode"); + this.ValidateProperty("SizeUnitMeasureCode", value); + this._sizeUnitMeasureCode = value; + this.RaiseDataMemberChanged("SizeUnitMeasureCode"); + this.OnSizeUnitMeasureCodeChanged(); + } + } + } + + /// + /// Gets or sets the 'StandardCost' value. + /// + [DataMember()] + public decimal StandardCost + { + get + { + return this._standardCost; + } + set + { + if ((this._standardCost != value)) + { + this.OnStandardCostChanging(value); + this.RaiseDataMemberChanging("StandardCost"); + this.ValidateProperty("StandardCost", value); + this._standardCost = value; + this.RaiseDataMemberChanged("StandardCost"); + this.OnStandardCostChanged(); + } + } + } + + /// + /// Gets or sets the 'Style' value. + /// + [DataMember()] + [StringLength(2)] + public string Style + { + get + { + return this._style; + } + set + { + if ((this._style != value)) + { + this.OnStyleChanging(value); + this.RaiseDataMemberChanging("Style"); + this.ValidateProperty("Style", value); + this._style = value; + this.RaiseDataMemberChanged("Style"); + this.OnStyleChanged(); + } + } + } + + /// + /// Gets or sets the 'Weight' value. + /// + [DataMember()] + [RoundtripOriginal()] + public Nullable Weight + { + get + { + return this._weight; + } + set + { + if ((this._weight != value)) + { + this.OnWeightChanging(value); + this.RaiseDataMemberChanging("Weight"); + this.ValidateProperty("Weight", value); + this._weight = value; + this.RaiseDataMemberChanged("Weight"); + this.OnWeightChanged(); + } + } + } + + /// + /// Gets or sets the 'WeightUnitMeasureCode' value. + /// + [DataMember()] + [RoundtripOriginal()] + [StringLength(3)] + public string WeightUnitMeasureCode + { + get + { + return this._weightUnitMeasureCode; + } + set + { + if ((this._weightUnitMeasureCode != value)) + { + this.OnWeightUnitMeasureCodeChanging(value); + this.RaiseDataMemberChanging("WeightUnitMeasureCode"); + this.ValidateProperty("WeightUnitMeasureCode", value); + this._weightUnitMeasureCode = value; + this.RaiseDataMemberChanged("WeightUnitMeasureCode"); + this.OnWeightUnitMeasureCodeChanged(); + } + } + } + + private void AttachPurchaseOrderDetails(PurchaseOrderDetail entity) + { + entity.Product = this; + } + + private void DetachPurchaseOrderDetails(PurchaseOrderDetail entity) + { + entity.Product = null; + } + + private bool FilterPurchaseOrderDetails(PurchaseOrderDetail entity) + { + return (entity.ProductID == this.ProductID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._productID; + } + } + + /// + /// The 'PurchaseOrder' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks")] + public sealed partial class PurchaseOrder : Entity + { + + private EntityRef _employee; + + private int _employeeID; + + private decimal _freight; + + private DateTime _modifiedDate; + + private DateTime _orderDate; + + private EntityCollection _purchaseOrderDetails; + + private int _purchaseOrderID; + + private byte _revisionNumber; + + private Nullable _shipDate; + + private int _shipMethodID; + + private byte _status; + + private decimal _subTotal; + + private decimal _taxAmt; + + private decimal _totalDue; + + private int _vendorID; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnEmployeeIDChanging(int value); + partial void OnEmployeeIDChanged(); + partial void OnFreightChanging(decimal value); + partial void OnFreightChanged(); + partial void OnModifiedDateChanging(DateTime value); + partial void OnModifiedDateChanged(); + partial void OnOrderDateChanging(DateTime value); + partial void OnOrderDateChanged(); + partial void OnPurchaseOrderIDChanging(int value); + partial void OnPurchaseOrderIDChanged(); + partial void OnRevisionNumberChanging(byte value); + partial void OnRevisionNumberChanged(); + partial void OnShipDateChanging(Nullable value); + partial void OnShipDateChanged(); + partial void OnShipMethodIDChanging(int value); + partial void OnShipMethodIDChanged(); + partial void OnStatusChanging(byte value); + partial void OnStatusChanged(); + partial void OnSubTotalChanging(decimal value); + partial void OnSubTotalChanged(); + partial void OnTaxAmtChanging(decimal value); + partial void OnTaxAmtChanged(); + partial void OnTotalDueChanging(decimal value); + partial void OnTotalDueChanged(); + partial void OnVendorIDChanging(int value); + partial void OnVendorIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public PurchaseOrder() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID", IsForeignKey=true)] + public Employee Employee + { + get + { + if ((this._employee == null)) + { + this._employee = new EntityRef(this, "Employee", this.FilterEmployee); + } + return this._employee.Entity; + } + set + { + Employee previous = this.Employee; + if ((previous != value)) + { + this.ValidateProperty("Employee", value); + if ((previous != null)) + { + this._employee.Entity = null; + previous.PurchaseOrders.Remove(this); + } + if ((value != null)) + { + this.EmployeeID = value.EmployeeID; + } + else + { + this.EmployeeID = default(int); + } + this._employee.Entity = value; + if ((value != null)) + { + value.PurchaseOrders.Add(this); + } + this.RaisePropertyChanged("Employee"); + } + } + } + + /// + /// Gets or sets the 'EmployeeID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public int EmployeeID + { + get + { + return this._employeeID; + } + set + { + if ((this._employeeID != value)) + { + this.OnEmployeeIDChanging(value); + this.RaiseDataMemberChanging("EmployeeID"); + this.ValidateProperty("EmployeeID", value); + this._employeeID = value; + this.RaiseDataMemberChanged("EmployeeID"); + this.OnEmployeeIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Freight' value. + /// + [DataMember()] + public decimal Freight + { + get + { + return this._freight; + } + set + { + if ((this._freight != value)) + { + this.OnFreightChanging(value); + this.RaiseDataMemberChanging("Freight"); + this.ValidateProperty("Freight", value); + this._freight = value; + this.RaiseDataMemberChanged("Freight"); + this.OnFreightChanged(); + } + } + } + + /// + /// Gets or sets the 'ModifiedDate' value. + /// + [DataMember()] + public DateTime ModifiedDate + { + get + { + return this._modifiedDate; + } + set + { + if ((this._modifiedDate != value)) + { + this.OnModifiedDateChanging(value); + this.RaiseDataMemberChanging("ModifiedDate"); + this.ValidateProperty("ModifiedDate", value); + this._modifiedDate = value; + this.RaiseDataMemberChanged("ModifiedDate"); + this.OnModifiedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'OrderDate' value. + /// + [DataMember()] + public DateTime OrderDate + { + get + { + return this._orderDate; + } + set + { + if ((this._orderDate != value)) + { + this.OnOrderDateChanging(value); + this.RaiseDataMemberChanging("OrderDate"); + this.ValidateProperty("OrderDate", value); + this._orderDate = value; + this.RaiseDataMemberChanged("OrderDate"); + this.OnOrderDateChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID")] + public EntityCollection PurchaseOrderDetails + { + get + { + if ((this._purchaseOrderDetails == null)) + { + this._purchaseOrderDetails = new EntityCollection(this, "PurchaseOrderDetails", this.FilterPurchaseOrderDetails, this.AttachPurchaseOrderDetails, this.DetachPurchaseOrderDetails); + } + return this._purchaseOrderDetails; + } + } + + /// + /// Gets or sets the 'PurchaseOrderID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int PurchaseOrderID + { + get + { + return this._purchaseOrderID; + } + set + { + if ((this._purchaseOrderID != value)) + { + this.OnPurchaseOrderIDChanging(value); + this.ValidateProperty("PurchaseOrderID", value); + this._purchaseOrderID = value; + this.RaisePropertyChanged("PurchaseOrderID"); + this.OnPurchaseOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the 'RevisionNumber' value. + /// + [DataMember()] + public byte RevisionNumber + { + get + { + return this._revisionNumber; + } + set + { + if ((this._revisionNumber != value)) + { + this.OnRevisionNumberChanging(value); + this.RaiseDataMemberChanging("RevisionNumber"); + this.ValidateProperty("RevisionNumber", value); + this._revisionNumber = value; + this.RaiseDataMemberChanged("RevisionNumber"); + this.OnRevisionNumberChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipDate' value. + /// + [DataMember()] + public Nullable ShipDate + { + get + { + return this._shipDate; + } + set + { + if ((this._shipDate != value)) + { + this.OnShipDateChanging(value); + this.RaiseDataMemberChanging("ShipDate"); + this.ValidateProperty("ShipDate", value); + this._shipDate = value; + this.RaiseDataMemberChanged("ShipDate"); + this.OnShipDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipMethodID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public int ShipMethodID + { + get + { + return this._shipMethodID; + } + set + { + if ((this._shipMethodID != value)) + { + this.OnShipMethodIDChanging(value); + this.RaiseDataMemberChanging("ShipMethodID"); + this.ValidateProperty("ShipMethodID", value); + this._shipMethodID = value; + this.RaiseDataMemberChanged("ShipMethodID"); + this.OnShipMethodIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Status' value. + /// + [DataMember()] + public byte Status + { + get + { + return this._status; + } + set + { + if ((this._status != value)) + { + this.OnStatusChanging(value); + this.RaiseDataMemberChanging("Status"); + this.ValidateProperty("Status", value); + this._status = value; + this.RaiseDataMemberChanged("Status"); + this.OnStatusChanged(); + } + } + } + + /// + /// Gets or sets the 'SubTotal' value. + /// + [DataMember()] + public decimal SubTotal + { + get + { + return this._subTotal; + } + set + { + if ((this._subTotal != value)) + { + this.OnSubTotalChanging(value); + this.RaiseDataMemberChanging("SubTotal"); + this.ValidateProperty("SubTotal", value); + this._subTotal = value; + this.RaiseDataMemberChanged("SubTotal"); + this.OnSubTotalChanged(); + } + } + } + + /// + /// Gets or sets the 'TaxAmt' value. + /// + [DataMember()] + public decimal TaxAmt + { + get + { + return this._taxAmt; + } + set + { + if ((this._taxAmt != value)) + { + this.OnTaxAmtChanging(value); + this.RaiseDataMemberChanging("TaxAmt"); + this.ValidateProperty("TaxAmt", value); + this._taxAmt = value; + this.RaiseDataMemberChanged("TaxAmt"); + this.OnTaxAmtChanged(); + } + } + } + + /// + /// Gets or sets the 'TotalDue' value. + /// + [DataMember()] + public decimal TotalDue + { + get + { + return this._totalDue; + } + set + { + if ((this._totalDue != value)) + { + this.OnTotalDueChanging(value); + this.RaiseDataMemberChanging("TotalDue"); + this.ValidateProperty("TotalDue", value); + this._totalDue = value; + this.RaiseDataMemberChanged("TotalDue"); + this.OnTotalDueChanged(); + } + } + } + + /// + /// Gets or sets the 'VendorID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public int VendorID + { + get + { + return this._vendorID; + } + set + { + if ((this._vendorID != value)) + { + this.OnVendorIDChanging(value); + this.RaiseDataMemberChanging("VendorID"); + this.ValidateProperty("VendorID", value); + this._vendorID = value; + this.RaiseDataMemberChanged("VendorID"); + this.OnVendorIDChanged(); + } + } + } + + private bool FilterEmployee(Employee entity) + { + return (entity.EmployeeID == this.EmployeeID); + } + + private void AttachPurchaseOrderDetails(PurchaseOrderDetail entity) + { + entity.PurchaseOrder = this; + } + + private void DetachPurchaseOrderDetails(PurchaseOrderDetail entity) + { + entity.PurchaseOrder = null; + } + + private bool FilterPurchaseOrderDetails(PurchaseOrderDetail entity) + { + return (entity.PurchaseOrderID == this.PurchaseOrderID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._purchaseOrderID; + } + } + + /// + /// The 'PurchaseOrderDetail' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.AdventureWorks")] + public sealed partial class PurchaseOrderDetail : Entity + { + + private DateTime _dueDate; + + private decimal _lineTotal; + + private DateTime _modifiedDate; + + private short _orderQty; + + private EntityRef _product; + + private int _productID; + + private EntityRef _purchaseOrder; + + private int _purchaseOrderDetailID; + + private int _purchaseOrderID; + + private decimal _receivedQty; + + private decimal _rejectedQty; + + private decimal _stockedQty; + + private decimal _unitPrice; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnDueDateChanging(DateTime value); + partial void OnDueDateChanged(); + partial void OnLineTotalChanging(decimal value); + partial void OnLineTotalChanged(); + partial void OnModifiedDateChanging(DateTime value); + partial void OnModifiedDateChanged(); + partial void OnOrderQtyChanging(short value); + partial void OnOrderQtyChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnPurchaseOrderDetailIDChanging(int value); + partial void OnPurchaseOrderDetailIDChanged(); + partial void OnPurchaseOrderIDChanging(int value); + partial void OnPurchaseOrderIDChanged(); + partial void OnReceivedQtyChanging(decimal value); + partial void OnReceivedQtyChanged(); + partial void OnRejectedQtyChanging(decimal value); + partial void OnRejectedQtyChanged(); + partial void OnStockedQtyChanging(decimal value); + partial void OnStockedQtyChanged(); + partial void OnUnitPriceChanging(decimal value); + partial void OnUnitPriceChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public PurchaseOrderDetail() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'DueDate' value. + /// + [DataMember()] + public DateTime DueDate + { + get + { + return this._dueDate; + } + set + { + if ((this._dueDate != value)) + { + this.OnDueDateChanging(value); + this.RaiseDataMemberChanging("DueDate"); + this.ValidateProperty("DueDate", value); + this._dueDate = value; + this.RaiseDataMemberChanged("DueDate"); + this.OnDueDateChanged(); + } + } + } + + /// + /// Gets or sets the 'LineTotal' value. + /// + [DataMember()] + public decimal LineTotal + { + get + { + return this._lineTotal; + } + set + { + if ((this._lineTotal != value)) + { + this.OnLineTotalChanging(value); + this.RaiseDataMemberChanging("LineTotal"); + this.ValidateProperty("LineTotal", value); + this._lineTotal = value; + this.RaiseDataMemberChanged("LineTotal"); + this.OnLineTotalChanged(); + } + } + } + + /// + /// Gets or sets the 'ModifiedDate' value. + /// + [DataMember()] + public DateTime ModifiedDate + { + get + { + return this._modifiedDate; + } + set + { + if ((this._modifiedDate != value)) + { + this.OnModifiedDateChanging(value); + this.RaiseDataMemberChanging("ModifiedDate"); + this.ValidateProperty("ModifiedDate", value); + this._modifiedDate = value; + this.RaiseDataMemberChanged("ModifiedDate"); + this.OnModifiedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'OrderQty' value. + /// + [DataMember()] + public short OrderQty + { + get + { + return this._orderQty; + } + set + { + if ((this._orderQty != value)) + { + this.OnOrderQtyChanging(value); + this.RaiseDataMemberChanging("OrderQty"); + this.ValidateProperty("OrderQty", value); + this._orderQty = value; + this.RaiseDataMemberChanged("OrderQty"); + this.OnOrderQtyChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID", IsForeignKey=true)] + public Product Product + { + get + { + if ((this._product == null)) + { + this._product = new EntityRef(this, "Product", this.FilterProduct); + } + return this._product.Entity; + } + set + { + Product previous = this.Product; + if ((previous != value)) + { + this.ValidateProperty("Product", value); + if ((previous != null)) + { + this._product.Entity = null; + previous.PurchaseOrderDetails.Remove(this); + } + if ((value != null)) + { + this.ProductID = value.ProductID; + } + else + { + this.ProductID = default(int); + } + this._product.Entity = value; + if ((value != null)) + { + value.PurchaseOrderDetails.Add(this); + } + this.RaisePropertyChanged("Product"); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.RaiseDataMemberChanging("ProductID"); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaiseDataMemberChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID", IsForeignKey=true)] + public PurchaseOrder PurchaseOrder + { + get + { + if ((this._purchaseOrder == null)) + { + this._purchaseOrder = new EntityRef(this, "PurchaseOrder", this.FilterPurchaseOrder); + } + return this._purchaseOrder.Entity; + } + set + { + PurchaseOrder previous = this.PurchaseOrder; + if ((previous != value)) + { + this.ValidateProperty("PurchaseOrder", value); + if ((previous != null)) + { + this._purchaseOrder.Entity = null; + previous.PurchaseOrderDetails.Remove(this); + } + if ((value != null)) + { + this.PurchaseOrderID = value.PurchaseOrderID; + } + else + { + this.PurchaseOrderID = default(int); + } + this._purchaseOrder.Entity = value; + if ((value != null)) + { + value.PurchaseOrderDetails.Add(this); + } + this.RaisePropertyChanged("PurchaseOrder"); + } + } + } + + /// + /// Gets or sets the 'PurchaseOrderDetailID' value. + /// + [DataMember()] + [Key()] + [RoundtripOriginal()] + public int PurchaseOrderDetailID + { + get + { + return this._purchaseOrderDetailID; + } + set + { + if ((this._purchaseOrderDetailID != value)) + { + this.OnPurchaseOrderDetailIDChanging(value); + this.RaiseDataMemberChanging("PurchaseOrderDetailID"); + this.ValidateProperty("PurchaseOrderDetailID", value); + this._purchaseOrderDetailID = value; + this.RaiseDataMemberChanged("PurchaseOrderDetailID"); + this.OnPurchaseOrderDetailIDChanged(); + } + } + } + + /// + /// Gets or sets the 'PurchaseOrderID' value. + /// + [DataMember()] + [Key()] + [RoundtripOriginal()] + public int PurchaseOrderID + { + get + { + return this._purchaseOrderID; + } + set + { + if ((this._purchaseOrderID != value)) + { + this.OnPurchaseOrderIDChanging(value); + this.RaiseDataMemberChanging("PurchaseOrderID"); + this.ValidateProperty("PurchaseOrderID", value); + this._purchaseOrderID = value; + this.RaiseDataMemberChanged("PurchaseOrderID"); + this.OnPurchaseOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ReceivedQty' value. + /// + [DataMember()] + public decimal ReceivedQty + { + get + { + return this._receivedQty; + } + set + { + if ((this._receivedQty != value)) + { + this.OnReceivedQtyChanging(value); + this.RaiseDataMemberChanging("ReceivedQty"); + this.ValidateProperty("ReceivedQty", value); + this._receivedQty = value; + this.RaiseDataMemberChanged("ReceivedQty"); + this.OnReceivedQtyChanged(); + } + } + } + + /// + /// Gets or sets the 'RejectedQty' value. + /// + [DataMember()] + public decimal RejectedQty + { + get + { + return this._rejectedQty; + } + set + { + if ((this._rejectedQty != value)) + { + this.OnRejectedQtyChanging(value); + this.RaiseDataMemberChanging("RejectedQty"); + this.ValidateProperty("RejectedQty", value); + this._rejectedQty = value; + this.RaiseDataMemberChanged("RejectedQty"); + this.OnRejectedQtyChanged(); + } + } + } + + /// + /// Gets or sets the 'StockedQty' value. + /// + [DataMember()] + public decimal StockedQty + { + get + { + return this._stockedQty; + } + set + { + if ((this._stockedQty != value)) + { + this.OnStockedQtyChanging(value); + this.RaiseDataMemberChanging("StockedQty"); + this.ValidateProperty("StockedQty", value); + this._stockedQty = value; + this.RaiseDataMemberChanged("StockedQty"); + this.OnStockedQtyChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitPrice' value. + /// + [DataMember()] + public decimal UnitPrice + { + get + { + return this._unitPrice; + } + set + { + if ((this._unitPrice != value)) + { + this.OnUnitPriceChanging(value); + this.RaiseDataMemberChanging("UnitPrice"); + this.ValidateProperty("UnitPrice", value); + this._unitPrice = value; + this.RaiseDataMemberChanged("UnitPrice"); + this.OnUnitPriceChanged(); + } + } + } + + private bool FilterProduct(Product entity) + { + return (entity.ProductID == this.ProductID); + } + + private bool FilterPurchaseOrder(PurchaseOrder entity) + { + return (entity.PurchaseOrderID == this.PurchaseOrderID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return EntityKey.Create(this._purchaseOrderDetailID, this._purchaseOrderID); + } + } +} +namespace TestDomainServices.DbCtx +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.ComponentModel.DataAnnotations; + using System.Linq; + using System.ServiceModel; + using System.Threading.Tasks; + using DbContextModels.AdventureWorks; + using OpenRiaServices; + using OpenRiaServices.Client; + using OpenRiaServices.Client.Authentication; + + + /// + /// The DomainContext corresponding to the 'Catalog' DomainService. + /// + public sealed partial class Catalog : DomainContext + { + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Catalog() : + this(new Uri("TestDomainServices-DbCtx-Catalog.svc", UriKind.Relative)) + { + } + + /// + /// Initializes a new instance of the class with the specified service URI. + /// + /// The Catalog service URI. + public Catalog(Uri serviceUri) : + this(DomainContext.CreateDomainClient(typeof(ICatalogContract), serviceUri, false)) + { + } + + /// + /// Initializes a new instance of the class with the specified . + /// + /// The DomainClient instance to use for this DomainContext. + public Catalog(DomainClient domainClient) : + base(domainClient) + { + this.OnCreated(); + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet EmployeeInfos + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Employees + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Products + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet PurchaseOrders + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetEmployeeInfos' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetEmployeeInfosQuery() + { + this.ValidateMethod("GetEmployeeInfosQuery", null); + return base.CreateQuery("GetEmployeeInfos", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetEmployees' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetEmployeesQuery() + { + this.ValidateMethod("GetEmployeesQuery", null); + return base.CreateQuery("GetEmployees", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductsQuery() + { + this.ValidateMethod("GetProductsQuery", null); + return base.CreateQuery("GetProducts", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductsByCategory' query. + /// + /// The value for the 'subCategoryID' parameter of the query. + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductsByCategoryQuery(int subCategoryID) + { + Dictionary parameters = new Dictionary(); + parameters.Add("subCategoryID", subCategoryID); + this.ValidateMethod("GetProductsByCategoryQuery", parameters); + return base.CreateQuery("GetProductsByCategory", parameters, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductsWithCaching' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductsWithCachingQuery() + { + this.ValidateMethod("GetProductsWithCachingQuery", null); + return base.CreateQuery("GetProductsWithCaching", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductsWithCustomTotalCount' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductsWithCustomTotalCountQuery() + { + this.ValidateMethod("GetProductsWithCustomTotalCountQuery", null); + return base.CreateQuery("GetProductsWithCustomTotalCount", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetPurchaseOrders' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetPurchaseOrdersQuery() + { + this.ValidateMethod("GetPurchaseOrdersQuery", null); + return base.CreateQuery("GetPurchaseOrders", null, false, true); + } + + /// + /// Creates a new EntityContainer for this DomainContext's EntitySets. + /// + /// A new container instance. + protected override EntityContainer CreateEntityContainer() + { + return new CatalogEntityContainer(); + } + + /// + /// Service contract for the 'Catalog' DomainService. + /// + [ServiceContract()] + public interface ICatalogContract + { + + /// + /// Asynchronously invokes the 'GetEmployeeInfos' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/GetEmployeeInfos", ReplyAction="http://tempuri.org/Catalog/GetEmployeeInfosResponse")] + IAsyncResult BeginGetEmployeeInfos(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetEmployeeInfos'. + /// + /// The IAsyncResult returned from 'BeginGetEmployeeInfos'. + /// The 'QueryResult' returned from the 'GetEmployeeInfos' operation. + QueryResult EndGetEmployeeInfos(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetEmployees' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/GetEmployees", ReplyAction="http://tempuri.org/Catalog/GetEmployeesResponse")] + IAsyncResult BeginGetEmployees(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetEmployees'. + /// + /// The IAsyncResult returned from 'BeginGetEmployees'. + /// The 'QueryResult' returned from the 'GetEmployees' operation. + QueryResult EndGetEmployees(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProducts' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/GetProducts", ReplyAction="http://tempuri.org/Catalog/GetProductsResponse")] + IAsyncResult BeginGetProducts(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProducts'. + /// + /// The IAsyncResult returned from 'BeginGetProducts'. + /// The 'QueryResult' returned from the 'GetProducts' operation. + QueryResult EndGetProducts(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductsByCategory' operation. + /// + /// The value for the 'subCategoryID' parameter of this action. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/GetProductsByCategory", ReplyAction="http://tempuri.org/Catalog/GetProductsByCategoryResponse")] + IAsyncResult BeginGetProductsByCategory(int subCategoryID, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductsByCategory'. + /// + /// The IAsyncResult returned from 'BeginGetProductsByCategory'. + /// The 'QueryResult' returned from the 'GetProductsByCategory' operation. + QueryResult EndGetProductsByCategory(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductsWithCaching' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/GetProductsWithCaching", ReplyAction="http://tempuri.org/Catalog/GetProductsWithCachingResponse")] + IAsyncResult BeginGetProductsWithCaching(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductsWithCaching'. + /// + /// The IAsyncResult returned from 'BeginGetProductsWithCaching'. + /// The 'QueryResult' returned from the 'GetProductsWithCaching' operation. + QueryResult EndGetProductsWithCaching(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductsWithCustomTotalCount' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/GetProductsWithCustomTotalCount", ReplyAction="http://tempuri.org/Catalog/GetProductsWithCustomTotalCountResponse")] + IAsyncResult BeginGetProductsWithCustomTotalCount(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductsWithCustomTotalCount'. + /// + /// The IAsyncResult returned from 'BeginGetProductsWithCustomTotalCount'. + /// The 'QueryResult' returned from the 'GetProductsWithCustomTotalCount' operation. + QueryResult EndGetProductsWithCustomTotalCount(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetPurchaseOrders' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/GetPurchaseOrders", ReplyAction="http://tempuri.org/Catalog/GetPurchaseOrdersResponse")] + IAsyncResult BeginGetPurchaseOrders(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetPurchaseOrders'. + /// + /// The IAsyncResult returned from 'BeginGetPurchaseOrders'. + /// The 'QueryResult' returned from the 'GetPurchaseOrders' operation. + QueryResult EndGetPurchaseOrders(IAsyncResult result); + + /// + /// Asynchronously invokes the 'SubmitChanges' operation. + /// + /// The change-set to submit. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Catalog/SubmitChanges", ReplyAction="http://tempuri.org/Catalog/SubmitChangesResponse")] + IAsyncResult BeginSubmitChanges(IEnumerable changeSet, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginSubmitChanges'. + /// + /// The IAsyncResult returned from 'BeginSubmitChanges'. + /// The collection of change-set entry elements returned from 'SubmitChanges'. + IEnumerable EndSubmitChanges(IAsyncResult result); + } + + internal sealed class CatalogEntityContainer : EntityContainer + { + + public CatalogEntityContainer() + { + this.CreateEntitySet(EntitySetOperations.None); + this.CreateEntitySet(EntitySetOperations.None); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + } + } + } +} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb new file mode 100644 index 000000000..732334525 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb @@ -0,0 +1,2644 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34209 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Compare Binary +Option Infer On +Option Strict On +Option Explicit On + +Imports DbContextModels.AdventureWorks +Imports OpenRiaServices +Imports OpenRiaServices.Client +Imports OpenRiaServices.Client.Authentication +Imports System +Imports System.Collections.Generic +Imports System.ComponentModel +Imports System.ComponentModel.DataAnnotations +Imports System.Linq +Imports System.Runtime.Serialization +Imports System.ServiceModel +Imports System.Threading.Tasks + +Namespace DbContextModels.AdventureWorks + + ''' + ''' The 'Employee' entity class. + ''' + _ + Partial Public NotInheritable Class Employee + Inherits Entity + + Private _birthDate As DateTime + + Private _contactID As Integer + + Private _currentFlag As Boolean + + Private _employeeID As Integer + + Private _gender As String + + Private _hireDate As DateTime + + Private _loginID As String + + Private _manager As EntityRef(Of Employee) + + Private _managerID As Nullable(Of Integer) + + Private _maritalStatus As String + + Private _modifiedDate As DateTime + + Private _nationalIDNumber As String + + Private _purchaseOrders As EntityCollection(Of PurchaseOrder) + + Private _reports As EntityCollection(Of Employee) + + Private _rowguid As Guid + + Private _salariedFlag As Boolean + + Private _sickLeaveHours As Short + + Private _title As String + + Private _vacationHours As Short + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnBirthDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnBirthDateChanged() + End Sub + Private Partial Sub OnContactIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnContactIDChanged() + End Sub + Private Partial Sub OnCurrentFlagChanging(ByVal value As Boolean) + End Sub + Private Partial Sub OnCurrentFlagChanged() + End Sub + Private Partial Sub OnEmployeeIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnEmployeeIDChanged() + End Sub + Private Partial Sub OnGenderChanging(ByVal value As String) + End Sub + Private Partial Sub OnGenderChanged() + End Sub + Private Partial Sub OnHireDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnHireDateChanged() + End Sub + Private Partial Sub OnLoginIDChanging(ByVal value As String) + End Sub + Private Partial Sub OnLoginIDChanged() + End Sub + Private Partial Sub OnManagerIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Private Partial Sub OnManagerIDChanged() + End Sub + Private Partial Sub OnMaritalStatusChanging(ByVal value As String) + End Sub + Private Partial Sub OnMaritalStatusChanged() + End Sub + Private Partial Sub OnModifiedDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnModifiedDateChanged() + End Sub + Private Partial Sub OnNationalIDNumberChanging(ByVal value As String) + End Sub + Private Partial Sub OnNationalIDNumberChanged() + End Sub + Private Partial Sub OnrowguidChanging(ByVal value As Guid) + End Sub + Private Partial Sub OnrowguidChanged() + End Sub + Private Partial Sub OnSalariedFlagChanging(ByVal value As Boolean) + End Sub + Private Partial Sub OnSalariedFlagChanged() + End Sub + Private Partial Sub OnSickLeaveHoursChanging(ByVal value As Short) + End Sub + Private Partial Sub OnSickLeaveHoursChanged() + End Sub + Private Partial Sub OnTitleChanging(ByVal value As String) + End Sub + Private Partial Sub OnTitleChanged() + End Sub + Private Partial Sub OnVacationHoursChanging(ByVal value As Short) + End Sub + Private Partial Sub OnVacationHoursChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'BirthDate' value. + ''' + _ + Public Property BirthDate() As DateTime + Get + Return Me._birthDate + End Get + Set + If ((Me._birthDate = value) _ + = false) Then + Me.OnBirthDateChanging(value) + Me.RaiseDataMemberChanging("BirthDate") + Me.ValidateProperty("BirthDate", value) + Me._birthDate = value + Me.RaiseDataMemberChanged("BirthDate") + Me.OnBirthDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ContactID' value. + ''' + _ + Public Property ContactID() As Integer + Get + Return Me._contactID + End Get + Set + If ((Me._contactID = value) _ + = false) Then + Me.OnContactIDChanging(value) + Me.RaiseDataMemberChanging("ContactID") + Me.ValidateProperty("ContactID", value) + Me._contactID = value + Me.RaiseDataMemberChanged("ContactID") + Me.OnContactIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CurrentFlag' value. + ''' + _ + Public Property CurrentFlag() As Boolean + Get + Return Me._currentFlag + End Get + Set + If ((Me._currentFlag = value) _ + = false) Then + Me.OnCurrentFlagChanging(value) + Me.RaiseDataMemberChanging("CurrentFlag") + Me.ValidateProperty("CurrentFlag", value) + Me._currentFlag = value + Me.RaiseDataMemberChanged("CurrentFlag") + Me.OnCurrentFlagChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'EmployeeID' value. + ''' + _ + Public Property EmployeeID() As Integer + Get + Return Me._employeeID + End Get + Set + If ((Me._employeeID = value) _ + = false) Then + Me.OnEmployeeIDChanging(value) + Me.ValidateProperty("EmployeeID", value) + Me._employeeID = value + Me.RaisePropertyChanged("EmployeeID") + Me.OnEmployeeIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Gender' value. + ''' + _ + Public Property Gender() As String + Get + Return Me._gender + End Get + Set + If (String.Equals(Me._gender, value) = false) Then + Me.OnGenderChanging(value) + Me.RaiseDataMemberChanging("Gender") + Me.ValidateProperty("Gender", value) + Me._gender = value + Me.RaiseDataMemberChanged("Gender") + Me.OnGenderChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'HireDate' value. + ''' + _ + Public Property HireDate() As DateTime + Get + Return Me._hireDate + End Get + Set + If ((Me._hireDate = value) _ + = false) Then + Me.OnHireDateChanging(value) + Me.RaiseDataMemberChanging("HireDate") + Me.ValidateProperty("HireDate", value) + Me._hireDate = value + Me.RaiseDataMemberChanged("HireDate") + Me.OnHireDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'LoginID' value. + ''' + _ + Public Property LoginID() As String + Get + Return Me._loginID + End Get + Set + If (String.Equals(Me._loginID, value) = false) Then + Me.OnLoginIDChanging(value) + Me.RaiseDataMemberChanging("LoginID") + Me.ValidateProperty("LoginID", value) + Me._loginID = value + Me.RaiseDataMemberChanged("LoginID") + Me.OnLoginIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Manager() As Employee + Get + If (Me._manager Is Nothing) Then + Me._manager = New EntityRef(Of Employee)(Me, "Manager", AddressOf Me.FilterManager) + End If + Return Me._manager.Entity + End Get + Set + Dim previous As Employee = Me.Manager + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Manager", value) + If (Not (previous) Is Nothing) Then + Me._manager.Entity = Nothing + previous.Reports.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.ManagerID = value.EmployeeID + Else + Me.ManagerID = CType(Nothing, Nullable(Of Integer)) + End If + Me._manager.Entity = value + If (Not (value) Is Nothing) Then + value.Reports.Add(Me) + End If + Me.RaisePropertyChanged("Manager") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ManagerID' value. + ''' + _ + Public Property ManagerID() As Nullable(Of Integer) + Get + Return Me._managerID + End Get + Set + If (Me._managerID.Equals(value) = false) Then + Me.OnManagerIDChanging(value) + Me.RaiseDataMemberChanging("ManagerID") + Me.ValidateProperty("ManagerID", value) + Me._managerID = value + Me.RaiseDataMemberChanged("ManagerID") + Me.OnManagerIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'MaritalStatus' value. + ''' + _ + Public Property MaritalStatus() As String + Get + Return Me._maritalStatus + End Get + Set + If (String.Equals(Me._maritalStatus, value) = false) Then + Me.OnMaritalStatusChanging(value) + Me.RaiseDataMemberChanging("MaritalStatus") + Me.ValidateProperty("MaritalStatus", value) + Me._maritalStatus = value + Me.RaiseDataMemberChanged("MaritalStatus") + Me.OnMaritalStatusChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ModifiedDate' value. + ''' + _ + Public Property ModifiedDate() As DateTime + Get + Return Me._modifiedDate + End Get + Set + If ((Me._modifiedDate = value) _ + = false) Then + Me.OnModifiedDateChanging(value) + Me.RaiseDataMemberChanging("ModifiedDate") + Me.ValidateProperty("ModifiedDate", value) + Me._modifiedDate = value + Me.RaiseDataMemberChanged("ModifiedDate") + Me.OnModifiedDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'NationalIDNumber' value. + ''' + _ + Public Property NationalIDNumber() As String + Get + Return Me._nationalIDNumber + End Get + Set + If (String.Equals(Me._nationalIDNumber, value) = false) Then + Me.OnNationalIDNumberChanging(value) + Me.RaiseDataMemberChanging("NationalIDNumber") + Me.ValidateProperty("NationalIDNumber", value) + Me._nationalIDNumber = value + Me.RaiseDataMemberChanged("NationalIDNumber") + Me.OnNationalIDNumberChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property PurchaseOrders() As EntityCollection(Of PurchaseOrder) + Get + If (Me._purchaseOrders Is Nothing) Then + Me._purchaseOrders = New EntityCollection(Of PurchaseOrder)(Me, "PurchaseOrders", AddressOf Me.FilterPurchaseOrders, AddressOf Me.AttachPurchaseOrders, AddressOf Me.DetachPurchaseOrders) + End If + Return Me._purchaseOrders + End Get + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Reports() As EntityCollection(Of Employee) + Get + If (Me._reports Is Nothing) Then + Me._reports = New EntityCollection(Of Employee)(Me, "Reports", AddressOf Me.FilterReports, AddressOf Me.AttachReports, AddressOf Me.DetachReports) + End If + Return Me._reports + End Get + End Property + + ''' + ''' Gets or sets the 'rowguid' value. + ''' + _ + Public Property rowguid() As Guid + Get + Return Me._rowguid + End Get + Set + If ((Me._rowguid = value) _ + = false) Then + Me.OnrowguidChanging(value) + Me.RaiseDataMemberChanging("rowguid") + Me.ValidateProperty("rowguid", value) + Me._rowguid = value + Me.RaiseDataMemberChanged("rowguid") + Me.OnrowguidChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SalariedFlag' value. + ''' + _ + Public Property SalariedFlag() As Boolean + Get + Return Me._salariedFlag + End Get + Set + If ((Me._salariedFlag = value) _ + = false) Then + Me.OnSalariedFlagChanging(value) + Me.RaiseDataMemberChanging("SalariedFlag") + Me.ValidateProperty("SalariedFlag", value) + Me._salariedFlag = value + Me.RaiseDataMemberChanged("SalariedFlag") + Me.OnSalariedFlagChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SickLeaveHours' value. + ''' + _ + Public Property SickLeaveHours() As Short + Get + Return Me._sickLeaveHours + End Get + Set + If ((Me._sickLeaveHours = value) _ + = false) Then + Me.OnSickLeaveHoursChanging(value) + Me.RaiseDataMemberChanging("SickLeaveHours") + Me.ValidateProperty("SickLeaveHours", value) + Me._sickLeaveHours = value + Me.RaiseDataMemberChanged("SickLeaveHours") + Me.OnSickLeaveHoursChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Title' value. + ''' + _ + Public Property Title() As String + Get + Return Me._title + End Get + Set + If (String.Equals(Me._title, value) = false) Then + Me.OnTitleChanging(value) + Me.RaiseDataMemberChanging("Title") + Me.ValidateProperty("Title", value) + Me._title = value + Me.RaiseDataMemberChanged("Title") + Me.OnTitleChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'VacationHours' value. + ''' + _ + Public Property VacationHours() As Short + Get + Return Me._vacationHours + End Get + Set + If ((Me._vacationHours = value) _ + = false) Then + Me.OnVacationHoursChanging(value) + Me.RaiseDataMemberChanging("VacationHours") + Me.ValidateProperty("VacationHours", value) + Me._vacationHours = value + Me.RaiseDataMemberChanged("VacationHours") + Me.OnVacationHoursChanged + End If + End Set + End Property + + Private Function FilterManager(ByVal entity As Employee) As Boolean + Return Object.Equals(entity.EmployeeID, Me.ManagerID) + End Function + + Private Sub AttachPurchaseOrders(ByVal entity As PurchaseOrder) + entity.Employee = Me + End Sub + + Private Sub DetachPurchaseOrders(ByVal entity As PurchaseOrder) + entity.Employee = Nothing + End Sub + + Private Function FilterPurchaseOrders(ByVal entity As PurchaseOrder) As Boolean + Return Object.Equals(entity.EmployeeID, Me.EmployeeID) + End Function + + Private Sub AttachReports(ByVal entity As Employee) + entity.Manager = Me + End Sub + + Private Sub DetachReports(ByVal entity As Employee) + entity.Manager = Nothing + End Sub + + Private Function FilterReports(ByVal entity As Employee) As Boolean + Return Object.Equals(entity.ManagerID, Me.EmployeeID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._employeeID + End Function + End Class + + ''' + ''' The 'EmployeeInfo' entity class. + ''' + _ + Partial Public NotInheritable Class EmployeeInfo + Inherits Entity + + Private _employeeID As Integer + + Private _firstName As String + + Private _lastName As String + + Private _territoryID As Integer + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnEmployeeIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnEmployeeIDChanged() + End Sub + Private Partial Sub OnFirstNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnFirstNameChanged() + End Sub + Private Partial Sub OnLastNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnLastNameChanged() + End Sub + Private Partial Sub OnTerritoryIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnTerritoryIDChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'EmployeeID' value. + ''' + _ + Public Property EmployeeID() As Integer + Get + Return Me._employeeID + End Get + Set + If ((Me._employeeID = value) _ + = false) Then + Me.OnEmployeeIDChanging(value) + Me.ValidateProperty("EmployeeID", value) + Me._employeeID = value + Me.RaisePropertyChanged("EmployeeID") + Me.OnEmployeeIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'FirstName' value. + ''' + _ + Public Property FirstName() As String + Get + Return Me._firstName + End Get + Set + If (String.Equals(Me._firstName, value) = false) Then + Me.OnFirstNameChanging(value) + Me.RaiseDataMemberChanging("FirstName") + Me.ValidateProperty("FirstName", value) + Me._firstName = value + Me.RaiseDataMemberChanged("FirstName") + Me.OnFirstNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'LastName' value. + ''' + _ + Public Property LastName() As String + Get + Return Me._lastName + End Get + Set + If (String.Equals(Me._lastName, value) = false) Then + Me.OnLastNameChanging(value) + Me.RaiseDataMemberChanging("LastName") + Me.ValidateProperty("LastName", value) + Me._lastName = value + Me.RaiseDataMemberChanged("LastName") + Me.OnLastNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TerritoryID' value. + ''' + _ + Public Property TerritoryID() As Integer + Get + Return Me._territoryID + End Get + Set + If ((Me._territoryID = value) _ + = false) Then + Me.OnTerritoryIDChanging(value) + Me.RaiseDataMemberChanging("TerritoryID") + Me.ValidateProperty("TerritoryID", value) + Me._territoryID = value + Me.RaiseDataMemberChanged("TerritoryID") + Me.OnTerritoryIDChanged + End If + End Set + End Property + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._employeeID + End Function + End Class + + ''' + ''' The 'Product' entity class. + ''' + _ + Partial Public NotInheritable Class Product + Inherits Entity + + Private _class As String + + Private _color As String + + Private _daysToManufacture As Integer + + Private _discontinuedDate As Nullable(Of DateTime) + + Private _finishedGoodsFlag As Boolean + + Private _listPrice As Decimal + + Private _makeFlag As Boolean + + Private _modifiedDate As DateTime + + Private _name As String + + Private _productID As Integer + + Private _productLine As String + + Private _productModelID As Nullable(Of Integer) + + Private _productNumber As String + + Private _productSubcategoryID As Nullable(Of Integer) + + Private _purchaseOrderDetails As EntityCollection(Of PurchaseOrderDetail) + + Private _reorderPoint As Short + + Private _rowguid As Guid + + Private _sellEndDate As Nullable(Of DateTime) + + Private _sellStartDate As DateTime + + Private _size As String + + Private _sizeUnitMeasureCode As String + + Private _standardCost As Decimal + + Private _style As String + + Private _weight As Nullable(Of Decimal) + + Private _weightUnitMeasureCode As String + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnClassChanging(ByVal value As String) + End Sub + Private Partial Sub OnClassChanged() + End Sub + Private Partial Sub OnColorChanging(ByVal value As String) + End Sub + Private Partial Sub OnColorChanged() + End Sub + Private Partial Sub OnDaysToManufactureChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnDaysToManufactureChanged() + End Sub + Private Partial Sub OnDiscontinuedDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Private Partial Sub OnDiscontinuedDateChanged() + End Sub + Private Partial Sub OnFinishedGoodsFlagChanging(ByVal value As Boolean) + End Sub + Private Partial Sub OnFinishedGoodsFlagChanged() + End Sub + Private Partial Sub OnListPriceChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnListPriceChanged() + End Sub + Private Partial Sub OnMakeFlagChanging(ByVal value As Boolean) + End Sub + Private Partial Sub OnMakeFlagChanged() + End Sub + Private Partial Sub OnModifiedDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnModifiedDateChanged() + End Sub + Private Partial Sub OnNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnNameChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnProductLineChanging(ByVal value As String) + End Sub + Private Partial Sub OnProductLineChanged() + End Sub + Private Partial Sub OnProductModelIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Private Partial Sub OnProductModelIDChanged() + End Sub + Private Partial Sub OnProductNumberChanging(ByVal value As String) + End Sub + Private Partial Sub OnProductNumberChanged() + End Sub + Private Partial Sub OnProductSubcategoryIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Private Partial Sub OnProductSubcategoryIDChanged() + End Sub + Private Partial Sub OnReorderPointChanging(ByVal value As Short) + End Sub + Private Partial Sub OnReorderPointChanged() + End Sub + Private Partial Sub OnrowguidChanging(ByVal value As Guid) + End Sub + Private Partial Sub OnrowguidChanged() + End Sub + Private Partial Sub OnSellEndDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Private Partial Sub OnSellEndDateChanged() + End Sub + Private Partial Sub OnSellStartDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnSellStartDateChanged() + End Sub + Private Partial Sub OnSizeChanging(ByVal value As String) + End Sub + Private Partial Sub OnSizeChanged() + End Sub + Private Partial Sub OnSizeUnitMeasureCodeChanging(ByVal value As String) + End Sub + Private Partial Sub OnSizeUnitMeasureCodeChanged() + End Sub + Private Partial Sub OnStandardCostChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnStandardCostChanged() + End Sub + Private Partial Sub OnStyleChanging(ByVal value As String) + End Sub + Private Partial Sub OnStyleChanged() + End Sub + Private Partial Sub OnWeightChanging(ByVal value As Nullable(Of Decimal)) + End Sub + Private Partial Sub OnWeightChanged() + End Sub + Private Partial Sub OnWeightUnitMeasureCodeChanging(ByVal value As String) + End Sub + Private Partial Sub OnWeightUnitMeasureCodeChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'Class' value. + ''' + _ + Public Property [Class]() As String + Get + Return Me._class + End Get + Set + If (String.Equals(Me._class, value) = false) Then + Me.OnClassChanging(value) + Me.RaiseDataMemberChanging("Class") + Me.ValidateProperty("Class", value) + Me._class = value + Me.RaiseDataMemberChanged("Class") + Me.OnClassChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Color' value. + ''' + _ + Public Property Color() As String + Get + Return Me._color + End Get + Set + If (String.Equals(Me._color, value) = false) Then + Me.OnColorChanging(value) + Me.RaiseDataMemberChanging("Color") + Me.ValidateProperty("Color", value) + Me._color = value + Me.RaiseDataMemberChanged("Color") + Me.OnColorChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'DaysToManufacture' value. + ''' + _ + Public Property DaysToManufacture() As Integer + Get + Return Me._daysToManufacture + End Get + Set + If ((Me._daysToManufacture = value) _ + = false) Then + Me.OnDaysToManufactureChanging(value) + Me.RaiseDataMemberChanging("DaysToManufacture") + Me.ValidateProperty("DaysToManufacture", value) + Me._daysToManufacture = value + Me.RaiseDataMemberChanged("DaysToManufacture") + Me.OnDaysToManufactureChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'DiscontinuedDate' value. + ''' + _ + Public Property DiscontinuedDate() As Nullable(Of DateTime) + Get + Return Me._discontinuedDate + End Get + Set + If (Me._discontinuedDate.Equals(value) = false) Then + Me.OnDiscontinuedDateChanging(value) + Me.RaiseDataMemberChanging("DiscontinuedDate") + Me.ValidateProperty("DiscontinuedDate", value) + Me._discontinuedDate = value + Me.RaiseDataMemberChanged("DiscontinuedDate") + Me.OnDiscontinuedDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'FinishedGoodsFlag' value. + ''' + _ + Public Property FinishedGoodsFlag() As Boolean + Get + Return Me._finishedGoodsFlag + End Get + Set + If ((Me._finishedGoodsFlag = value) _ + = false) Then + Me.OnFinishedGoodsFlagChanging(value) + Me.RaiseDataMemberChanging("FinishedGoodsFlag") + Me.ValidateProperty("FinishedGoodsFlag", value) + Me._finishedGoodsFlag = value + Me.RaiseDataMemberChanged("FinishedGoodsFlag") + Me.OnFinishedGoodsFlagChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ListPrice' value. + ''' + _ + Public Property ListPrice() As Decimal + Get + Return Me._listPrice + End Get + Set + If ((Me._listPrice = value) _ + = false) Then + Me.OnListPriceChanging(value) + Me.RaiseDataMemberChanging("ListPrice") + Me.ValidateProperty("ListPrice", value) + Me._listPrice = value + Me.RaiseDataMemberChanged("ListPrice") + Me.OnListPriceChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'MakeFlag' value. + ''' + _ + Public Property MakeFlag() As Boolean + Get + Return Me._makeFlag + End Get + Set + If ((Me._makeFlag = value) _ + = false) Then + Me.OnMakeFlagChanging(value) + Me.RaiseDataMemberChanging("MakeFlag") + Me.ValidateProperty("MakeFlag", value) + Me._makeFlag = value + Me.RaiseDataMemberChanged("MakeFlag") + Me.OnMakeFlagChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ModifiedDate' value. + ''' + _ + Public Property ModifiedDate() As DateTime + Get + Return Me._modifiedDate + End Get + Set + If ((Me._modifiedDate = value) _ + = false) Then + Me.OnModifiedDateChanging(value) + Me.RaiseDataMemberChanging("ModifiedDate") + Me.ValidateProperty("ModifiedDate", value) + Me._modifiedDate = value + Me.RaiseDataMemberChanged("ModifiedDate") + Me.OnModifiedDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Name' value. + ''' + _ + Public Property Name() As String + Get + Return Me._name + End Get + Set + If (String.Equals(Me._name, value) = false) Then + Me.OnNameChanging(value) + Me.RaiseDataMemberChanging("Name") + Me.ValidateProperty("Name", value) + Me._name = value + Me.RaiseDataMemberChanged("Name") + Me.OnNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaisePropertyChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductLine' value. + ''' + _ + Public Property ProductLine() As String + Get + Return Me._productLine + End Get + Set + If (String.Equals(Me._productLine, value) = false) Then + Me.OnProductLineChanging(value) + Me.RaiseDataMemberChanging("ProductLine") + Me.ValidateProperty("ProductLine", value) + Me._productLine = value + Me.RaiseDataMemberChanged("ProductLine") + Me.OnProductLineChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductModelID' value. + ''' + _ + Public Property ProductModelID() As Nullable(Of Integer) + Get + Return Me._productModelID + End Get + Set + If (Me._productModelID.Equals(value) = false) Then + Me.OnProductModelIDChanging(value) + Me.RaiseDataMemberChanging("ProductModelID") + Me.ValidateProperty("ProductModelID", value) + Me._productModelID = value + Me.RaiseDataMemberChanged("ProductModelID") + Me.OnProductModelIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductNumber' value. + ''' + _ + Public Property ProductNumber() As String + Get + Return Me._productNumber + End Get + Set + If (String.Equals(Me._productNumber, value) = false) Then + Me.OnProductNumberChanging(value) + Me.RaiseDataMemberChanging("ProductNumber") + Me.ValidateProperty("ProductNumber", value) + Me._productNumber = value + Me.RaiseDataMemberChanged("ProductNumber") + Me.OnProductNumberChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductSubcategoryID' value. + ''' + _ + Public Property ProductSubcategoryID() As Nullable(Of Integer) + Get + Return Me._productSubcategoryID + End Get + Set + If (Me._productSubcategoryID.Equals(value) = false) Then + Me.OnProductSubcategoryIDChanging(value) + Me.RaiseDataMemberChanging("ProductSubcategoryID") + Me.ValidateProperty("ProductSubcategoryID", value) + Me._productSubcategoryID = value + Me.RaiseDataMemberChanged("ProductSubcategoryID") + Me.OnProductSubcategoryIDChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail) + Get + If (Me._purchaseOrderDetails Is Nothing) Then + Me._purchaseOrderDetails = New EntityCollection(Of PurchaseOrderDetail)(Me, "PurchaseOrderDetails", AddressOf Me.FilterPurchaseOrderDetails, AddressOf Me.AttachPurchaseOrderDetails, AddressOf Me.DetachPurchaseOrderDetails) + End If + Return Me._purchaseOrderDetails + End Get + End Property + + ''' + ''' Gets or sets the 'ReorderPoint' value. + ''' + _ + Public Property ReorderPoint() As Short + Get + Return Me._reorderPoint + End Get + Set + If ((Me._reorderPoint = value) _ + = false) Then + Me.OnReorderPointChanging(value) + Me.RaiseDataMemberChanging("ReorderPoint") + Me.ValidateProperty("ReorderPoint", value) + Me._reorderPoint = value + Me.RaiseDataMemberChanged("ReorderPoint") + Me.OnReorderPointChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'rowguid' value. + ''' + _ + Public Property rowguid() As Guid + Get + Return Me._rowguid + End Get + Set + If ((Me._rowguid = value) _ + = false) Then + Me.OnrowguidChanging(value) + Me.RaiseDataMemberChanging("rowguid") + Me.ValidateProperty("rowguid", value) + Me._rowguid = value + Me.RaiseDataMemberChanged("rowguid") + Me.OnrowguidChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SellEndDate' value. + ''' + _ + Public Property SellEndDate() As Nullable(Of DateTime) + Get + Return Me._sellEndDate + End Get + Set + If (Me._sellEndDate.Equals(value) = false) Then + Me.OnSellEndDateChanging(value) + Me.RaiseDataMemberChanging("SellEndDate") + Me.ValidateProperty("SellEndDate", value) + Me._sellEndDate = value + Me.RaiseDataMemberChanged("SellEndDate") + Me.OnSellEndDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SellStartDate' value. + ''' + _ + Public Property SellStartDate() As DateTime + Get + Return Me._sellStartDate + End Get + Set + If ((Me._sellStartDate = value) _ + = false) Then + Me.OnSellStartDateChanging(value) + Me.RaiseDataMemberChanging("SellStartDate") + Me.ValidateProperty("SellStartDate", value) + Me._sellStartDate = value + Me.RaiseDataMemberChanged("SellStartDate") + Me.OnSellStartDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Size' value. + ''' + _ + Public Property Size() As String + Get + Return Me._size + End Get + Set + If (String.Equals(Me._size, value) = false) Then + Me.OnSizeChanging(value) + Me.RaiseDataMemberChanging("Size") + Me.ValidateProperty("Size", value) + Me._size = value + Me.RaiseDataMemberChanged("Size") + Me.OnSizeChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SizeUnitMeasureCode' value. + ''' + _ + Public Property SizeUnitMeasureCode() As String + Get + Return Me._sizeUnitMeasureCode + End Get + Set + If (String.Equals(Me._sizeUnitMeasureCode, value) = false) Then + Me.OnSizeUnitMeasureCodeChanging(value) + Me.RaiseDataMemberChanging("SizeUnitMeasureCode") + Me.ValidateProperty("SizeUnitMeasureCode", value) + Me._sizeUnitMeasureCode = value + Me.RaiseDataMemberChanged("SizeUnitMeasureCode") + Me.OnSizeUnitMeasureCodeChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'StandardCost' value. + ''' + _ + Public Property StandardCost() As Decimal + Get + Return Me._standardCost + End Get + Set + If ((Me._standardCost = value) _ + = false) Then + Me.OnStandardCostChanging(value) + Me.RaiseDataMemberChanging("StandardCost") + Me.ValidateProperty("StandardCost", value) + Me._standardCost = value + Me.RaiseDataMemberChanged("StandardCost") + Me.OnStandardCostChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Style' value. + ''' + _ + Public Property Style() As String + Get + Return Me._style + End Get + Set + If (String.Equals(Me._style, value) = false) Then + Me.OnStyleChanging(value) + Me.RaiseDataMemberChanging("Style") + Me.ValidateProperty("Style", value) + Me._style = value + Me.RaiseDataMemberChanged("Style") + Me.OnStyleChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Weight' value. + ''' + _ + Public Property Weight() As Nullable(Of Decimal) + Get + Return Me._weight + End Get + Set + If (Me._weight.Equals(value) = false) Then + Me.OnWeightChanging(value) + Me.RaiseDataMemberChanging("Weight") + Me.ValidateProperty("Weight", value) + Me._weight = value + Me.RaiseDataMemberChanged("Weight") + Me.OnWeightChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'WeightUnitMeasureCode' value. + ''' + _ + Public Property WeightUnitMeasureCode() As String + Get + Return Me._weightUnitMeasureCode + End Get + Set + If (String.Equals(Me._weightUnitMeasureCode, value) = false) Then + Me.OnWeightUnitMeasureCodeChanging(value) + Me.RaiseDataMemberChanging("WeightUnitMeasureCode") + Me.ValidateProperty("WeightUnitMeasureCode", value) + Me._weightUnitMeasureCode = value + Me.RaiseDataMemberChanged("WeightUnitMeasureCode") + Me.OnWeightUnitMeasureCodeChanged + End If + End Set + End Property + + Private Sub AttachPurchaseOrderDetails(ByVal entity As PurchaseOrderDetail) + entity.Product = Me + End Sub + + Private Sub DetachPurchaseOrderDetails(ByVal entity As PurchaseOrderDetail) + entity.Product = Nothing + End Sub + + Private Function FilterPurchaseOrderDetails(ByVal entity As PurchaseOrderDetail) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._productID + End Function + End Class + + ''' + ''' The 'PurchaseOrder' entity class. + ''' + _ + Partial Public NotInheritable Class PurchaseOrder + Inherits Entity + + Private _employee As EntityRef(Of Employee) + + Private _employeeID As Integer + + Private _freight As Decimal + + Private _modifiedDate As DateTime + + Private _orderDate As DateTime + + Private _purchaseOrderDetails As EntityCollection(Of PurchaseOrderDetail) + + Private _purchaseOrderID As Integer + + Private _revisionNumber As Byte + + Private _shipDate As Nullable(Of DateTime) + + Private _shipMethodID As Integer + + Private _status As Byte + + Private _subTotal As Decimal + + Private _taxAmt As Decimal + + Private _totalDue As Decimal + + Private _vendorID As Integer + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnEmployeeIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnEmployeeIDChanged() + End Sub + Private Partial Sub OnFreightChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnFreightChanged() + End Sub + Private Partial Sub OnModifiedDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnModifiedDateChanged() + End Sub + Private Partial Sub OnOrderDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnOrderDateChanged() + End Sub + Private Partial Sub OnPurchaseOrderIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnPurchaseOrderIDChanged() + End Sub + Private Partial Sub OnRevisionNumberChanging(ByVal value As Byte) + End Sub + Private Partial Sub OnRevisionNumberChanged() + End Sub + Private Partial Sub OnShipDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Private Partial Sub OnShipDateChanged() + End Sub + Private Partial Sub OnShipMethodIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnShipMethodIDChanged() + End Sub + Private Partial Sub OnStatusChanging(ByVal value As Byte) + End Sub + Private Partial Sub OnStatusChanged() + End Sub + Private Partial Sub OnSubTotalChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnSubTotalChanged() + End Sub + Private Partial Sub OnTaxAmtChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnTaxAmtChanged() + End Sub + Private Partial Sub OnTotalDueChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnTotalDueChanged() + End Sub + Private Partial Sub OnVendorIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnVendorIDChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Employee() As Employee + Get + If (Me._employee Is Nothing) Then + Me._employee = New EntityRef(Of Employee)(Me, "Employee", AddressOf Me.FilterEmployee) + End If + Return Me._employee.Entity + End Get + Set + Dim previous As Employee = Me.Employee + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Employee", value) + If (Not (previous) Is Nothing) Then + Me._employee.Entity = Nothing + previous.PurchaseOrders.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.EmployeeID = value.EmployeeID + Else + Me.EmployeeID = CType(Nothing, Integer) + End If + Me._employee.Entity = value + If (Not (value) Is Nothing) Then + value.PurchaseOrders.Add(Me) + End If + Me.RaisePropertyChanged("Employee") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'EmployeeID' value. + ''' + _ + Public Property EmployeeID() As Integer + Get + Return Me._employeeID + End Get + Set + If ((Me._employeeID = value) _ + = false) Then + Me.OnEmployeeIDChanging(value) + Me.RaiseDataMemberChanging("EmployeeID") + Me.ValidateProperty("EmployeeID", value) + Me._employeeID = value + Me.RaiseDataMemberChanged("EmployeeID") + Me.OnEmployeeIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Freight' value. + ''' + _ + Public Property Freight() As Decimal + Get + Return Me._freight + End Get + Set + If ((Me._freight = value) _ + = false) Then + Me.OnFreightChanging(value) + Me.RaiseDataMemberChanging("Freight") + Me.ValidateProperty("Freight", value) + Me._freight = value + Me.RaiseDataMemberChanged("Freight") + Me.OnFreightChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ModifiedDate' value. + ''' + _ + Public Property ModifiedDate() As DateTime + Get + Return Me._modifiedDate + End Get + Set + If ((Me._modifiedDate = value) _ + = false) Then + Me.OnModifiedDateChanging(value) + Me.RaiseDataMemberChanging("ModifiedDate") + Me.ValidateProperty("ModifiedDate", value) + Me._modifiedDate = value + Me.RaiseDataMemberChanged("ModifiedDate") + Me.OnModifiedDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderDate' value. + ''' + _ + Public Property OrderDate() As DateTime + Get + Return Me._orderDate + End Get + Set + If ((Me._orderDate = value) _ + = false) Then + Me.OnOrderDateChanging(value) + Me.RaiseDataMemberChanging("OrderDate") + Me.ValidateProperty("OrderDate", value) + Me._orderDate = value + Me.RaiseDataMemberChanged("OrderDate") + Me.OnOrderDateChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail) + Get + If (Me._purchaseOrderDetails Is Nothing) Then + Me._purchaseOrderDetails = New EntityCollection(Of PurchaseOrderDetail)(Me, "PurchaseOrderDetails", AddressOf Me.FilterPurchaseOrderDetails, AddressOf Me.AttachPurchaseOrderDetails, AddressOf Me.DetachPurchaseOrderDetails) + End If + Return Me._purchaseOrderDetails + End Get + End Property + + ''' + ''' Gets or sets the 'PurchaseOrderID' value. + ''' + _ + Public Property PurchaseOrderID() As Integer + Get + Return Me._purchaseOrderID + End Get + Set + If ((Me._purchaseOrderID = value) _ + = false) Then + Me.OnPurchaseOrderIDChanging(value) + Me.ValidateProperty("PurchaseOrderID", value) + Me._purchaseOrderID = value + Me.RaisePropertyChanged("PurchaseOrderID") + Me.OnPurchaseOrderIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RevisionNumber' value. + ''' + _ + Public Property RevisionNumber() As Byte + Get + Return Me._revisionNumber + End Get + Set + If ((Me._revisionNumber = value) _ + = false) Then + Me.OnRevisionNumberChanging(value) + Me.RaiseDataMemberChanging("RevisionNumber") + Me.ValidateProperty("RevisionNumber", value) + Me._revisionNumber = value + Me.RaiseDataMemberChanged("RevisionNumber") + Me.OnRevisionNumberChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipDate' value. + ''' + _ + Public Property ShipDate() As Nullable(Of DateTime) + Get + Return Me._shipDate + End Get + Set + If (Me._shipDate.Equals(value) = false) Then + Me.OnShipDateChanging(value) + Me.RaiseDataMemberChanging("ShipDate") + Me.ValidateProperty("ShipDate", value) + Me._shipDate = value + Me.RaiseDataMemberChanged("ShipDate") + Me.OnShipDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipMethodID' value. + ''' + _ + Public Property ShipMethodID() As Integer + Get + Return Me._shipMethodID + End Get + Set + If ((Me._shipMethodID = value) _ + = false) Then + Me.OnShipMethodIDChanging(value) + Me.RaiseDataMemberChanging("ShipMethodID") + Me.ValidateProperty("ShipMethodID", value) + Me._shipMethodID = value + Me.RaiseDataMemberChanged("ShipMethodID") + Me.OnShipMethodIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Status' value. + ''' + _ + Public Property Status() As Byte + Get + Return Me._status + End Get + Set + If ((Me._status = value) _ + = false) Then + Me.OnStatusChanging(value) + Me.RaiseDataMemberChanging("Status") + Me.ValidateProperty("Status", value) + Me._status = value + Me.RaiseDataMemberChanged("Status") + Me.OnStatusChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SubTotal' value. + ''' + _ + Public Property SubTotal() As Decimal + Get + Return Me._subTotal + End Get + Set + If ((Me._subTotal = value) _ + = false) Then + Me.OnSubTotalChanging(value) + Me.RaiseDataMemberChanging("SubTotal") + Me.ValidateProperty("SubTotal", value) + Me._subTotal = value + Me.RaiseDataMemberChanged("SubTotal") + Me.OnSubTotalChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TaxAmt' value. + ''' + _ + Public Property TaxAmt() As Decimal + Get + Return Me._taxAmt + End Get + Set + If ((Me._taxAmt = value) _ + = false) Then + Me.OnTaxAmtChanging(value) + Me.RaiseDataMemberChanging("TaxAmt") + Me.ValidateProperty("TaxAmt", value) + Me._taxAmt = value + Me.RaiseDataMemberChanged("TaxAmt") + Me.OnTaxAmtChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TotalDue' value. + ''' + _ + Public Property TotalDue() As Decimal + Get + Return Me._totalDue + End Get + Set + If ((Me._totalDue = value) _ + = false) Then + Me.OnTotalDueChanging(value) + Me.RaiseDataMemberChanging("TotalDue") + Me.ValidateProperty("TotalDue", value) + Me._totalDue = value + Me.RaiseDataMemberChanged("TotalDue") + Me.OnTotalDueChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'VendorID' value. + ''' + _ + Public Property VendorID() As Integer + Get + Return Me._vendorID + End Get + Set + If ((Me._vendorID = value) _ + = false) Then + Me.OnVendorIDChanging(value) + Me.RaiseDataMemberChanging("VendorID") + Me.ValidateProperty("VendorID", value) + Me._vendorID = value + Me.RaiseDataMemberChanged("VendorID") + Me.OnVendorIDChanged + End If + End Set + End Property + + Private Function FilterEmployee(ByVal entity As Employee) As Boolean + Return Object.Equals(entity.EmployeeID, Me.EmployeeID) + End Function + + Private Sub AttachPurchaseOrderDetails(ByVal entity As PurchaseOrderDetail) + entity.PurchaseOrder = Me + End Sub + + Private Sub DetachPurchaseOrderDetails(ByVal entity As PurchaseOrderDetail) + entity.PurchaseOrder = Nothing + End Sub + + Private Function FilterPurchaseOrderDetails(ByVal entity As PurchaseOrderDetail) As Boolean + Return Object.Equals(entity.PurchaseOrderID, Me.PurchaseOrderID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._purchaseOrderID + End Function + End Class + + ''' + ''' The 'PurchaseOrderDetail' entity class. + ''' + _ + Partial Public NotInheritable Class PurchaseOrderDetail + Inherits Entity + + Private _dueDate As DateTime + + Private _lineTotal As Decimal + + Private _modifiedDate As DateTime + + Private _orderQty As Short + + Private _product As EntityRef(Of Product) + + Private _productID As Integer + + Private _purchaseOrder As EntityRef(Of PurchaseOrder) + + Private _purchaseOrderDetailID As Integer + + Private _purchaseOrderID As Integer + + Private _receivedQty As Decimal + + Private _rejectedQty As Decimal + + Private _stockedQty As Decimal + + Private _unitPrice As Decimal + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnDueDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnDueDateChanged() + End Sub + Private Partial Sub OnLineTotalChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnLineTotalChanged() + End Sub + Private Partial Sub OnModifiedDateChanging(ByVal value As DateTime) + End Sub + Private Partial Sub OnModifiedDateChanged() + End Sub + Private Partial Sub OnOrderQtyChanging(ByVal value As Short) + End Sub + Private Partial Sub OnOrderQtyChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnPurchaseOrderDetailIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnPurchaseOrderDetailIDChanged() + End Sub + Private Partial Sub OnPurchaseOrderIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnPurchaseOrderIDChanged() + End Sub + Private Partial Sub OnReceivedQtyChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnReceivedQtyChanged() + End Sub + Private Partial Sub OnRejectedQtyChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnRejectedQtyChanged() + End Sub + Private Partial Sub OnStockedQtyChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnStockedQtyChanged() + End Sub + Private Partial Sub OnUnitPriceChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnUnitPriceChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'DueDate' value. + ''' + _ + Public Property DueDate() As DateTime + Get + Return Me._dueDate + End Get + Set + If ((Me._dueDate = value) _ + = false) Then + Me.OnDueDateChanging(value) + Me.RaiseDataMemberChanging("DueDate") + Me.ValidateProperty("DueDate", value) + Me._dueDate = value + Me.RaiseDataMemberChanged("DueDate") + Me.OnDueDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'LineTotal' value. + ''' + _ + Public Property LineTotal() As Decimal + Get + Return Me._lineTotal + End Get + Set + If ((Me._lineTotal = value) _ + = false) Then + Me.OnLineTotalChanging(value) + Me.RaiseDataMemberChanging("LineTotal") + Me.ValidateProperty("LineTotal", value) + Me._lineTotal = value + Me.RaiseDataMemberChanged("LineTotal") + Me.OnLineTotalChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ModifiedDate' value. + ''' + _ + Public Property ModifiedDate() As DateTime + Get + Return Me._modifiedDate + End Get + Set + If ((Me._modifiedDate = value) _ + = false) Then + Me.OnModifiedDateChanging(value) + Me.RaiseDataMemberChanging("ModifiedDate") + Me.ValidateProperty("ModifiedDate", value) + Me._modifiedDate = value + Me.RaiseDataMemberChanged("ModifiedDate") + Me.OnModifiedDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderQty' value. + ''' + _ + Public Property OrderQty() As Short + Get + Return Me._orderQty + End Get + Set + If ((Me._orderQty = value) _ + = false) Then + Me.OnOrderQtyChanging(value) + Me.RaiseDataMemberChanging("OrderQty") + Me.ValidateProperty("OrderQty", value) + Me._orderQty = value + Me.RaiseDataMemberChanged("OrderQty") + Me.OnOrderQtyChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Product() As Product + Get + If (Me._product Is Nothing) Then + Me._product = New EntityRef(Of Product)(Me, "Product", AddressOf Me.FilterProduct) + End If + Return Me._product.Entity + End Get + Set + Dim previous As Product = Me.Product + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Product", value) + If (Not (previous) Is Nothing) Then + Me._product.Entity = Nothing + previous.PurchaseOrderDetails.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.ProductID = value.ProductID + Else + Me.ProductID = CType(Nothing, Integer) + End If + Me._product.Entity = value + If (Not (value) Is Nothing) Then + value.PurchaseOrderDetails.Add(Me) + End If + Me.RaisePropertyChanged("Product") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.RaiseDataMemberChanging("ProductID") + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaiseDataMemberChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property PurchaseOrder() As PurchaseOrder + Get + If (Me._purchaseOrder Is Nothing) Then + Me._purchaseOrder = New EntityRef(Of PurchaseOrder)(Me, "PurchaseOrder", AddressOf Me.FilterPurchaseOrder) + End If + Return Me._purchaseOrder.Entity + End Get + Set + Dim previous As PurchaseOrder = Me.PurchaseOrder + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("PurchaseOrder", value) + If (Not (previous) Is Nothing) Then + Me._purchaseOrder.Entity = Nothing + previous.PurchaseOrderDetails.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.PurchaseOrderID = value.PurchaseOrderID + Else + Me.PurchaseOrderID = CType(Nothing, Integer) + End If + Me._purchaseOrder.Entity = value + If (Not (value) Is Nothing) Then + value.PurchaseOrderDetails.Add(Me) + End If + Me.RaisePropertyChanged("PurchaseOrder") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'PurchaseOrderDetailID' value. + ''' + _ + Public Property PurchaseOrderDetailID() As Integer + Get + Return Me._purchaseOrderDetailID + End Get + Set + If ((Me._purchaseOrderDetailID = value) _ + = false) Then + Me.OnPurchaseOrderDetailIDChanging(value) + Me.RaiseDataMemberChanging("PurchaseOrderDetailID") + Me.ValidateProperty("PurchaseOrderDetailID", value) + Me._purchaseOrderDetailID = value + Me.RaiseDataMemberChanged("PurchaseOrderDetailID") + Me.OnPurchaseOrderDetailIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'PurchaseOrderID' value. + ''' + _ + Public Property PurchaseOrderID() As Integer + Get + Return Me._purchaseOrderID + End Get + Set + If ((Me._purchaseOrderID = value) _ + = false) Then + Me.OnPurchaseOrderIDChanging(value) + Me.RaiseDataMemberChanging("PurchaseOrderID") + Me.ValidateProperty("PurchaseOrderID", value) + Me._purchaseOrderID = value + Me.RaiseDataMemberChanged("PurchaseOrderID") + Me.OnPurchaseOrderIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ReceivedQty' value. + ''' + _ + Public Property ReceivedQty() As Decimal + Get + Return Me._receivedQty + End Get + Set + If ((Me._receivedQty = value) _ + = false) Then + Me.OnReceivedQtyChanging(value) + Me.RaiseDataMemberChanging("ReceivedQty") + Me.ValidateProperty("ReceivedQty", value) + Me._receivedQty = value + Me.RaiseDataMemberChanged("ReceivedQty") + Me.OnReceivedQtyChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RejectedQty' value. + ''' + _ + Public Property RejectedQty() As Decimal + Get + Return Me._rejectedQty + End Get + Set + If ((Me._rejectedQty = value) _ + = false) Then + Me.OnRejectedQtyChanging(value) + Me.RaiseDataMemberChanging("RejectedQty") + Me.ValidateProperty("RejectedQty", value) + Me._rejectedQty = value + Me.RaiseDataMemberChanged("RejectedQty") + Me.OnRejectedQtyChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'StockedQty' value. + ''' + _ + Public Property StockedQty() As Decimal + Get + Return Me._stockedQty + End Get + Set + If ((Me._stockedQty = value) _ + = false) Then + Me.OnStockedQtyChanging(value) + Me.RaiseDataMemberChanging("StockedQty") + Me.ValidateProperty("StockedQty", value) + Me._stockedQty = value + Me.RaiseDataMemberChanged("StockedQty") + Me.OnStockedQtyChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitPrice' value. + ''' + _ + Public Property UnitPrice() As Decimal + Get + Return Me._unitPrice + End Get + Set + If ((Me._unitPrice = value) _ + = false) Then + Me.OnUnitPriceChanging(value) + Me.RaiseDataMemberChanging("UnitPrice") + Me.ValidateProperty("UnitPrice", value) + Me._unitPrice = value + Me.RaiseDataMemberChanged("UnitPrice") + Me.OnUnitPriceChanged + End If + End Set + End Property + + Private Function FilterProduct(ByVal entity As Product) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + Private Function FilterPurchaseOrder(ByVal entity As PurchaseOrder) As Boolean + Return Object.Equals(entity.PurchaseOrderID, Me.PurchaseOrderID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return EntityKey.Create(Me._purchaseOrderDetailID, Me._purchaseOrderID) + End Function + End Class +End Namespace + +Namespace TestDomainServices.DbCtx + + ''' + ''' The DomainContext corresponding to the 'Catalog' DomainService. + ''' + Partial Public NotInheritable Class Catalog + Inherits DomainContext + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + Me.New(New Uri("TestDomainServices-DbCtx-Catalog.svc", UriKind.Relative)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified service URI. + ''' + ''' The Catalog service URI. + Public Sub New(ByVal serviceUri As Uri) + Me.New(DomainContext.CreateDomainClient(GetType(ICatalogContract), serviceUri, false)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified . + ''' + ''' The DomainClient instance to use for this DomainContext. + Public Sub New(ByVal domainClient As DomainClient) + MyBase.New(domainClient) + Me.OnCreated + End Sub + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property EmployeeInfos() As EntitySet(Of EmployeeInfo) + Get + Return MyBase.EntityContainer.GetEntitySet(Of EmployeeInfo) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Employees() As EntitySet(Of Employee) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Employee) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Products() As EntitySet(Of Product) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Product) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property PurchaseOrders() As EntitySet(Of PurchaseOrder) + Get + Return MyBase.EntityContainer.GetEntitySet(Of PurchaseOrder) + End Get + End Property + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetEmployeeInfos' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetEmployeeInfosQuery() As EntityQuery(Of EmployeeInfo) + Me.ValidateMethod("GetEmployeeInfosQuery", Nothing) + Return MyBase.CreateQuery(Of EmployeeInfo)("GetEmployeeInfos", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetEmployees' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetEmployeesQuery() As EntityQuery(Of Employee) + Me.ValidateMethod("GetEmployeesQuery", Nothing) + Return MyBase.CreateQuery(Of Employee)("GetEmployees", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductsQuery() As EntityQuery(Of Product) + Me.ValidateMethod("GetProductsQuery", Nothing) + Return MyBase.CreateQuery(Of Product)("GetProducts", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductsByCategory' query. + ''' + ''' The value for the 'subCategoryID' parameter of the query. + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductsByCategoryQuery(ByVal subCategoryID As Integer) As EntityQuery(Of Product) + Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() + parameters.Add("subCategoryID", subCategoryID) + Me.ValidateMethod("GetProductsByCategoryQuery", parameters) + Return MyBase.CreateQuery(Of Product)("GetProductsByCategory", parameters, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductsWithCaching' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductsWithCachingQuery() As EntityQuery(Of Product) + Me.ValidateMethod("GetProductsWithCachingQuery", Nothing) + Return MyBase.CreateQuery(Of Product)("GetProductsWithCaching", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductsWithCustomTotalCount' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductsWithCustomTotalCountQuery() As EntityQuery(Of Product) + Me.ValidateMethod("GetProductsWithCustomTotalCountQuery", Nothing) + Return MyBase.CreateQuery(Of Product)("GetProductsWithCustomTotalCount", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetPurchaseOrders' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetPurchaseOrdersQuery() As EntityQuery(Of PurchaseOrder) + Me.ValidateMethod("GetPurchaseOrdersQuery", Nothing) + Return MyBase.CreateQuery(Of PurchaseOrder)("GetPurchaseOrders", Nothing, false, true) + End Function + + ''' + ''' Creates a new EntityContainer for this DomainContext's EntitySets. + ''' + ''' A new container instance. + Protected Overrides Function CreateEntityContainer() As EntityContainer + Return New CatalogEntityContainer() + End Function + + ''' + ''' Service contract for the 'Catalog' DomainService. + ''' + _ + Public Interface ICatalogContract + + ''' + ''' Asynchronously invokes the 'GetEmployeeInfos' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetEmployeeInfos(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetEmployeeInfos'. + ''' + ''' The IAsyncResult returned from 'BeginGetEmployeeInfos'. + ''' The 'QueryResult' returned from the 'GetEmployeeInfos' operation. + Function EndGetEmployeeInfos(ByVal result As IAsyncResult) As QueryResult(Of EmployeeInfo) + + ''' + ''' Asynchronously invokes the 'GetEmployees' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetEmployees(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetEmployees'. + ''' + ''' The IAsyncResult returned from 'BeginGetEmployees'. + ''' The 'QueryResult' returned from the 'GetEmployees' operation. + Function EndGetEmployees(ByVal result As IAsyncResult) As QueryResult(Of Employee) + + ''' + ''' Asynchronously invokes the 'GetProducts' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProducts(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProducts'. + ''' + ''' The IAsyncResult returned from 'BeginGetProducts'. + ''' The 'QueryResult' returned from the 'GetProducts' operation. + Function EndGetProducts(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetProductsByCategory' operation. + ''' + ''' The value for the 'subCategoryID' parameter of this action. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProductsByCategory(ByVal subCategoryID As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductsByCategory'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductsByCategory'. + ''' The 'QueryResult' returned from the 'GetProductsByCategory' operation. + Function EndGetProductsByCategory(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetProductsWithCaching' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProductsWithCaching(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductsWithCaching'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductsWithCaching'. + ''' The 'QueryResult' returned from the 'GetProductsWithCaching' operation. + Function EndGetProductsWithCaching(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetProductsWithCustomTotalCount' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProductsWithCustomTotalCount(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductsWithCustomTotalCount'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductsWithCustomTotalCount'. + ''' The 'QueryResult' returned from the 'GetProductsWithCustomTotalCount' operation. + Function EndGetProductsWithCustomTotalCount(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetPurchaseOrders' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetPurchaseOrders(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetPurchaseOrders'. + ''' + ''' The IAsyncResult returned from 'BeginGetPurchaseOrders'. + ''' The 'QueryResult' returned from the 'GetPurchaseOrders' operation. + Function EndGetPurchaseOrders(ByVal result As IAsyncResult) As QueryResult(Of PurchaseOrder) + + ''' + ''' Asynchronously invokes the 'SubmitChanges' operation. + ''' + ''' The change-set to submit. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginSubmitChanges(ByVal changeSet As IEnumerable(Of ChangeSetEntry), ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginSubmitChanges'. + ''' + ''' The IAsyncResult returned from 'BeginSubmitChanges'. + ''' The collection of change-set entry elements returned from 'SubmitChanges'. + Function EndSubmitChanges(ByVal result As IAsyncResult) As IEnumerable(Of ChangeSetEntry) + End Interface + + Friend NotInheritable Class CatalogEntityContainer + Inherits EntityContainer + + Public Sub New() + MyBase.New + Me.CreateEntitySet(Of Employee)(EntitySetOperations.None) + Me.CreateEntitySet(Of EmployeeInfo)(EntitySetOperations.None) + Me.CreateEntitySet(Of Product)(EntitySetOperations.All) + Me.CreateEntitySet(Of PurchaseOrder)(EntitySetOperations.All) + Me.CreateEntitySet(Of PurchaseOrderDetail)(EntitySetOperations.All) + End Sub + End Class + End Class +End Namespace From 231429c0c8cedd9e4037b3be89f4327181563588 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 23 Feb 2022 12:37:55 +0100 Subject: [PATCH 52/99] updates to adventureworks model --- .../AdventureWorks/AdventureworksContext.cs | 4 +- .../DbContextModel/AdventureWorks/Product.cs | 2 + .../Test/DbContextModel/efpt.config.json | 51 ------------------- ...Services.Common.DomainServices.Test.csproj | 7 +++ 4 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs index 1fd655885..2e2d943c6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs @@ -74,14 +74,14 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.PurchaseOrderDetailID); + entity.HasKey(e => new { e.PurchaseOrderID, e.PurchaseOrderDetailID }); entity.HasOne(e => e.PurchaseOrder) .WithMany(e => e.PurchaseOrderDetails) .HasForeignKey(e => e.PurchaseOrderID); entity.HasOne(e => e.Product) - .WithMany() + .WithMany(e => e.PurchaseOrderDetails) .HasForeignKey(e => e.ProductID); }); diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs index 5a388171b..4350d000a 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/Product.cs @@ -57,5 +57,7 @@ public partial class Product public DateTime ModifiedDate { get; set; } public ProductSubcategory ProductSubcategory { get; set; } + + public ICollection PurchaseOrderDetails { get; set; } = new HashSet(); } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json deleted file mode 100644 index f4edfdd69..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/efpt.config.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "CodeGenerationMode": 1, - "ContextClassName": "AdventureworksContext", - "ContextNamespace": null, - "DefaultDacpacSchema": null, - "FilterSchemas": false, - "IncludeConnectionString": true, - "ModelNamespace": null, - "OutputContextPath": "AdventureWorks", - "OutputPath": "AdventureWorks", - "ProjectRootNamespace": "EFCoreModels", - "Schemas": null, - "SelectedHandlebarsLanguage": 0, - "SelectedToBeGenerated": 0, - "Tables": [ - { - "Name": "[HumanResources].[Employee]", - "ObjectType": 0 - }, - { - "Name": "[Production].[Product]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[PurchaseOrderDetail]", - "ObjectType": 0 - }, - { - "Name": "[Purchasing].[PurchaseOrderHeader]", - "ObjectType": 0 - } - ], - "UiHint": "AdventureWorks (WebsiteFullTrust)", - "UseBoolPropertiesWithoutDefaultSql": false, - "UseDatabaseNames": true, - "UseDbContextSplitting": false, - "UseFluentApiOnly": false, - "UseHandleBars": false, - "UseHierarchyId": false, - "UseInflector": true, - "UseLegacyPluralizer": true, - "UseManyToManyEntity": false, - "UseNoConstructor": false, - "UseNoDefaultConstructor": false, - "UseNoNavigations": false, - "UseNoObjectFilter": false, - "UseNodaTime": false, - "UseNullableReferences": false, - "UseSchemaFolders": false, - "UseSpatial": false -} \ No newline at end of file diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index 855803890..3645bbbc1 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -32,6 +32,12 @@ + + Always + + + Always + PreserveNewest @@ -587,6 +593,7 @@ + From c1c3e4c827414f8b8aecdf9f5d00ee742e7993f2 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Mar 2022 12:11:30 +0100 Subject: [PATCH 53/99] update efcore namespace and merge DbDomainServices into one shared file --- .../Framework/DbDomainService.cs | 119 ++++----- .../Framework/DbContextEFCoreExtensions.cs | 2 +- ...ainServiceDescriptionProviderAttribute.cs} | 30 +-- .../Framework/DbDomainServiceEFCore.cs | 243 ------------------ .../Framework/EFCoreDescriptionProvider.cs | 15 +- .../Framework/EFCoreTypeDescriptionContext.cs | 13 +- .../Framework/EFCoreTypeDescriptor.cs | 36 ++- ...Services.Server.EntityFrameworkCore.csproj | 3 +- .../{QueryHelperEFCore.cs => QueryHelper.cs} | 7 +- .../Test/DomainServiceDescriptionTest.cs | 2 +- .../AdventureWorks/EFCore_Catalog.cs | 4 +- .../Northwind/EFCore_Northwind.cs | 4 +- 12 files changed, 106 insertions(+), 372 deletions(-) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{DbDomainServiceEFCoreDescriptionProviderAttribute.cs => DbDomainServiceDescriptionProviderAttribute.cs} (75%) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{QueryHelperEFCore.cs => QueryHelper.cs} (86%) diff --git a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs index 888791cf4..9f302f28d 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs @@ -1,19 +1,28 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; using System.ComponentModel; -using System.Data; + +#if EFCORE +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using DbEntityEntry = Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry; + +namespace OpenRiaServices.Server.EntityFrameworkCore +#else using System.Data.Entity; using System.Data.Entity.Core; using System.Data.Entity.Core.Objects; using System.Data.Entity.Infrastructure; -using System.Globalization; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; using OpenRiaServices.Server; +using EntityEntry = System.Data.Entity.Infrastructure.DbEntityEntry; + namespace OpenRiaServices.EntityFramework +#endif { /// /// Base class for DomainServices operating on LINQ To Entities DbContext based data models @@ -24,7 +33,6 @@ public abstract class DbDomainService : DomainService where TContext : DbContext, new() { private TContext _dbContext; - private ObjectContext _refreshContext; /// /// Protected constructor for the abstract class. @@ -43,6 +51,12 @@ public override void Initialize(DomainServiceContext context) { base.Initialize(context); +#if EFCORE + // Turn off AutoDetectChanges. + this.DbContext.ChangeTracker.AutoDetectChangesEnabled = false; + + this.DbContext.ChangeTracker.LazyLoadingEnabled = false; +#else ObjectContext objectContext = ((IObjectContextAdapter)this.DbContext).ObjectContext; // We turn this off, since our deserializer isn't going to create // the EF proxy types anyways. Proxies only really work if the entities @@ -56,6 +70,7 @@ public override void Initialize(DomainServiceContext context) this.DbContext.Configuration.AutoDetectChangesEnabled = false; this.DbContext.Configuration.LazyLoadingEnabled = false; +#endif } /// @@ -67,22 +82,6 @@ protected virtual TContext CreateDbContext() return new TContext(); } - /// - /// Gets the used for retrieving store values - /// - private ObjectContext RefreshContext - { - get - { - if (this._refreshContext == null) - { - DbContext dbContext = this.CreateDbContext(); - this._refreshContext = (dbContext as IObjectContextAdapter).ObjectContext; - } - return this._refreshContext; - } - } - /// /// Gets the /// @@ -121,8 +120,11 @@ protected override ValueTask CountAsync(IQueryable query, Cancellatio /// A new enumerable with the results of the enumerated enumerable. protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) { - // EF will throw if provider is not a IDbAsyncEnumerable +#if EFCORE + if (enumerable is IAsyncEnumerable asyncEnumerable) +#else if (enumerable is IDbAsyncEnumerable asyncEnumerable) +#endif { return QueryHelper.EnumerateAsyncEnumerable(asyncEnumerable, estimatedResultCount, cancellationToken); } @@ -170,10 +172,6 @@ protected override void Dispose(bool disposing) { this.DbContext.Dispose(); } - if (this._refreshContext != null) - { - this._refreshContext.Dispose(); - } } base.Dispose(disposing); } @@ -206,7 +204,7 @@ private async Task InvokeSaveChangesAsync(bool retryOnConflict, Cancellati operationConflictMap.Add(conflict, entry); } - this.SetChangeSetConflicts(operationConflictMap); + await this.SetChangeSetConflictsAsync(operationConflictMap, cancellationToken); // Call out to any user resolve code and resubmit if all conflicts // were resolved @@ -243,70 +241,55 @@ private async Task InvokeSaveChangesAsync(bool retryOnConflict, Cancellati /// Updates each entry in the ChangeSet with its corresponding conflict info. /// /// Map of conflicts to their corresponding operations entries. - private void SetChangeSetConflicts(Dictionary operationConflictMap) + /// + private async Task SetChangeSetConflictsAsync(Dictionary operationConflictMap, CancellationToken cancellationToken) { - object storeValue; - EntityKey refreshEntityKey; - - ObjectContext objectContext = ((IObjectContextAdapter)this.DbContext).ObjectContext; - ObjectStateManager objectStateManager = objectContext.ObjectStateManager; - if (objectStateManager == null) - { - throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, DbResource.ObjectStateManagerNotFoundException, this.DbContext.GetType().Name)); - } - foreach (var conflictEntry in operationConflictMap) { - DbEntityEntry entityEntry = conflictEntry.Key; - ObjectStateEntry stateEntry = objectStateManager.GetObjectStateEntry(entityEntry.Entity); + DbEntityEntry stateEntry = conflictEntry.Key; if (stateEntry.State == EntityState.Unchanged) { continue; } - // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. ChangeSetEntry operationInConflict = conflictEntry.Value; - refreshEntityKey = this.RefreshContext.CreateEntityKey(stateEntry.EntitySet.Name, stateEntry.Entity); - this.RefreshContext.TryGetObjectByKey(refreshEntityKey, out storeValue); - operationInConflict.StoreEntity = storeValue; - // StoreEntity will be null if the entity has been deleted in the store (i.e. Delete/Delete conflict) - bool isDeleted = (operationInConflict.StoreEntity == null); - if (isDeleted) + // Determine which members are in conflict by comparing original values to the current DB values + var dbValues = await stateEntry.GetDatabaseValuesAsync(cancellationToken); + + // dbValues will be null if the entity has been deleted in the store (i.e. Delete/Delete conflict) + if (dbValues == null) { operationInConflict.IsDeleteConflict = true; } else { + operationInConflict.StoreEntity = dbValues.ToObject(); + // Determine which members are in conflict by comparing original values to the current DB values - PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); List membersInConflict = new List(); - object originalValue; - PropertyDescriptor pd; - for (int i = 0; i < stateEntry.OriginalValues.FieldCount; i++) + foreach (var property in PropertiesOf(stateEntry.OriginalValues)) { - originalValue = stateEntry.OriginalValues.GetValue(i); - if (originalValue is DBNull) + if (!object.Equals(stateEntry.OriginalValues[property], dbValues[property])) { - originalValue = null; - } + string propertyName = NameOf(property); - string propertyName = stateEntry.OriginalValues.GetName(i); - pd = propDescriptors[propertyName]; - if (pd == null) - { - // This might happen in the case of a private model - // member that isn't mapped - continue; - } - - if (!object.Equals(originalValue, pd.GetValue(operationInConflict.StoreEntity))) - { - membersInConflict.Add(pd.Name); + // TÒDO: Determine if Excluded properties should be skipped + PropertyDescriptorCollection propDescriptors = TypeDescriptor.GetProperties(operationInConflict.Entity.GetType()); + if (propDescriptors[propertyName] is not null) + membersInConflict.Add(propertyName); } } operationInConflict.ConflictMembers = membersInConflict; + +#if EFCORE + static IReadOnlyList PropertiesOf(PropertyValues pv) => pv.Properties; + static string NameOf(Microsoft.EntityFrameworkCore.Metadata.IProperty p) => p.Name; +#else + static IEnumerable PropertiesOf(DbPropertyValues pv) => pv.PropertyNames; + static string NameOf(string s) => s; +#endif } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs index 43c37a8c7..01857c731 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbContextEFCoreExtensions.cs @@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.ChangeTracking; using OpenRiaServices.Server; -namespace OpenRiaServices.EntityFrameworkCore +namespace OpenRiaServices.Server.EntityFrameworkCore { /// /// DbContext extension methods for DbDomainService authors. diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs similarity index 75% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs index 0b917ecbb..e7254336a 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCoreDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs @@ -2,17 +2,15 @@ using System.ComponentModel; using Microsoft.EntityFrameworkCore; using System.Globalization; -using OpenRiaServices.Server; -using OpenRiaServices.Server.EntityFrameworkCore; -namespace OpenRiaServices.EntityFrameworkCore +namespace OpenRiaServices.Server.EntityFrameworkCore { /// - /// Attribute applied to a that exposes LINQ to Entities mapped + /// Attribute applied to a that exposes LINQ to Entities mapped /// Types. /// [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] - public sealed class DbDomainServiceEFCoreDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute + public sealed class DbDomainServiceDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute { private Type _dbContextType; @@ -21,7 +19,7 @@ public sealed class DbDomainServiceEFCoreDescriptionProviderAttribute : DomainSe /// DbContext will be inferred from the the /// attribute is applied to. /// - public DbDomainServiceEFCoreDescriptionProviderAttribute() + public DbDomainServiceDescriptionProviderAttribute() : base(typeof(EFCoreDescriptionProvider)) { } @@ -31,10 +29,10 @@ public DbDomainServiceEFCoreDescriptionProviderAttribute() /// DbContext Type. /// /// The LINQ To Entities ObjectContext Type. - public DbDomainServiceEFCoreDescriptionProviderAttribute(Type dbContextType) + public DbDomainServiceDescriptionProviderAttribute(Type dbContextType) : base(typeof(EFCoreDescriptionProvider)) { - this._dbContextType = dbContextType; + _dbContextType = dbContextType; } /// @@ -44,7 +42,7 @@ public Type DbContextType { get { - return this._dbContextType; + return _dbContextType; } } @@ -61,19 +59,19 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi throw new ArgumentNullException(nameof(domainServiceType)); } - if (this._dbContextType == null) + if (_dbContextType == null) { - this._dbContextType = GetContextType(domainServiceType); + _dbContextType = GetContextType(domainServiceType); } - if (!typeof(DbContext).IsAssignableFrom(this._dbContextType)) + if (!typeof(DbContext).IsAssignableFrom(_dbContextType)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, DbResource.InvalidDbDomainServiceDescriptionProviderSpecification, - this._dbContextType)); + _dbContextType)); } - return new EFCoreDescriptionProvider(domainServiceType, this._dbContextType, parent); + return new EFCoreDescriptionProvider(domainServiceType, _dbContextType, parent); } /// @@ -84,13 +82,13 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi private static Type GetContextType(Type domainServiceType) { Type efDomainServiceType = domainServiceType.BaseType; - while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DbDomainServiceEFCore<>)) + while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DbDomainService<>)) { if (efDomainServiceType == typeof(object)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, ResourceEFCore.InvalidMetadataProviderSpecification, - typeof(DbDomainServiceEFCoreDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DbDomainServiceEFCore<>).Name)); + typeof(DbDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DbDomainService<>).Name)); } efDomainServiceType = efDomainServiceType.BaseType; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs deleted file mode 100644 index 25dd0970f..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceEFCore.cs +++ /dev/null @@ -1,243 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using Microsoft.EntityFrameworkCore; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using OpenRiaServices.Server; -using Microsoft.EntityFrameworkCore.ChangeTracking; - -namespace OpenRiaServices.EntityFrameworkCore -{ - /// - /// Base class for DomainServices operating on LINQ To Entities DbContext based data models - /// - /// The DbContext type - [DbDomainServiceEFCoreDescriptionProvider] - public abstract class DbDomainServiceEFCore : DomainService - where TContext : DbContext, new() - { - private TContext _dbContext; - - /// - /// Protected constructor for the abstract class. - /// - protected DbDomainServiceEFCore() - { - } - - /// - /// Initializes the . must be called - /// prior to invoking any operations on the instance. - /// - /// The for this - /// instance. Overrides must call the base method. - public override void Initialize(DomainServiceContext context) - { - base.Initialize(context); - } - - /// - /// Returns the DbContext object. - /// - /// The created DbContext object. - protected virtual TContext CreateDbContext() - { - return new TContext(); - } - - /// - /// Gets the - /// - protected TContext DbContext - { - get - { - if (this._dbContext == null) - { - this._dbContext = this.CreateDbContext(); - } - return this._dbContext; - } - } - - /// - /// Gets the number of rows in an . - /// - /// The element Type of the query. - /// The query for which the count should be returned. - /// which may be used by hosting layer to request cancellation - /// The total number of rows. - protected override ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) - { - return QueryHelperEFCore.CountAsync(query, cancellationToken); - } - - /// - /// Enumerates the specified enumerable to guarantee eager execution. - /// If possible code similar to ToListAsync is used, but with optimizations to start with a larger initial capacity - /// - /// The element type of the enumerable. - /// The enumerable to enumerate. - /// The estimated number of items the enumerable will yield. - /// which may be used by hosting layer to request cancellation - /// A new enumerable with the results of the enumerated enumerable. - protected override ValueTask> EnumerateAsync(IEnumerable enumerable, int estimatedResultCount, CancellationToken cancellationToken) - { - // TODO: Determine if we get into if statement - if (enumerable is IAsyncEnumerable asyncEnumerable) - { - return QueryHelperEFCore.EnumerateAsyncEnumerable(asyncEnumerable, estimatedResultCount, cancellationToken); - } - else - { - return base.EnumerateAsync(enumerable, estimatedResultCount, cancellationToken); - } - } - - - /// - /// This method is called to finalize changes after all the operations in the specified changeset - /// have been invoked. All changes are committed to the DbContext, and any resulting optimistic - /// concurrency errors are processed. - /// - /// True if the was persisted successfully, false otherwise. - protected override ValueTask PersistChangeSetAsync(CancellationToken cancellationToken) - { - return new ValueTask(this.InvokeSaveChangesAsync(true, cancellationToken)); - } - - /// - /// This method is called to finalize changes after all the operations in the specified changeset - /// have been invoked. All changes are committed to the DbContext. - /// If the submit fails due to concurrency conflicts will be called. - /// If returns true a single resubmit will be attempted. - /// - /// - /// The list of concurrency conflicts that occurred - /// Returns true if the was persisted successfully, false otherwise. - protected virtual bool ResolveConflicts(IEnumerable conflicts) - { - return false; - } - - /// - /// See . - /// - /// A indicating whether or not the instance is currently disposing. - protected override void Dispose(bool disposing) - { - if (disposing) - { - if (this.DbContext != null) - { - this.DbContext.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// Called by PersistChangeSet method to save the changes to the database. - /// - /// Flag indicating whether to retry after resolving conflicts. - /// - /// true if saved successfully and false otherwise. - private async Task InvokeSaveChangesAsync(bool retryOnConflict, CancellationToken cancellationToken) - { - try - { - await this.DbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false); - } - catch (DbUpdateConcurrencyException ex) - { - // Map the operations that could have caused a conflict to an entity. - Dictionary operationConflictMap = new Dictionary(); - foreach (EntityEntry conflict in ex.Entries) - { - ChangeSetEntry entry = this.ChangeSet.ChangeSetEntries.SingleOrDefault(p => object.ReferenceEquals(p.Entity, conflict.Entity)); - if (entry == null) - { - // If we're unable to find the object in our changeset, propagate - // the original exception - throw; - } - operationConflictMap.Add(conflict, entry); - } - - this.SetChangeSetConflicts(operationConflictMap); - - // Call out to any user resolve code and resubmit if all conflicts - // were resolved - if (retryOnConflict && this.ResolveConflicts(ex.Entries)) - { - // clear the conflics from the entries - foreach (ChangeSetEntry entry in this.ChangeSet.ChangeSetEntries) - { - entry.StoreEntity = null; - entry.ConflictMembers = null; - entry.IsDeleteConflict = false; - } - - // If all conflicts were resolved attempt a resubmit - return await this.InvokeSaveChangesAsync(/* retryOnConflict */ false, cancellationToken).ConfigureAwait(false); - } - - // if the conflict wasn't resolved, call the error handler - this.OnError(new DomainServiceErrorInfo(ex)); - - // if there was a conflict but no conflict information was - // extracted to the individual entries, we need to ensure the - // error makes it back to the client - if (!this.ChangeSet.HasError) - { - throw; - } - return false; - } - return true; - } - - /// - /// Updates each entry in the ChangeSet with its corresponding conflict info. - /// - /// Map of conflicts to their corresponding operations entries. - private void SetChangeSetConflicts(Dictionary operationConflictMap) - { - foreach (var conflictEntry in operationConflictMap) - { - EntityEntry stateEntry = conflictEntry.Key; - - if (stateEntry.State == EntityState.Unchanged) - { - continue; - } - - // Note: we cannot call Refresh StoreWins since this will overwrite Current entity and remove the optimistic concurrency ex. - ChangeSetEntry operationInConflict = conflictEntry.Value; - - // Determine which members are in conflict by comparing original values to the current DB values - // // TODO: Populate store entity conflictEntry.Value.StoreEntity - // TODO: make async loading of tate - var dbValues = stateEntry.GetDatabaseValues(); - operationInConflict.StoreEntity = dbValues?.ToObject(); - operationInConflict.IsDeleteConflict = dbValues == null; - - if (dbValues != null) - { - List membersInConflict = new List(); - foreach (var property in stateEntry.OriginalValues.Properties) - { - if (!object.Equals(stateEntry.OriginalValues[property.Name], dbValues[property.Name])) - { - membersInConflict.Add(property.Name); - } - } - operationInConflict.ConflictMembers = membersInConflict; - } - } - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs index 2b22c4616..b0ee8d349 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs @@ -2,9 +2,8 @@ using System.Collections.Generic; using System.ComponentModel; using Microsoft.EntityFrameworkCore.Metadata; -using OpenRiaServices.Server; -namespace OpenRiaServices.EntityFrameworkCore +namespace OpenRiaServices.Server.EntityFrameworkCore { internal class EFCoreDescriptionProvider : DomainServiceDescriptionProvider { @@ -17,11 +16,11 @@ public EFCoreDescriptionProvider(Type domainServiceType, Type contextType, Domai { lock (tdpContextMap) { - if (!tdpContextMap.TryGetValue(contextType, out this._typeDescriptionContext)) + if (!tdpContextMap.TryGetValue(contextType, out _typeDescriptionContext)) { // create and cache a context for this provider type - this._typeDescriptionContext = new EFCoreTypeDescriptionContext(contextType); - tdpContextMap.Add(contextType, this._typeDescriptionContext); + _typeDescriptionContext = new EFCoreTypeDescriptionContext(contextType); + tdpContextMap.Add(contextType, _typeDescriptionContext); } } } @@ -37,7 +36,7 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom // No need to deal with concurrency... Worst case scenario we have multiple // instances of this thing. ICustomTypeDescriptor td = null; - if (!this._descriptors.TryGetValue(objectType, out td)) + if (!_descriptors.TryGetValue(objectType, out td)) { // call into base so the TDs are chained parent = base.GetTypeDescriptor(objectType, parent); @@ -48,14 +47,14 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom { // TODO: ... // only add an LTE TypeDescriptor if the type is an EF Entity or ComplexType - td = new EFCoreTypeDescriptor(this._typeDescriptionContext, entityType, parent); + td = new EFCoreTypeDescriptor(_typeDescriptionContext, entityType, parent); } else { td = parent; } - this._descriptors[objectType] = td; + _descriptors[objectType] = td; } return td; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs index ac9b94f66..96fd4881c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs @@ -1,21 +1,20 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations;using System.Globalization; +using System.ComponentModel.DataAnnotations; +using System.Globalization; using System.Linq; -using OpenRiaServices.Server; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore; -using OpenRiaServices.Server.EntityFrameworkCore; using System.Diagnostics; -namespace OpenRiaServices.EntityFrameworkCore +namespace OpenRiaServices.Server.EntityFrameworkCore { /// /// Metadata context for LINQ To Entities domain services /// internal class EFCoreTypeDescriptionContext : TypeDescriptionContextBase { - // private readonly Dictionary _associationMap = new Dictionary(); + // private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; private IModel _model; @@ -29,7 +28,7 @@ public EFCoreTypeDescriptionContext(Type contextType) { throw new ArgumentNullException(nameof(contextType)); } - this._contextType = contextType; + _contextType = contextType; } public IModel Model @@ -116,7 +115,7 @@ internal AssociationAttribute CreateAssociationAttribute(INavigation navigationP otherKey = FormatMemberList(fk.Properties); } - AssociationAttribute assocAttrib = new AssociationAttribute(fk.GetConstraintName(), thisKey, otherKey); + var assocAttrib = new AssociationAttribute(fk.GetConstraintName(), thisKey, otherKey); assocAttrib.IsForeignKey = navigationProperty.IsDependentToPrincipal(); // TODO: isForeignKey; return assocAttrib; } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs index 631475dd4..2a39e2bac 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs @@ -5,10 +5,9 @@ using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; using System.Linq; -using OpenRiaServices.Server; using Microsoft.EntityFrameworkCore.Metadata; -namespace OpenRiaServices.EntityFrameworkCore +namespace OpenRiaServices.Server.EntityFrameworkCore { /// /// CustomTypeDescriptor for LINQ To Entities @@ -24,13 +23,13 @@ internal class EFCoreTypeDescriptor : TypeDescriptorBase public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, IEntityType entityType, ICustomTypeDescriptor parent) : base(parent) { - this._typeDescriptionContext = typeDescriptionContext; - this._entityType = entityType; + _typeDescriptionContext = typeDescriptionContext; + _entityType = entityType; var timestampMembers = entityType.GetProperties().Where(p => IsConcurrencyTimestamp(p)).ToArray(); if (timestampMembers.Length == 1) { - this._timestampProperty = timestampMembers[0]; + _timestampProperty = timestampMembers[0]; } // if (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) @@ -43,13 +42,13 @@ public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, .ToDictionary(x => x.Name); //this._foreignKeyMembers - foreach(var key in entityType.GetKeys()) + foreach (var key in entityType.GetKeys()) { foreach (var keyMember in key.Properties) { if (_foreignKeyMembers.ContainsKey(keyMember.Name)) { - this._keyIsEditable = true; + _keyIsEditable = true; break; } } @@ -79,7 +78,7 @@ public EFCoreTypeDescriptionContext TypeDescriptionContext { get { - return this._typeDescriptionContext; + return _typeDescriptionContext; } } @@ -91,13 +90,12 @@ public EFCoreTypeDescriptionContext TypeDescriptionContext /// A collection of attributes inferred from the metadata in the given descriptor. protected override IEnumerable GetMemberAttributes(PropertyDescriptor pd) { - List attributes = new List(); + var attributes = new List(); EditableAttribute editableAttribute = null; bool inferRoundtripOriginalAttribute = false; - bool hasKeyAttribute = (pd.Attributes[typeof(KeyAttribute)] != null); - bool isEntity = true; // this.EdmType.BuiltInTypeKind == BuiltInTypeKind.EntityType; + bool hasKeyAttribute = pd.Attributes[typeof(KeyAttribute)] != null; var property = _entityType.FindProperty(pd.Name); if (property != null) @@ -114,7 +112,7 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor inferRoundtripOriginalAttribute = true; // key members that aren't also FK members are non-editable (but allow an initial value) - if (!this._keyIsEditable) + if (!_keyIsEditable) { editableAttribute = new EditableAttribute(false) { AllowInitialValue = true }; } @@ -171,8 +169,8 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor } } - bool hasTimestampAttribute = (pd.Attributes[typeof(TimestampAttribute)] != null); - if (this._timestampProperty == property && !hasTimestampAttribute) + bool hasTimestampAttribute = pd.Attributes[typeof(TimestampAttribute)] != null; + if (_timestampProperty == property && !hasTimestampAttribute) { attributes.Add(new TimestampAttribute()); hasTimestampAttribute = true; @@ -193,8 +191,8 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor // Add RTO to this member if required. If this type has a timestamp // member that member should be the ONLY member we apply RTO to. // Dont apply RTO if it is an association member. - bool isForeignKeyMember = this._foreignKeyMembers != null && this._foreignKeyMembers.ContainsKey(property.Name); - if ((this._timestampProperty == null || this._timestampProperty == property) && + bool isForeignKeyMember = _foreignKeyMembers != null && _foreignKeyMembers.ContainsKey(property.Name); + if ((_timestampProperty == null || _timestampProperty == property) && (inferRoundtripOriginalAttribute || isForeignKeyMember) && pd.Attributes[typeof(AssociationAttribute)] == null) { @@ -214,13 +212,13 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor // Add AssociationAttribute if required for the specified property if (_entityType.FindNavigation(pd.Name) is INavigation navigation) { - bool isManyToMany = navigation.IsCollection() && (navigation.FindInverse()?.IsCollection() == true); + bool isManyToMany = navigation.IsCollection() && navigation.FindInverse()?.IsCollection() == true; if (!isManyToMany) { - AssociationAttribute assocAttrib = (AssociationAttribute)pd.Attributes[typeof(System.ComponentModel.DataAnnotations.AssociationAttribute)]; + var assocAttrib = (AssociationAttribute)pd.Attributes[typeof(AssociationAttribute)]; if (assocAttrib == null) { - assocAttrib = this.TypeDescriptionContext.CreateAssociationAttribute(navigation); + assocAttrib = TypeDescriptionContext.CreateAssociationAttribute(navigation); attributes.Add(assocAttrib); } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index abf533a00..4ad0cc6e7 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -1,7 +1,7 @@  netstandard2.0 - $(DefineConstants);SERVERFX;DBCONTEXT; + $(DefineConstants);SERVERFX;EFCORE True true ..\..\..\NuGet\bin\ @@ -12,6 +12,7 @@ + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs similarity index 86% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs index 14dee4d05..3342fb670 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelperEFCore.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/QueryHelper.cs @@ -4,11 +4,10 @@ using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.Query.Internal; using System.Collections.Generic; -using System; -namespace OpenRiaServices.EntityFrameworkCore +namespace OpenRiaServices.Server.EntityFrameworkCore { - static class QueryHelperEFCore + static class QueryHelper { public static ValueTask CountAsync(IQueryable query, CancellationToken cancellationToken) { @@ -21,7 +20,7 @@ public static ValueTask CountAsync(IQueryable query, CancellationToke internal static async ValueTask> EnumerateAsyncEnumerable(IAsyncEnumerable asyncEnumerable, int estimatedResultCount, CancellationToken cancellationToken) { - List result = new List(capacity: estimatedResultCount); + var result = new List(capacity: estimatedResultCount); await foreach (var item in asyncEnumerable.ConfigureAwait(false).WithCancellation(cancellationToken)) { result.Add(item); diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 2283a0fee..846913d37 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -31,7 +31,7 @@ namespace OpenRiaServices.Server.Test using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; using Microsoft.EntityFrameworkCore.Metadata; - using OpenRiaServices.EntityFrameworkCore; + using OpenRiaServices.Server.EntityFrameworkCore; using MetaType = SystemWebDomainServices::OpenRiaServices.Server.MetaType; // TODO Begin here to make it work with the new diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs index 0749a5419..4abae8197 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/AdventureWorks/EFCore_Catalog.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Runtime.Serialization; -using OpenRiaServices.EntityFrameworkCore; +using OpenRiaServices.Server.EntityFrameworkCore; using OpenRiaServices.Server; using EFCoreModels.AdventureWorks; using Microsoft.EntityFrameworkCore; @@ -10,7 +10,7 @@ namespace TestDomainServices.EFCore { [EnableClientAccess] - public partial class Catalog : DbDomainServiceEFCore + public partial class Catalog : DbDomainService { protected override AdventureworksContext CreateDbContext() { diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index 628b4b199..adc10b30e 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -6,7 +6,7 @@ using OpenRiaServices.Server; using TestDomainServices.Testing; using System.Configuration; -using OpenRiaServices.EntityFrameworkCore; +using OpenRiaServices.Server.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using EFCoreModels.Northwind; @@ -14,7 +14,7 @@ namespace TestDomainServices.EFCore { [EnableClientAccess] - public class Northwind : DbDomainServiceEFCore + public class Northwind : DbDomainService { #region Product methods public Product GetProductById(int id) From 5bc2f1149aab3e5fb4ae6b89ec88661d9876ea26 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Tue, 15 Mar 2022 12:25:29 +0100 Subject: [PATCH 54/99] fix test when autotedectchanges is false --- .../Northwind/EFCore_Northwind.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index adc10b30e..678d1e8fd 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -443,8 +443,8 @@ public void UpdateRegion(Region region) EntityEntry tEntityEntry = this.DbContext.Entry(territory); CollectionEntry employeesCollection = tEntityEntry.Collection(nameof(territory.Employees)); employeesCollection.Load(); - territory.Employees.Clear(); - + DbContext.EmployeeTerritories.RemoveRange(territory.Employees); + this.DbContext.Territories.Remove(territory); } } @@ -467,7 +467,7 @@ public void DeleteRegion(Region region) EntityEntry tEntityEntry = this.DbContext.Entry(territory); CollectionEntry employeesCollection = tEntityEntry.Collection(nameof(territory.Employees)); employeesCollection.Load(); - territory.Employees.Clear(); + DbContext.EmployeeTerritories.RemoveRange(territory.Employees); this.DbContext.Territories.Remove(territory); } From e397ec756e5a4183852d150ddab4968c945345c4 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 16 Mar 2022 16:01:17 +0100 Subject: [PATCH 55/99] Add codegen test for EF Core. --- .../Test/CodeGenDomainServices.cs | 9 + .../Default/EF/Northwind_EFCore.g.cs | 2934 +++++++++++++++++ .../Default/EF/Northwind_EFCore.g.vb | 2710 +++++++++++++++ ...Services.Common.DomainServices.Test.csproj | 9 + 4 files changed, 5662 insertions(+) create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index 05e8989ae..85a95bd80 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -545,6 +545,15 @@ public void TestNorthwindEFClientProxies() TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\EF", "CG_NWEF", "Northwind_EF.g", typeof(TestDomainServices.EF.Northwind), Array.Empty(), false)); } + [DeploymentItem(@"Baselines\Default\EF", "CG_NWEF")] + [DeploymentItem(@"ProjectPath.txt", "CG_NWEF")] + [TestMethod] + public void TestNorthwindEFCoreClientProxies() + { + // Default + TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\EF", "CG_NWEF", "Northwind_EFCore.g", typeof(TestDomainServices.EFCore.Northwind), Array.Empty(), false)); + } + [DeploymentItem(@"Baselines\Default\EF", "CG_CATEF")] [DeploymentItem(@"ProjectPath.txt", "CG_CATEF")] [TestMethod] diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs new file mode 100644 index 000000000..4233a963d --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs @@ -0,0 +1,2934 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace EFCoreModels.Northwind +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.ComponentModel.DataAnnotations; + using System.Linq; + using System.Runtime.Serialization; + using System.Threading.Tasks; + using OpenRiaServices; + using OpenRiaServices.Client; + using OpenRiaServices.Client.Authentication; + + + /// + /// The 'Category' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Category : Entity + { + + private int _categoryID; + + private string _categoryName; + + private string _description; + + private byte[] _picture; + + private EntityCollection _products; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryIDChanging(int value); + partial void OnCategoryIDChanged(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnDescriptionChanging(string value); + partial void OnDescriptionChanged(); + partial void OnPictureChanging(byte[] value); + partial void OnPictureChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Category() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'CategoryID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int CategoryID + { + get + { + return this._categoryID; + } + set + { + if ((this._categoryID != value)) + { + this.OnCategoryIDChanging(value); + this.ValidateProperty("CategoryID", value); + this._categoryID = value; + this.RaisePropertyChanged("CategoryID"); + this.OnCategoryIDChanged(); + } + } + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [DataMember()] + [Required()] + [StringLength(15)] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.RaiseDataMemberChanging("CategoryName"); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaiseDataMemberChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Description' value. + /// + [DataMember()] + public string Description + { + get + { + return this._description; + } + set + { + if ((this._description != value)) + { + this.OnDescriptionChanging(value); + this.RaiseDataMemberChanging("Description"); + this.ValidateProperty("Description", value); + this._description = value; + this.RaiseDataMemberChanged("Description"); + this.OnDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'Picture' value. + /// + [DataMember()] + public byte[] Picture + { + get + { + return this._picture; + } + set + { + if ((this._picture != value)) + { + this.OnPictureChanging(value); + this.RaiseDataMemberChanging("Picture"); + this.ValidateProperty("Picture", value); + this._picture = value; + this.RaiseDataMemberChanged("Picture"); + this.OnPictureChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("FK_Products_Categories", "CategoryID", "CategoryID")] + public EntityCollection Products + { + get + { + if ((this._products == null)) + { + this._products = new EntityCollection(this, "Products", this.FilterProducts, this.AttachProducts, this.DetachProducts); + } + return this._products; + } + } + + private void AttachProducts(Product entity) + { + entity.Category = this; + } + + private void DetachProducts(Product entity) + { + entity.Category = null; + } + + private bool FilterProducts(Product entity) + { + return (entity.CategoryID == this.CategoryID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._categoryID; + } + } + + /// + /// The 'Customer' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Customer : Entity + { + + private string _address; + + private string _city; + + private string _companyName; + + private string _contactName; + + private string _contactTitle; + + private string _country; + + private string _customerID; + + private string _fax; + + private EntityCollection _orders; + + private string _phone; + + private string _postalCode; + + private string _region; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnAddressChanging(string value); + partial void OnAddressChanged(); + partial void OnCityChanging(string value); + partial void OnCityChanged(); + partial void OnCompanyNameChanging(string value); + partial void OnCompanyNameChanged(); + partial void OnContactNameChanging(string value); + partial void OnContactNameChanged(); + partial void OnContactTitleChanging(string value); + partial void OnContactTitleChanged(); + partial void OnCountryChanging(string value); + partial void OnCountryChanged(); + partial void OnCustomerIDChanging(string value); + partial void OnCustomerIDChanged(); + partial void OnFaxChanging(string value); + partial void OnFaxChanged(); + partial void OnPhoneChanging(string value); + partial void OnPhoneChanged(); + partial void OnPostalCodeChanging(string value); + partial void OnPostalCodeChanged(); + partial void OnRegionChanging(string value); + partial void OnRegionChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Customer() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'Address' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(60)] + public string Address + { + get + { + return this._address; + } + set + { + if ((this._address != value)) + { + this.OnAddressChanging(value); + this.RaiseDataMemberChanging("Address"); + this.ValidateProperty("Address", value); + this._address = value; + this.RaiseDataMemberChanged("Address"); + this.OnAddressChanged(); + } + } + } + + /// + /// Gets or sets the 'City' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string City + { + get + { + return this._city; + } + set + { + if ((this._city != value)) + { + this.OnCityChanging(value); + this.RaiseDataMemberChanging("City"); + this.ValidateProperty("City", value); + this._city = value; + this.RaiseDataMemberChanged("City"); + this.OnCityChanged(); + } + } + } + + /// + /// Gets or sets the 'CompanyName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Required()] + [RoundtripOriginal()] + [StringLength(40)] + public string CompanyName + { + get + { + return this._companyName; + } + set + { + if ((this._companyName != value)) + { + this.OnCompanyNameChanging(value); + this.RaiseDataMemberChanging("CompanyName"); + this.ValidateProperty("CompanyName", value); + this._companyName = value; + this.RaiseDataMemberChanged("CompanyName"); + this.OnCompanyNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ContactName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(30)] + public string ContactName + { + get + { + return this._contactName; + } + set + { + if ((this._contactName != value)) + { + this.OnContactNameChanging(value); + this.RaiseDataMemberChanging("ContactName"); + this.ValidateProperty("ContactName", value); + this._contactName = value; + this.RaiseDataMemberChanged("ContactName"); + this.OnContactNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ContactTitle' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(30)] + public string ContactTitle + { + get + { + return this._contactTitle; + } + set + { + if ((this._contactTitle != value)) + { + this.OnContactTitleChanging(value); + this.RaiseDataMemberChanging("ContactTitle"); + this.ValidateProperty("ContactTitle", value); + this._contactTitle = value; + this.RaiseDataMemberChanged("ContactTitle"); + this.OnContactTitleChanged(); + } + } + } + + /// + /// Gets or sets the 'Country' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string Country + { + get + { + return this._country; + } + set + { + if ((this._country != value)) + { + this.OnCountryChanging(value); + this.RaiseDataMemberChanging("Country"); + this.ValidateProperty("Country", value); + this._country = value; + this.RaiseDataMemberChanged("Country"); + this.OnCountryChanged(); + } + } + } + + /// + /// Gets or sets the 'CustomerID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [Required()] + [RoundtripOriginal()] + [StringLength(5)] + public string CustomerID + { + get + { + return this._customerID; + } + set + { + if ((this._customerID != value)) + { + this.OnCustomerIDChanging(value); + this.ValidateProperty("CustomerID", value); + this._customerID = value; + this.RaisePropertyChanged("CustomerID"); + this.OnCustomerIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Fax' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(24)] + public string Fax + { + get + { + return this._fax; + } + set + { + if ((this._fax != value)) + { + this.OnFaxChanging(value); + this.RaiseDataMemberChanging("Fax"); + this.ValidateProperty("Fax", value); + this._fax = value; + this.RaiseDataMemberChanged("Fax"); + this.OnFaxChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("FK_Orders_Customers", "CustomerID", "CustomerID")] + public EntityCollection Orders + { + get + { + if ((this._orders == null)) + { + this._orders = new EntityCollection(this, "Orders", this.FilterOrders, this.AttachOrders, this.DetachOrders); + } + return this._orders; + } + } + + /// + /// Gets or sets the 'Phone' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(24)] + public string Phone + { + get + { + return this._phone; + } + set + { + if ((this._phone != value)) + { + this.OnPhoneChanging(value); + this.RaiseDataMemberChanging("Phone"); + this.ValidateProperty("Phone", value); + this._phone = value; + this.RaiseDataMemberChanged("Phone"); + this.OnPhoneChanged(); + } + } + } + + /// + /// Gets or sets the 'PostalCode' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(10)] + public string PostalCode + { + get + { + return this._postalCode; + } + set + { + if ((this._postalCode != value)) + { + this.OnPostalCodeChanging(value); + this.RaiseDataMemberChanging("PostalCode"); + this.ValidateProperty("PostalCode", value); + this._postalCode = value; + this.RaiseDataMemberChanged("PostalCode"); + this.OnPostalCodeChanged(); + } + } + } + + /// + /// Gets or sets the 'Region' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string Region + { + get + { + return this._region; + } + set + { + if ((this._region != value)) + { + this.OnRegionChanging(value); + this.RaiseDataMemberChanging("Region"); + this.ValidateProperty("Region", value); + this._region = value; + this.RaiseDataMemberChanged("Region"); + this.OnRegionChanged(); + } + } + } + + private void AttachOrders(Order entity) + { + entity.Customer = this; + } + + private void DetachOrders(Order entity) + { + entity.Customer = null; + } + + private bool FilterOrders(Order entity) + { + return (entity.CustomerID == this.CustomerID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._customerID; + } + } + + /// + /// The 'Order' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Order : Entity + { + + private EntityRef _customer; + + private string _customerID; + + private Nullable _employeeID; + + private string _formattedName; + + private Nullable _freight; + + private EntityCollection _order_Details; + + private Nullable _orderDate; + + private int _orderID; + + private Nullable _requiredDate; + + private string _shipAddress; + + private string _shipCity; + + private string _shipCountry; + + private string _shipName; + + private Nullable _shippedDate; + + private string _shipPostalCode; + + private string _shipRegion; + + private Nullable _shipVia; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCustomerIDChanging(string value); + partial void OnCustomerIDChanged(); + partial void OnEmployeeIDChanging(Nullable value); + partial void OnEmployeeIDChanged(); + partial void OnFormattedNameChanging(string value); + partial void OnFormattedNameChanged(); + partial void OnFreightChanging(Nullable value); + partial void OnFreightChanged(); + partial void OnOrderDateChanging(Nullable value); + partial void OnOrderDateChanged(); + partial void OnOrderIDChanging(int value); + partial void OnOrderIDChanged(); + partial void OnRequiredDateChanging(Nullable value); + partial void OnRequiredDateChanged(); + partial void OnShipAddressChanging(string value); + partial void OnShipAddressChanged(); + partial void OnShipCityChanging(string value); + partial void OnShipCityChanged(); + partial void OnShipCountryChanging(string value); + partial void OnShipCountryChanged(); + partial void OnShipNameChanging(string value); + partial void OnShipNameChanged(); + partial void OnShippedDateChanging(Nullable value); + partial void OnShippedDateChanged(); + partial void OnShipPostalCodeChanging(string value); + partial void OnShipPostalCodeChanged(); + partial void OnShipRegionChanging(string value); + partial void OnShipRegionChanged(); + partial void OnShipViaChanging(Nullable value); + partial void OnShipViaChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Order() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [Association("FK_Orders_Customers", "CustomerID", "CustomerID", IsForeignKey=true)] + public Customer Customer + { + get + { + if ((this._customer == null)) + { + this._customer = new EntityRef(this, "Customer", this.FilterCustomer); + } + return this._customer.Entity; + } + set + { + Customer previous = this.Customer; + if ((previous != value)) + { + this.ValidateProperty("Customer", value); + if ((previous != null)) + { + this._customer.Entity = null; + previous.Orders.Remove(this); + } + if ((value != null)) + { + this.CustomerID = value.CustomerID; + } + else + { + this.CustomerID = default(string); + } + this._customer.Entity = value; + if ((value != null)) + { + value.Orders.Add(this); + } + this.RaisePropertyChanged("Customer"); + } + } + } + + /// + /// Gets or sets the 'CustomerID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(5)] + public string CustomerID + { + get + { + return this._customerID; + } + set + { + if ((this._customerID != value)) + { + this.OnCustomerIDChanging(value); + this.RaiseDataMemberChanging("CustomerID"); + this.ValidateProperty("CustomerID", value); + this._customerID = value; + this.RaiseDataMemberChanged("CustomerID"); + this.OnCustomerIDChanged(); + } + } + } + + /// + /// Gets or sets the 'EmployeeID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable EmployeeID + { + get + { + return this._employeeID; + } + set + { + if ((this._employeeID != value)) + { + this.OnEmployeeIDChanging(value); + this.RaiseDataMemberChanging("EmployeeID"); + this.ValidateProperty("EmployeeID", value); + this._employeeID = value; + this.RaiseDataMemberChanged("EmployeeID"); + this.OnEmployeeIDChanged(); + } + } + } + + /// + /// Gets or sets the 'FormattedName' value. + /// + [DataMember()] + [Editable(false)] + [ReadOnly(true)] + public string FormattedName + { + get + { + return this._formattedName; + } + set + { + if ((this._formattedName != value)) + { + this.OnFormattedNameChanging(value); + this.ValidateProperty("FormattedName", value); + this._formattedName = value; + this.RaisePropertyChanged("FormattedName"); + this.OnFormattedNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Freight' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable Freight + { + get + { + return this._freight; + } + set + { + if ((this._freight != value)) + { + this.OnFreightChanging(value); + this.RaiseDataMemberChanging("Freight"); + this.ValidateProperty("Freight", value); + this._freight = value; + this.RaiseDataMemberChanged("Freight"); + this.OnFreightChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("FK_Order_Details_Orders", "OrderID", "OrderID")] + public EntityCollection Order_Details + { + get + { + if ((this._order_Details == null)) + { + this._order_Details = new EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + } + return this._order_Details; + } + } + + /// + /// Gets or sets the 'OrderDate' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable OrderDate + { + get + { + return this._orderDate; + } + set + { + if ((this._orderDate != value)) + { + this.OnOrderDateChanging(value); + this.RaiseDataMemberChanging("OrderDate"); + this.ValidateProperty("OrderDate", value); + this._orderDate = value; + this.RaiseDataMemberChanged("OrderDate"); + this.OnOrderDateChanged(); + } + } + } + + /// + /// Gets or sets the 'OrderID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int OrderID + { + get + { + return this._orderID; + } + set + { + if ((this._orderID != value)) + { + this.OnOrderIDChanging(value); + this.ValidateProperty("OrderID", value); + this._orderID = value; + this.RaisePropertyChanged("OrderID"); + this.OnOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the 'RequiredDate' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable RequiredDate + { + get + { + return this._requiredDate; + } + set + { + if ((this._requiredDate != value)) + { + this.OnRequiredDateChanging(value); + this.RaiseDataMemberChanging("RequiredDate"); + this.ValidateProperty("RequiredDate", value); + this._requiredDate = value; + this.RaiseDataMemberChanged("RequiredDate"); + this.OnRequiredDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipAddress' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(60)] + public string ShipAddress + { + get + { + return this._shipAddress; + } + set + { + if ((this._shipAddress != value)) + { + this.OnShipAddressChanging(value); + this.RaiseDataMemberChanging("ShipAddress"); + this.ValidateProperty("ShipAddress", value); + this._shipAddress = value; + this.RaiseDataMemberChanged("ShipAddress"); + this.OnShipAddressChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipCity' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string ShipCity + { + get + { + return this._shipCity; + } + set + { + if ((this._shipCity != value)) + { + this.OnShipCityChanging(value); + this.RaiseDataMemberChanging("ShipCity"); + this.ValidateProperty("ShipCity", value); + this._shipCity = value; + this.RaiseDataMemberChanged("ShipCity"); + this.OnShipCityChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipCountry' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string ShipCountry + { + get + { + return this._shipCountry; + } + set + { + if ((this._shipCountry != value)) + { + this.OnShipCountryChanging(value); + this.RaiseDataMemberChanging("ShipCountry"); + this.ValidateProperty("ShipCountry", value); + this._shipCountry = value; + this.RaiseDataMemberChanged("ShipCountry"); + this.OnShipCountryChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(40)] + public string ShipName + { + get + { + return this._shipName; + } + set + { + if ((this._shipName != value)) + { + this.OnShipNameChanging(value); + this.RaiseDataMemberChanging("ShipName"); + this.ValidateProperty("ShipName", value); + this._shipName = value; + this.RaiseDataMemberChanged("ShipName"); + this.OnShipNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ShippedDate' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable ShippedDate + { + get + { + return this._shippedDate; + } + set + { + if ((this._shippedDate != value)) + { + this.OnShippedDateChanging(value); + this.RaiseDataMemberChanging("ShippedDate"); + this.ValidateProperty("ShippedDate", value); + this._shippedDate = value; + this.RaiseDataMemberChanged("ShippedDate"); + this.OnShippedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipPostalCode' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(10)] + public string ShipPostalCode + { + get + { + return this._shipPostalCode; + } + set + { + if ((this._shipPostalCode != value)) + { + this.OnShipPostalCodeChanging(value); + this.RaiseDataMemberChanging("ShipPostalCode"); + this.ValidateProperty("ShipPostalCode", value); + this._shipPostalCode = value; + this.RaiseDataMemberChanged("ShipPostalCode"); + this.OnShipPostalCodeChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipRegion' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(15)] + public string ShipRegion + { + get + { + return this._shipRegion; + } + set + { + if ((this._shipRegion != value)) + { + this.OnShipRegionChanging(value); + this.RaiseDataMemberChanging("ShipRegion"); + this.ValidateProperty("ShipRegion", value); + this._shipRegion = value; + this.RaiseDataMemberChanged("ShipRegion"); + this.OnShipRegionChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipVia' value. + /// + [DataMember()] + [RoundtripOriginal()] + public Nullable ShipVia + { + get + { + return this._shipVia; + } + set + { + if ((this._shipVia != value)) + { + this.OnShipViaChanging(value); + this.RaiseDataMemberChanging("ShipVia"); + this.ValidateProperty("ShipVia", value); + this._shipVia = value; + this.RaiseDataMemberChanged("ShipVia"); + this.OnShipViaChanged(); + } + } + } + + private bool FilterCustomer(Customer entity) + { + return (entity.CustomerID == this.CustomerID); + } + + private void AttachOrder_Details(Order_Detail entity) + { + entity.Order = this; + } + + private void DetachOrder_Details(Order_Detail entity) + { + entity.Order = null; + } + + private bool FilterOrder_Details(Order_Detail entity) + { + return (entity.OrderID == this.OrderID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._orderID; + } + } + + /// + /// The 'Order_Detail' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Order_Detail : Entity + { + + private float _discount; + + private EntityRef _order; + + private int _orderID; + + private EntityRef _product; + + private int _productID; + + private short _quantity; + + private decimal _unitPrice; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnDiscountChanging(float value); + partial void OnDiscountChanged(); + partial void OnOrderIDChanging(int value); + partial void OnOrderIDChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnQuantityChanging(short value); + partial void OnQuantityChanged(); + partial void OnUnitPriceChanging(decimal value); + partial void OnUnitPriceChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Order_Detail() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'Discount' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public float Discount + { + get + { + return this._discount; + } + set + { + if ((this._discount != value)) + { + this.OnDiscountChanging(value); + this.RaiseDataMemberChanging("Discount"); + this.ValidateProperty("Discount", value); + this._discount = value; + this.RaiseDataMemberChanged("Discount"); + this.OnDiscountChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [Association("FK_Order_Details_Orders", "OrderID", "OrderID", IsForeignKey=true)] + public Order Order + { + get + { + if ((this._order == null)) + { + this._order = new EntityRef(this, "Order", this.FilterOrder); + } + return this._order.Entity; + } + set + { + Order previous = this.Order; + if ((previous != value)) + { + this.ValidateProperty("Order", value); + if ((previous != null)) + { + this._order.Entity = null; + previous.Order_Details.Remove(this); + } + if ((value != null)) + { + this.OrderID = value.OrderID; + } + else + { + this.OrderID = default(int); + } + this._order.Entity = value; + if ((value != null)) + { + value.Order_Details.Add(this); + } + this.RaisePropertyChanged("Order"); + } + } + } + + /// + /// Gets or sets the 'OrderID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Key()] + [RoundtripOriginal()] + public int OrderID + { + get + { + return this._orderID; + } + set + { + if ((this._orderID != value)) + { + this.OnOrderIDChanging(value); + this.RaiseDataMemberChanging("OrderID"); + this.ValidateProperty("OrderID", value); + this._orderID = value; + this.RaiseDataMemberChanged("OrderID"); + this.OnOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [Association("FK_Order_Details_Products", "ProductID", "ProductID", IsForeignKey=true)] + public Product Product + { + get + { + if ((this._product == null)) + { + this._product = new EntityRef(this, "Product", this.FilterProduct); + } + return this._product.Entity; + } + set + { + Product previous = this.Product; + if ((previous != value)) + { + this.ValidateProperty("Product", value); + if ((previous != null)) + { + this._product.Entity = null; + previous.Order_Details.Remove(this); + } + if ((value != null)) + { + this.ProductID = value.ProductID; + } + else + { + this.ProductID = default(int); + } + this._product.Entity = value; + if ((value != null)) + { + value.Order_Details.Add(this); + } + this.RaisePropertyChanged("Product"); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Key()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.RaiseDataMemberChanging("ProductID"); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaiseDataMemberChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Quantity' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public short Quantity + { + get + { + return this._quantity; + } + set + { + if ((this._quantity != value)) + { + this.OnQuantityChanging(value); + this.RaiseDataMemberChanging("Quantity"); + this.ValidateProperty("Quantity", value); + this._quantity = value; + this.RaiseDataMemberChanged("Quantity"); + this.OnQuantityChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitPrice' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public decimal UnitPrice + { + get + { + return this._unitPrice; + } + set + { + if ((this._unitPrice != value)) + { + this.OnUnitPriceChanging(value); + this.RaiseDataMemberChanging("UnitPrice"); + this.ValidateProperty("UnitPrice", value); + this._unitPrice = value; + this.RaiseDataMemberChanged("UnitPrice"); + this.OnUnitPriceChanged(); + } + } + } + + private bool FilterOrder(Order entity) + { + return (entity.OrderID == this.OrderID); + } + + private bool FilterProduct(Product entity) + { + return (entity.ProductID == this.ProductID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return EntityKey.Create(this._orderID, this._productID); + } + } + + /// + /// The 'Product' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Product : Entity + { + + private EntityRef _category; + + private Nullable _categoryID; + + private string _categoryName; + + private bool _discontinued; + + private EntityCollection _order_Details; + + private int _productID; + + private string _productName; + + private string _quantityPerUnit; + + private Nullable _reorderLevel; + + private string _resolveMethod; + + private Nullable _supplierID; + + private string _supplierName; + + private Nullable _unitPrice; + + private Nullable _unitsInStock; + + private Nullable _unitsOnOrder; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryIDChanging(Nullable value); + partial void OnCategoryIDChanged(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnDiscontinuedChanging(bool value); + partial void OnDiscontinuedChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnProductNameChanging(string value); + partial void OnProductNameChanged(); + partial void OnQuantityPerUnitChanging(string value); + partial void OnQuantityPerUnitChanged(); + partial void OnReorderLevelChanging(Nullable value); + partial void OnReorderLevelChanged(); + partial void OnResolveMethodChanging(string value); + partial void OnResolveMethodChanged(); + partial void OnSupplierIDChanging(Nullable value); + partial void OnSupplierIDChanged(); + partial void OnSupplierNameChanging(string value); + partial void OnSupplierNameChanged(); + partial void OnUnitPriceChanging(Nullable value); + partial void OnUnitPriceChanged(); + partial void OnUnitsInStockChanging(Nullable value); + partial void OnUnitsInStockChanged(); + partial void OnUnitsOnOrderChanging(Nullable value); + partial void OnUnitsOnOrderChanged(); + partial void OnDiscontinueProductInvoking(); + partial void OnDiscontinueProductInvoked(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Product() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [Association("FK_Products_Categories", "CategoryID", "CategoryID", IsForeignKey=true)] + public Category Category + { + get + { + if ((this._category == null)) + { + this._category = new EntityRef(this, "Category", this.FilterCategory); + } + return this._category.Entity; + } + set + { + Category previous = this.Category; + if ((previous != value)) + { + this.ValidateProperty("Category", value); + if ((previous != null)) + { + this._category.Entity = null; + previous.Products.Remove(this); + } + if ((value != null)) + { + this.CategoryID = value.CategoryID; + } + else + { + this.CategoryID = default(Nullable); + } + this._category.Entity = value; + if ((value != null)) + { + value.Products.Add(this); + } + this.RaisePropertyChanged("Category"); + } + } + } + + /// + /// Gets or sets the 'CategoryID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable CategoryID + { + get + { + return this._categoryID; + } + set + { + if ((this._categoryID != value)) + { + this.OnCategoryIDChanging(value); + this.RaiseDataMemberChanging("CategoryID"); + this.ValidateProperty("CategoryID", value); + this._categoryID = value; + this.RaiseDataMemberChanged("CategoryID"); + this.OnCategoryIDChanged(); + } + } + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [DataMember()] + [Editable(false)] + [StringLength(15)] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaisePropertyChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Discontinued' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public bool Discontinued + { + get + { + return this._discontinued; + } + set + { + if ((this._discontinued != value)) + { + this.OnDiscontinuedChanging(value); + this.RaiseDataMemberChanging("Discontinued"); + this.ValidateProperty("Discontinued", value); + this._discontinued = value; + this.RaiseDataMemberChanged("Discontinued"); + this.OnDiscontinuedChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("FK_Order_Details_Products", "ProductID", "ProductID")] + public EntityCollection Order_Details + { + get + { + if ((this._order_Details == null)) + { + this._order_Details = new EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + } + return this._order_Details; + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductName' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [Required()] + [RoundtripOriginal()] + [StringLength(40)] + public string ProductName + { + get + { + return this._productName; + } + set + { + if ((this._productName != value)) + { + this.OnProductNameChanging(value); + this.RaiseDataMemberChanging("ProductName"); + this.ValidateProperty("ProductName", value); + this._productName = value; + this.RaiseDataMemberChanged("ProductName"); + this.OnProductNameChanged(); + } + } + } + + /// + /// Gets or sets the 'QuantityPerUnit' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + [StringLength(20)] + public string QuantityPerUnit + { + get + { + return this._quantityPerUnit; + } + set + { + if ((this._quantityPerUnit != value)) + { + this.OnQuantityPerUnitChanging(value); + this.RaiseDataMemberChanging("QuantityPerUnit"); + this.ValidateProperty("QuantityPerUnit", value); + this._quantityPerUnit = value; + this.RaiseDataMemberChanged("QuantityPerUnit"); + this.OnQuantityPerUnitChanged(); + } + } + } + + /// + /// Gets or sets the 'ReorderLevel' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable ReorderLevel + { + get + { + return this._reorderLevel; + } + set + { + if ((this._reorderLevel != value)) + { + this.OnReorderLevelChanging(value); + this.RaiseDataMemberChanging("ReorderLevel"); + this.ValidateProperty("ReorderLevel", value); + this._reorderLevel = value; + this.RaiseDataMemberChanged("ReorderLevel"); + this.OnReorderLevelChanged(); + } + } + } + + /// + /// Gets or sets the 'ResolveMethod' value. + /// + [DataMember()] + public string ResolveMethod + { + get + { + return this._resolveMethod; + } + set + { + if ((this._resolveMethod != value)) + { + this.OnResolveMethodChanging(value); + this.RaiseDataMemberChanging("ResolveMethod"); + this.ValidateProperty("ResolveMethod", value); + this._resolveMethod = value; + this.RaiseDataMemberChanged("ResolveMethod"); + this.OnResolveMethodChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierID' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable SupplierID + { + get + { + return this._supplierID; + } + set + { + if ((this._supplierID != value)) + { + this.OnSupplierIDChanging(value); + this.RaiseDataMemberChanging("SupplierID"); + this.ValidateProperty("SupplierID", value); + this._supplierID = value; + this.RaiseDataMemberChanged("SupplierID"); + this.OnSupplierIDChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierName' value. + /// + [DataMember()] + [Editable(false)] + public string SupplierName + { + get + { + return this._supplierName; + } + set + { + if ((this._supplierName != value)) + { + this.OnSupplierNameChanging(value); + this.ValidateProperty("SupplierName", value); + this._supplierName = value; + this.RaisePropertyChanged("SupplierName"); + this.OnSupplierNameChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitPrice' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable UnitPrice + { + get + { + return this._unitPrice; + } + set + { + if ((this._unitPrice != value)) + { + this.OnUnitPriceChanging(value); + this.RaiseDataMemberChanging("UnitPrice"); + this.ValidateProperty("UnitPrice", value); + this._unitPrice = value; + this.RaiseDataMemberChanged("UnitPrice"); + this.OnUnitPriceChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitsInStock' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable UnitsInStock + { + get + { + return this._unitsInStock; + } + set + { + if ((this._unitsInStock != value)) + { + this.OnUnitsInStockChanging(value); + this.RaiseDataMemberChanging("UnitsInStock"); + this.ValidateProperty("UnitsInStock", value); + this._unitsInStock = value; + this.RaiseDataMemberChanged("UnitsInStock"); + this.OnUnitsInStockChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitsOnOrder' value. + /// + [ConcurrencyCheck()] + [DataMember()] + [RoundtripOriginal()] + public Nullable UnitsOnOrder + { + get + { + return this._unitsOnOrder; + } + set + { + if ((this._unitsOnOrder != value)) + { + this.OnUnitsOnOrderChanging(value); + this.RaiseDataMemberChanging("UnitsOnOrder"); + this.ValidateProperty("UnitsOnOrder", value); + this._unitsOnOrder = value; + this.RaiseDataMemberChanged("UnitsOnOrder"); + this.OnUnitsOnOrderChanged(); + } + } + } + + /// + /// Gets a value indicating whether the 'DiscontinueProduct' action has been invoked on this entity. + /// + [Display(AutoGenerateField=false)] + public bool IsDiscontinueProductInvoked + { + get + { + return base.IsActionInvoked("DiscontinueProduct"); + } + } + + /// + /// Gets a value indicating whether the 'DiscontinueProduct' method can be invoked on this entity. + /// + [Display(AutoGenerateField=false)] + public bool CanDiscontinueProduct + { + get + { + return base.CanInvokeAction("DiscontinueProduct"); + } + } + + private bool FilterCategory(Category entity) + { + return (entity.CategoryID == this.CategoryID); + } + + private void AttachOrder_Details(Order_Detail entity) + { + entity.Product = this; + } + + private void DetachOrder_Details(Order_Detail entity) + { + entity.Product = null; + } + + private bool FilterOrder_Details(Order_Detail entity) + { + return (entity.ProductID == this.ProductID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._productID; + } + + /// + /// Invokes the 'DiscontinueProduct' action on this entity. + /// + [EntityAction("DiscontinueProduct", AllowMultipleInvocations=false)] + public void DiscontinueProduct() + { + this.OnDiscontinueProductInvoking(); + base.InvokeAction("DiscontinueProduct"); + this.OnDiscontinueProductInvoked(); + } + } + + /// + /// The 'ProductInfo' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class ProductInfo : Entity + { + + private string _categoryName; + + private int _productID; + + private string _productName; + + private string _supplierName; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnProductNameChanging(string value); + partial void OnProductNameChanged(); + partial void OnSupplierNameChanging(string value); + partial void OnSupplierNameChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public ProductInfo() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [DataMember()] + [Editable(false)] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaisePropertyChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductName' value. + /// + [DataMember()] + public string ProductName + { + get + { + return this._productName; + } + set + { + if ((this._productName != value)) + { + this.OnProductNameChanging(value); + this.RaiseDataMemberChanging("ProductName"); + this.ValidateProperty("ProductName", value); + this._productName = value; + this.RaiseDataMemberChanged("ProductName"); + this.OnProductNameChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierName' value. + /// + [DataMember()] + [Editable(false)] + public string SupplierName + { + get + { + return this._supplierName; + } + set + { + if ((this._supplierName != value)) + { + this.OnSupplierNameChanging(value); + this.ValidateProperty("SupplierName", value); + this._supplierName = value; + this.RaisePropertyChanged("SupplierName"); + this.OnSupplierNameChanged(); + } + } + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._productID; + } + } + + /// + /// The 'Region' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Region : Entity + { + + private string _regionDescription; + + private int _regionID; + + private EntityCollection _territories; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnRegionDescriptionChanging(string value); + partial void OnRegionDescriptionChanged(); + partial void OnRegionIDChanging(int value); + partial void OnRegionIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Region() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'RegionDescription' value. + /// + [DataMember()] + [Required()] + [StringLength(50)] + public string RegionDescription + { + get + { + return this._regionDescription; + } + set + { + if ((this._regionDescription != value)) + { + this.OnRegionDescriptionChanging(value); + this.RaiseDataMemberChanging("RegionDescription"); + this.ValidateProperty("RegionDescription", value); + this._regionDescription = value; + this.RaiseDataMemberChanged("RegionDescription"); + this.OnRegionDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'RegionID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [RoundtripOriginal()] + public int RegionID + { + get + { + return this._regionID; + } + set + { + if ((this._regionID != value)) + { + this.OnRegionIDChanging(value); + this.ValidateProperty("RegionID", value); + this._regionID = value; + this.RaisePropertyChanged("RegionID"); + this.OnRegionIDChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [Association("FK_Territories_Region", "RegionID", "RegionID")] + [Composition()] + public EntityCollection Territories + { + get + { + if ((this._territories == null)) + { + this._territories = new EntityCollection(this, "Territories", this.FilterTerritories, this.AttachTerritories, this.DetachTerritories); + } + return this._territories; + } + } + + private void AttachTerritories(Territory entity) + { + entity.Region = this; + } + + private void DetachTerritories(Territory entity) + { + entity.Region = null; + } + + private bool FilterTerritories(Territory entity) + { + return (entity.RegionID == this.RegionID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._regionID; + } + } + + /// + /// The 'Territory' entity class. + /// + [DataContract(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] + public sealed partial class Territory : Entity + { + + private EntityRef _region; + + private int _regionID; + + private string _territoryDescription; + + private string _territoryID; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnRegionIDChanging(int value); + partial void OnRegionIDChanged(); + partial void OnTerritoryDescriptionChanging(string value); + partial void OnTerritoryDescriptionChanged(); + partial void OnTerritoryIDChanging(string value); + partial void OnTerritoryIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Territory() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [Association("FK_Territories_Region", "RegionID", "RegionID", IsForeignKey=true)] + public Region Region + { + get + { + if ((this._region == null)) + { + this._region = new EntityRef(this, "Region", this.FilterRegion); + } + return this._region.Entity; + } + set + { + Region previous = this.Region; + if ((previous != value)) + { + this.ValidateProperty("Region", value); + if ((previous != null)) + { + this._region.Entity = null; + previous.Territories.Remove(this); + } + if ((value != null)) + { + this.RegionID = value.RegionID; + } + else + { + this.RegionID = default(int); + } + this._region.Entity = value; + if ((value != null)) + { + value.Territories.Add(this); + } + this.RaisePropertyChanged("Region"); + } + } + } + + /// + /// Gets or sets the 'RegionID' value. + /// + [DataMember()] + [RoundtripOriginal()] + public int RegionID + { + get + { + return this._regionID; + } + set + { + if ((this._regionID != value)) + { + this.OnRegionIDChanging(value); + this.RaiseDataMemberChanging("RegionID"); + this.ValidateProperty("RegionID", value); + this._regionID = value; + this.RaiseDataMemberChanged("RegionID"); + this.OnRegionIDChanged(); + } + } + } + + /// + /// Gets or sets the 'TerritoryDescription' value. + /// + [DataMember()] + [Required()] + [StringLength(50)] + public string TerritoryDescription + { + get + { + return this._territoryDescription; + } + set + { + if ((this._territoryDescription != value)) + { + this.OnTerritoryDescriptionChanging(value); + this.RaiseDataMemberChanging("TerritoryDescription"); + this.ValidateProperty("TerritoryDescription", value); + this._territoryDescription = value; + this.RaiseDataMemberChanged("TerritoryDescription"); + this.OnTerritoryDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'TerritoryID' value. + /// + [DataMember()] + [Editable(false, AllowInitialValue=true)] + [Key()] + [Required()] + [RoundtripOriginal()] + [StringLength(20)] + public string TerritoryID + { + get + { + return this._territoryID; + } + set + { + if ((this._territoryID != value)) + { + this.OnTerritoryIDChanging(value); + this.ValidateProperty("TerritoryID", value); + this._territoryID = value; + this.RaisePropertyChanged("TerritoryID"); + this.OnTerritoryIDChanged(); + } + } + } + + private bool FilterRegion(Region entity) + { + return (entity.RegionID == this.RegionID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._territoryID; + } + } +} +namespace TestDomainServices.EFCore +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.ComponentModel.DataAnnotations; + using System.Linq; + using System.ServiceModel; + using System.Threading.Tasks; + using EFCoreModels.Northwind; + using OpenRiaServices; + using OpenRiaServices.Client; + using OpenRiaServices.Client.Authentication; + + + /// + /// The DomainContext corresponding to the 'Northwind' DomainService. + /// + public sealed partial class Northwind : DomainContext + { + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Northwind() : + this(new Uri("TestDomainServices-EFCore-Northwind.svc", UriKind.Relative)) + { + } + + /// + /// Initializes a new instance of the class with the specified service URI. + /// + /// The Northwind service URI. + public Northwind(Uri serviceUri) : + this(DomainContext.CreateDomainClient(typeof(INorthwindContract), serviceUri, false)) + { + } + + /// + /// Initializes a new instance of the class with the specified . + /// + /// The DomainClient instance to use for this DomainContext. + public Northwind(DomainClient domainClient) : + base(domainClient) + { + this.OnCreated(); + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Categories + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Customers + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Order_Details + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Orders + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Products + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet ProductInfos + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public EntitySet Regions + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetCategoriesQuery() + { + this.ValidateMethod("GetCategoriesQuery", null); + return base.CreateQuery("GetCategories", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetCustomersQuery() + { + this.ValidateMethod("GetCustomersQuery", null); + return base.CreateQuery("GetCustomers", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetOrderDetailsQuery() + { + this.ValidateMethod("GetOrderDetailsQuery", null); + return base.CreateQuery("GetOrderDetails", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetOrdersQuery() + { + this.ValidateMethod("GetOrdersQuery", null); + return base.CreateQuery("GetOrders", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductById' query. + /// + /// The value for the 'id' parameter of the query. + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductByIdQuery(int id) + { + Dictionary parameters = new Dictionary(); + parameters.Add("id", id); + this.ValidateMethod("GetProductByIdQuery", parameters); + return base.CreateQuery("GetProductById", parameters, false, false); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductInfosQuery() + { + this.ValidateMethod("GetProductInfosQuery", null); + return base.CreateQuery("GetProductInfos", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetProductsQuery() + { + this.ValidateMethod("GetProductsQuery", null); + return base.CreateQuery("GetProducts", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegionById' query. + /// + /// The value for the 'id' parameter of the query. + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetRegionByIdQuery(int id) + { + Dictionary parameters = new Dictionary(); + parameters.Add("id", id); + this.ValidateMethod("GetRegionByIdQuery", parameters); + return base.CreateQuery("GetRegionById", parameters, false, false); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public EntityQuery GetRegionsQuery() + { + this.ValidateMethod("GetRegionsQuery", null); + return base.CreateQuery("GetRegions", null, false, true); + } + + /// + /// Invokes the 'DiscontinueProduct' method of the specified entity. + /// + /// The entity instance. + public void DiscontinueProduct(Product product) + { + product.DiscontinueProduct(); + } + + /// + /// Creates a new EntityContainer for this DomainContext's EntitySets. + /// + /// A new container instance. + protected override EntityContainer CreateEntityContainer() + { + return new NorthwindEntityContainer(); + } + + /// + /// Service contract for the 'Northwind' DomainService. + /// + [ServiceContract()] + public interface INorthwindContract + { + + /// + /// Asynchronously invokes the 'GetCategories' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetCategories", ReplyAction="http://tempuri.org/Northwind/GetCategoriesResponse")] + IAsyncResult BeginGetCategories(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetCategories'. + /// + /// The IAsyncResult returned from 'BeginGetCategories'. + /// The 'QueryResult' returned from the 'GetCategories' operation. + QueryResult EndGetCategories(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetCustomers' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetCustomers", ReplyAction="http://tempuri.org/Northwind/GetCustomersResponse")] + IAsyncResult BeginGetCustomers(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetCustomers'. + /// + /// The IAsyncResult returned from 'BeginGetCustomers'. + /// The 'QueryResult' returned from the 'GetCustomers' operation. + QueryResult EndGetCustomers(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetOrderDetails' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetOrderDetails", ReplyAction="http://tempuri.org/Northwind/GetOrderDetailsResponse")] + IAsyncResult BeginGetOrderDetails(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetOrderDetails'. + /// + /// The IAsyncResult returned from 'BeginGetOrderDetails'. + /// The 'QueryResult' returned from the 'GetOrderDetails' operation. + QueryResult EndGetOrderDetails(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetOrders' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetOrders", ReplyAction="http://tempuri.org/Northwind/GetOrdersResponse")] + IAsyncResult BeginGetOrders(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetOrders'. + /// + /// The IAsyncResult returned from 'BeginGetOrders'. + /// The 'QueryResult' returned from the 'GetOrders' operation. + QueryResult EndGetOrders(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductById' operation. + /// + /// The value for the 'id' parameter of this action. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProductById", ReplyAction="http://tempuri.org/Northwind/GetProductByIdResponse")] + IAsyncResult BeginGetProductById(int id, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductById'. + /// + /// The IAsyncResult returned from 'BeginGetProductById'. + /// The 'QueryResult' returned from the 'GetProductById' operation. + QueryResult EndGetProductById(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductInfos' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProductInfos", ReplyAction="http://tempuri.org/Northwind/GetProductInfosResponse")] + IAsyncResult BeginGetProductInfos(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductInfos'. + /// + /// The IAsyncResult returned from 'BeginGetProductInfos'. + /// The 'QueryResult' returned from the 'GetProductInfos' operation. + QueryResult EndGetProductInfos(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProducts' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProducts", ReplyAction="http://tempuri.org/Northwind/GetProductsResponse")] + IAsyncResult BeginGetProducts(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProducts'. + /// + /// The IAsyncResult returned from 'BeginGetProducts'. + /// The 'QueryResult' returned from the 'GetProducts' operation. + QueryResult EndGetProducts(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetRegionById' operation. + /// + /// The value for the 'id' parameter of this action. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetRegionById", ReplyAction="http://tempuri.org/Northwind/GetRegionByIdResponse")] + IAsyncResult BeginGetRegionById(int id, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetRegionById'. + /// + /// The IAsyncResult returned from 'BeginGetRegionById'. + /// The 'QueryResult' returned from the 'GetRegionById' operation. + QueryResult EndGetRegionById(IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetRegions' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [HasSideEffects(false)] + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetRegions", ReplyAction="http://tempuri.org/Northwind/GetRegionsResponse")] + IAsyncResult BeginGetRegions(AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetRegions'. + /// + /// The IAsyncResult returned from 'BeginGetRegions'. + /// The 'QueryResult' returned from the 'GetRegions' operation. + QueryResult EndGetRegions(IAsyncResult result); + + /// + /// Asynchronously invokes the 'SubmitChanges' operation. + /// + /// The change-set to submit. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [OperationContract(AsyncPattern=true, Action="http://tempuri.org/Northwind/SubmitChanges", ReplyAction="http://tempuri.org/Northwind/SubmitChangesResponse")] + IAsyncResult BeginSubmitChanges(IEnumerable changeSet, AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginSubmitChanges'. + /// + /// The IAsyncResult returned from 'BeginSubmitChanges'. + /// The collection of change-set entry elements returned from 'SubmitChanges'. + IEnumerable EndSubmitChanges(IAsyncResult result); + } + + internal sealed class NorthwindEntityContainer : EntityContainer + { + + public NorthwindEntityContainer() + { + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.Edit); + this.CreateEntitySet(EntitySetOperations.All); + this.CreateEntitySet(EntitySetOperations.All); + } + } + } +} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb new file mode 100644 index 000000000..a8ff9dbe3 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb @@ -0,0 +1,2710 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Compare Binary +Option Infer On +Option Strict On +Option Explicit On + +Imports EFCoreModels.Northwind +Imports OpenRiaServices +Imports OpenRiaServices.Client +Imports OpenRiaServices.Client.Authentication +Imports System +Imports System.Collections.Generic +Imports System.ComponentModel +Imports System.ComponentModel.DataAnnotations +Imports System.Linq +Imports System.Runtime.Serialization +Imports System.ServiceModel +Imports System.Threading.Tasks + +Namespace EFCoreModels.Northwind + + ''' + ''' The 'Category' entity class. + ''' + _ + Partial Public NotInheritable Class Category + Inherits Entity + + Private _categoryID As Integer + + Private _categoryName As String + + Private _description As String + + Private _picture() As Byte + + Private _products As EntityCollection(Of Product) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCategoryIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnCategoryIDChanged() + End Sub + Private Partial Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCategoryNameChanged() + End Sub + Private Partial Sub OnDescriptionChanging(ByVal value As String) + End Sub + Private Partial Sub OnDescriptionChanged() + End Sub + Private Partial Sub OnPictureChanging(ByVal value() As Byte) + End Sub + Private Partial Sub OnPictureChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'CategoryID' value. + ''' + _ + Public Property CategoryID() As Integer + Get + Return Me._categoryID + End Get + Set + If ((Me._categoryID = value) _ + = false) Then + Me.OnCategoryIDChanging(value) + Me.ValidateProperty("CategoryID", value) + Me._categoryID = value + Me.RaisePropertyChanged("CategoryID") + Me.OnCategoryIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + _ + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.RaiseDataMemberChanging("CategoryName") + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value + Me.RaiseDataMemberChanged("CategoryName") + Me.OnCategoryNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Description' value. + ''' + _ + Public Property Description() As String + Get + Return Me._description + End Get + Set + If (String.Equals(Me._description, value) = false) Then + Me.OnDescriptionChanging(value) + Me.RaiseDataMemberChanging("Description") + Me.ValidateProperty("Description", value) + Me._description = value + Me.RaiseDataMemberChanged("Description") + Me.OnDescriptionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Picture' value. + ''' + _ + Public Property Picture() As Byte() + Get + Return Me._picture + End Get + Set + If (Object.Equals(Me._picture, value) = false) Then + Me.OnPictureChanging(value) + Me.RaiseDataMemberChanging("Picture") + Me.ValidateProperty("Picture", value) + Me._picture = value + Me.RaiseDataMemberChanged("Picture") + Me.OnPictureChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Products() As EntityCollection(Of Product) + Get + If (Me._products Is Nothing) Then + Me._products = New EntityCollection(Of Product)(Me, "Products", AddressOf Me.FilterProducts, AddressOf Me.AttachProducts, AddressOf Me.DetachProducts) + End If + Return Me._products + End Get + End Property + + Private Sub AttachProducts(ByVal entity As Product) + entity.Category = Me + End Sub + + Private Sub DetachProducts(ByVal entity As Product) + entity.Category = Nothing + End Sub + + Private Function FilterProducts(ByVal entity As Product) As Boolean + Return Object.Equals(entity.CategoryID, Me.CategoryID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._categoryID + End Function + End Class + + ''' + ''' The 'Customer' entity class. + ''' + _ + Partial Public NotInheritable Class Customer + Inherits Entity + + Private _address As String + + Private _city As String + + Private _companyName As String + + Private _contactName As String + + Private _contactTitle As String + + Private _country As String + + Private _customerID As String + + Private _fax As String + + Private _orders As EntityCollection(Of Order) + + Private _phone As String + + Private _postalCode As String + + Private _region As String + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnAddressChanging(ByVal value As String) + End Sub + Private Partial Sub OnAddressChanged() + End Sub + Private Partial Sub OnCityChanging(ByVal value As String) + End Sub + Private Partial Sub OnCityChanged() + End Sub + Private Partial Sub OnCompanyNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCompanyNameChanged() + End Sub + Private Partial Sub OnContactNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnContactNameChanged() + End Sub + Private Partial Sub OnContactTitleChanging(ByVal value As String) + End Sub + Private Partial Sub OnContactTitleChanged() + End Sub + Private Partial Sub OnCountryChanging(ByVal value As String) + End Sub + Private Partial Sub OnCountryChanged() + End Sub + Private Partial Sub OnCustomerIDChanging(ByVal value As String) + End Sub + Private Partial Sub OnCustomerIDChanged() + End Sub + Private Partial Sub OnFaxChanging(ByVal value As String) + End Sub + Private Partial Sub OnFaxChanged() + End Sub + Private Partial Sub OnPhoneChanging(ByVal value As String) + End Sub + Private Partial Sub OnPhoneChanged() + End Sub + Private Partial Sub OnPostalCodeChanging(ByVal value As String) + End Sub + Private Partial Sub OnPostalCodeChanged() + End Sub + Private Partial Sub OnRegionChanging(ByVal value As String) + End Sub + Private Partial Sub OnRegionChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'Address' value. + ''' + _ + Public Property Address() As String + Get + Return Me._address + End Get + Set + If (String.Equals(Me._address, value) = false) Then + Me.OnAddressChanging(value) + Me.RaiseDataMemberChanging("Address") + Me.ValidateProperty("Address", value) + Me._address = value + Me.RaiseDataMemberChanged("Address") + Me.OnAddressChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'City' value. + ''' + _ + Public Property City() As String + Get + Return Me._city + End Get + Set + If (String.Equals(Me._city, value) = false) Then + Me.OnCityChanging(value) + Me.RaiseDataMemberChanging("City") + Me.ValidateProperty("City", value) + Me._city = value + Me.RaiseDataMemberChanged("City") + Me.OnCityChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CompanyName' value. + ''' + _ + Public Property CompanyName() As String + Get + Return Me._companyName + End Get + Set + If (String.Equals(Me._companyName, value) = false) Then + Me.OnCompanyNameChanging(value) + Me.RaiseDataMemberChanging("CompanyName") + Me.ValidateProperty("CompanyName", value) + Me._companyName = value + Me.RaiseDataMemberChanged("CompanyName") + Me.OnCompanyNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ContactName' value. + ''' + _ + Public Property ContactName() As String + Get + Return Me._contactName + End Get + Set + If (String.Equals(Me._contactName, value) = false) Then + Me.OnContactNameChanging(value) + Me.RaiseDataMemberChanging("ContactName") + Me.ValidateProperty("ContactName", value) + Me._contactName = value + Me.RaiseDataMemberChanged("ContactName") + Me.OnContactNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ContactTitle' value. + ''' + _ + Public Property ContactTitle() As String + Get + Return Me._contactTitle + End Get + Set + If (String.Equals(Me._contactTitle, value) = false) Then + Me.OnContactTitleChanging(value) + Me.RaiseDataMemberChanging("ContactTitle") + Me.ValidateProperty("ContactTitle", value) + Me._contactTitle = value + Me.RaiseDataMemberChanged("ContactTitle") + Me.OnContactTitleChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Country' value. + ''' + _ + Public Property Country() As String + Get + Return Me._country + End Get + Set + If (String.Equals(Me._country, value) = false) Then + Me.OnCountryChanging(value) + Me.RaiseDataMemberChanging("Country") + Me.ValidateProperty("Country", value) + Me._country = value + Me.RaiseDataMemberChanged("Country") + Me.OnCountryChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CustomerID' value. + ''' + _ + Public Property CustomerID() As String + Get + Return Me._customerID + End Get + Set + If (String.Equals(Me._customerID, value) = false) Then + Me.OnCustomerIDChanging(value) + Me.ValidateProperty("CustomerID", value) + Me._customerID = value + Me.RaisePropertyChanged("CustomerID") + Me.OnCustomerIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Fax' value. + ''' + _ + Public Property Fax() As String + Get + Return Me._fax + End Get + Set + If (String.Equals(Me._fax, value) = false) Then + Me.OnFaxChanging(value) + Me.RaiseDataMemberChanging("Fax") + Me.ValidateProperty("Fax", value) + Me._fax = value + Me.RaiseDataMemberChanged("Fax") + Me.OnFaxChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Orders() As EntityCollection(Of Order) + Get + If (Me._orders Is Nothing) Then + Me._orders = New EntityCollection(Of Order)(Me, "Orders", AddressOf Me.FilterOrders, AddressOf Me.AttachOrders, AddressOf Me.DetachOrders) + End If + Return Me._orders + End Get + End Property + + ''' + ''' Gets or sets the 'Phone' value. + ''' + _ + Public Property Phone() As String + Get + Return Me._phone + End Get + Set + If (String.Equals(Me._phone, value) = false) Then + Me.OnPhoneChanging(value) + Me.RaiseDataMemberChanging("Phone") + Me.ValidateProperty("Phone", value) + Me._phone = value + Me.RaiseDataMemberChanged("Phone") + Me.OnPhoneChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'PostalCode' value. + ''' + _ + Public Property PostalCode() As String + Get + Return Me._postalCode + End Get + Set + If (String.Equals(Me._postalCode, value) = false) Then + Me.OnPostalCodeChanging(value) + Me.RaiseDataMemberChanging("PostalCode") + Me.ValidateProperty("PostalCode", value) + Me._postalCode = value + Me.RaiseDataMemberChanged("PostalCode") + Me.OnPostalCodeChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Region' value. + ''' + _ + Public Property Region() As String + Get + Return Me._region + End Get + Set + If (String.Equals(Me._region, value) = false) Then + Me.OnRegionChanging(value) + Me.RaiseDataMemberChanging("Region") + Me.ValidateProperty("Region", value) + Me._region = value + Me.RaiseDataMemberChanged("Region") + Me.OnRegionChanged + End If + End Set + End Property + + Private Sub AttachOrders(ByVal entity As Order) + entity.Customer = Me + End Sub + + Private Sub DetachOrders(ByVal entity As Order) + entity.Customer = Nothing + End Sub + + Private Function FilterOrders(ByVal entity As Order) As Boolean + Return Object.Equals(entity.CustomerID, Me.CustomerID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._customerID + End Function + End Class + + ''' + ''' The 'Order' entity class. + ''' + _ + Partial Public NotInheritable Class Order + Inherits Entity + + Private _customer As EntityRef(Of Customer) + + Private _customerID As String + + Private _employeeID As Nullable(Of Integer) + + Private _formattedName As String + + Private _freight As Nullable(Of Decimal) + + Private _order_Details As EntityCollection(Of Order_Detail) + + Private _orderDate As Nullable(Of DateTime) + + Private _orderID As Integer + + Private _requiredDate As Nullable(Of DateTime) + + Private _shipAddress As String + + Private _shipCity As String + + Private _shipCountry As String + + Private _shipName As String + + Private _shippedDate As Nullable(Of DateTime) + + Private _shipPostalCode As String + + Private _shipRegion As String + + Private _shipVia As Nullable(Of Integer) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCustomerIDChanging(ByVal value As String) + End Sub + Private Partial Sub OnCustomerIDChanged() + End Sub + Private Partial Sub OnEmployeeIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Private Partial Sub OnEmployeeIDChanged() + End Sub + Private Partial Sub OnFormattedNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnFormattedNameChanged() + End Sub + Private Partial Sub OnFreightChanging(ByVal value As Nullable(Of Decimal)) + End Sub + Private Partial Sub OnFreightChanged() + End Sub + Private Partial Sub OnOrderDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Private Partial Sub OnOrderDateChanged() + End Sub + Private Partial Sub OnOrderIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnOrderIDChanged() + End Sub + Private Partial Sub OnRequiredDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Private Partial Sub OnRequiredDateChanged() + End Sub + Private Partial Sub OnShipAddressChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipAddressChanged() + End Sub + Private Partial Sub OnShipCityChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipCityChanged() + End Sub + Private Partial Sub OnShipCountryChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipCountryChanged() + End Sub + Private Partial Sub OnShipNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipNameChanged() + End Sub + Private Partial Sub OnShippedDateChanging(ByVal value As Nullable(Of DateTime)) + End Sub + Private Partial Sub OnShippedDateChanged() + End Sub + Private Partial Sub OnShipPostalCodeChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipPostalCodeChanged() + End Sub + Private Partial Sub OnShipRegionChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipRegionChanged() + End Sub + Private Partial Sub OnShipViaChanging(ByVal value As Nullable(Of Integer)) + End Sub + Private Partial Sub OnShipViaChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Customer() As Customer + Get + If (Me._customer Is Nothing) Then + Me._customer = New EntityRef(Of Customer)(Me, "Customer", AddressOf Me.FilterCustomer) + End If + Return Me._customer.Entity + End Get + Set + Dim previous As Customer = Me.Customer + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Customer", value) + If (Not (previous) Is Nothing) Then + Me._customer.Entity = Nothing + previous.Orders.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.CustomerID = value.CustomerID + Else + Me.CustomerID = CType(Nothing, String) + End If + Me._customer.Entity = value + If (Not (value) Is Nothing) Then + value.Orders.Add(Me) + End If + Me.RaisePropertyChanged("Customer") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CustomerID' value. + ''' + _ + Public Property CustomerID() As String + Get + Return Me._customerID + End Get + Set + If (String.Equals(Me._customerID, value) = false) Then + Me.OnCustomerIDChanging(value) + Me.RaiseDataMemberChanging("CustomerID") + Me.ValidateProperty("CustomerID", value) + Me._customerID = value + Me.RaiseDataMemberChanged("CustomerID") + Me.OnCustomerIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'EmployeeID' value. + ''' + _ + Public Property EmployeeID() As Nullable(Of Integer) + Get + Return Me._employeeID + End Get + Set + If (Me._employeeID.Equals(value) = false) Then + Me.OnEmployeeIDChanging(value) + Me.RaiseDataMemberChanging("EmployeeID") + Me.ValidateProperty("EmployeeID", value) + Me._employeeID = value + Me.RaiseDataMemberChanged("EmployeeID") + Me.OnEmployeeIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'FormattedName' value. + ''' + _ + Public Property FormattedName() As String + Get + Return Me._formattedName + End Get + Set + If (String.Equals(Me._formattedName, value) = false) Then + Me.OnFormattedNameChanging(value) + Me.ValidateProperty("FormattedName", value) + Me._formattedName = value + Me.RaisePropertyChanged("FormattedName") + Me.OnFormattedNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Freight' value. + ''' + _ + Public Property Freight() As Nullable(Of Decimal) + Get + Return Me._freight + End Get + Set + If (Me._freight.Equals(value) = false) Then + Me.OnFreightChanging(value) + Me.RaiseDataMemberChanging("Freight") + Me.ValidateProperty("Freight", value) + Me._freight = value + Me.RaiseDataMemberChanged("Freight") + Me.OnFreightChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) + Get + If (Me._order_Details Is Nothing) Then + Me._order_Details = New EntityCollection(Of Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + End If + Return Me._order_Details + End Get + End Property + + ''' + ''' Gets or sets the 'OrderDate' value. + ''' + _ + Public Property OrderDate() As Nullable(Of DateTime) + Get + Return Me._orderDate + End Get + Set + If (Me._orderDate.Equals(value) = false) Then + Me.OnOrderDateChanging(value) + Me.RaiseDataMemberChanging("OrderDate") + Me.ValidateProperty("OrderDate", value) + Me._orderDate = value + Me.RaiseDataMemberChanged("OrderDate") + Me.OnOrderDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderID' value. + ''' + _ + Public Property OrderID() As Integer + Get + Return Me._orderID + End Get + Set + If ((Me._orderID = value) _ + = false) Then + Me.OnOrderIDChanging(value) + Me.ValidateProperty("OrderID", value) + Me._orderID = value + Me.RaisePropertyChanged("OrderID") + Me.OnOrderIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RequiredDate' value. + ''' + _ + Public Property RequiredDate() As Nullable(Of DateTime) + Get + Return Me._requiredDate + End Get + Set + If (Me._requiredDate.Equals(value) = false) Then + Me.OnRequiredDateChanging(value) + Me.RaiseDataMemberChanging("RequiredDate") + Me.ValidateProperty("RequiredDate", value) + Me._requiredDate = value + Me.RaiseDataMemberChanged("RequiredDate") + Me.OnRequiredDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipAddress' value. + ''' + _ + Public Property ShipAddress() As String + Get + Return Me._shipAddress + End Get + Set + If (String.Equals(Me._shipAddress, value) = false) Then + Me.OnShipAddressChanging(value) + Me.RaiseDataMemberChanging("ShipAddress") + Me.ValidateProperty("ShipAddress", value) + Me._shipAddress = value + Me.RaiseDataMemberChanged("ShipAddress") + Me.OnShipAddressChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipCity' value. + ''' + _ + Public Property ShipCity() As String + Get + Return Me._shipCity + End Get + Set + If (String.Equals(Me._shipCity, value) = false) Then + Me.OnShipCityChanging(value) + Me.RaiseDataMemberChanging("ShipCity") + Me.ValidateProperty("ShipCity", value) + Me._shipCity = value + Me.RaiseDataMemberChanged("ShipCity") + Me.OnShipCityChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipCountry' value. + ''' + _ + Public Property ShipCountry() As String + Get + Return Me._shipCountry + End Get + Set + If (String.Equals(Me._shipCountry, value) = false) Then + Me.OnShipCountryChanging(value) + Me.RaiseDataMemberChanging("ShipCountry") + Me.ValidateProperty("ShipCountry", value) + Me._shipCountry = value + Me.RaiseDataMemberChanged("ShipCountry") + Me.OnShipCountryChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipName' value. + ''' + _ + Public Property ShipName() As String + Get + Return Me._shipName + End Get + Set + If (String.Equals(Me._shipName, value) = false) Then + Me.OnShipNameChanging(value) + Me.RaiseDataMemberChanging("ShipName") + Me.ValidateProperty("ShipName", value) + Me._shipName = value + Me.RaiseDataMemberChanged("ShipName") + Me.OnShipNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShippedDate' value. + ''' + _ + Public Property ShippedDate() As Nullable(Of DateTime) + Get + Return Me._shippedDate + End Get + Set + If (Me._shippedDate.Equals(value) = false) Then + Me.OnShippedDateChanging(value) + Me.RaiseDataMemberChanging("ShippedDate") + Me.ValidateProperty("ShippedDate", value) + Me._shippedDate = value + Me.RaiseDataMemberChanged("ShippedDate") + Me.OnShippedDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipPostalCode' value. + ''' + _ + Public Property ShipPostalCode() As String + Get + Return Me._shipPostalCode + End Get + Set + If (String.Equals(Me._shipPostalCode, value) = false) Then + Me.OnShipPostalCodeChanging(value) + Me.RaiseDataMemberChanging("ShipPostalCode") + Me.ValidateProperty("ShipPostalCode", value) + Me._shipPostalCode = value + Me.RaiseDataMemberChanged("ShipPostalCode") + Me.OnShipPostalCodeChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipRegion' value. + ''' + _ + Public Property ShipRegion() As String + Get + Return Me._shipRegion + End Get + Set + If (String.Equals(Me._shipRegion, value) = false) Then + Me.OnShipRegionChanging(value) + Me.RaiseDataMemberChanging("ShipRegion") + Me.ValidateProperty("ShipRegion", value) + Me._shipRegion = value + Me.RaiseDataMemberChanged("ShipRegion") + Me.OnShipRegionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipVia' value. + ''' + _ + Public Property ShipVia() As Nullable(Of Integer) + Get + Return Me._shipVia + End Get + Set + If (Me._shipVia.Equals(value) = false) Then + Me.OnShipViaChanging(value) + Me.RaiseDataMemberChanging("ShipVia") + Me.ValidateProperty("ShipVia", value) + Me._shipVia = value + Me.RaiseDataMemberChanged("ShipVia") + Me.OnShipViaChanged + End If + End Set + End Property + + Private Function FilterCustomer(ByVal entity As Customer) As Boolean + Return Object.Equals(entity.CustomerID, Me.CustomerID) + End Function + + Private Sub AttachOrder_Details(ByVal entity As Order_Detail) + entity.Order = Me + End Sub + + Private Sub DetachOrder_Details(ByVal entity As Order_Detail) + entity.Order = Nothing + End Sub + + Private Function FilterOrder_Details(ByVal entity As Order_Detail) As Boolean + Return Object.Equals(entity.OrderID, Me.OrderID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._orderID + End Function + End Class + + ''' + ''' The 'Order_Detail' entity class. + ''' + _ + Partial Public NotInheritable Class Order_Detail + Inherits Entity + + Private _discount As Single + + Private _order As EntityRef(Of Order) + + Private _orderID As Integer + + Private _product As EntityRef(Of Product) + + Private _productID As Integer + + Private _quantity As Short + + Private _unitPrice As Decimal + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnDiscountChanging(ByVal value As Single) + End Sub + Private Partial Sub OnDiscountChanged() + End Sub + Private Partial Sub OnOrderIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnOrderIDChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnQuantityChanging(ByVal value As Short) + End Sub + Private Partial Sub OnQuantityChanged() + End Sub + Private Partial Sub OnUnitPriceChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnUnitPriceChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'Discount' value. + ''' + _ + Public Property Discount() As Single + Get + Return Me._discount + End Get + Set + If ((Me._discount = value) _ + = false) Then + Me.OnDiscountChanging(value) + Me.RaiseDataMemberChanging("Discount") + Me.ValidateProperty("Discount", value) + Me._discount = value + Me.RaiseDataMemberChanged("Discount") + Me.OnDiscountChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Order() As Order + Get + If (Me._order Is Nothing) Then + Me._order = New EntityRef(Of Order)(Me, "Order", AddressOf Me.FilterOrder) + End If + Return Me._order.Entity + End Get + Set + Dim previous As Order = Me.Order + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Order", value) + If (Not (previous) Is Nothing) Then + Me._order.Entity = Nothing + previous.Order_Details.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.OrderID = value.OrderID + Else + Me.OrderID = CType(Nothing, Integer) + End If + Me._order.Entity = value + If (Not (value) Is Nothing) Then + value.Order_Details.Add(Me) + End If + Me.RaisePropertyChanged("Order") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderID' value. + ''' + _ + Public Property OrderID() As Integer + Get + Return Me._orderID + End Get + Set + If ((Me._orderID = value) _ + = false) Then + Me.OnOrderIDChanging(value) + Me.RaiseDataMemberChanging("OrderID") + Me.ValidateProperty("OrderID", value) + Me._orderID = value + Me.RaiseDataMemberChanged("OrderID") + Me.OnOrderIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Product() As Product + Get + If (Me._product Is Nothing) Then + Me._product = New EntityRef(Of Product)(Me, "Product", AddressOf Me.FilterProduct) + End If + Return Me._product.Entity + End Get + Set + Dim previous As Product = Me.Product + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Product", value) + If (Not (previous) Is Nothing) Then + Me._product.Entity = Nothing + previous.Order_Details.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.ProductID = value.ProductID + Else + Me.ProductID = CType(Nothing, Integer) + End If + Me._product.Entity = value + If (Not (value) Is Nothing) Then + value.Order_Details.Add(Me) + End If + Me.RaisePropertyChanged("Product") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.RaiseDataMemberChanging("ProductID") + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaiseDataMemberChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Quantity' value. + ''' + _ + Public Property Quantity() As Short + Get + Return Me._quantity + End Get + Set + If ((Me._quantity = value) _ + = false) Then + Me.OnQuantityChanging(value) + Me.RaiseDataMemberChanging("Quantity") + Me.ValidateProperty("Quantity", value) + Me._quantity = value + Me.RaiseDataMemberChanged("Quantity") + Me.OnQuantityChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitPrice' value. + ''' + _ + Public Property UnitPrice() As Decimal + Get + Return Me._unitPrice + End Get + Set + If ((Me._unitPrice = value) _ + = false) Then + Me.OnUnitPriceChanging(value) + Me.RaiseDataMemberChanging("UnitPrice") + Me.ValidateProperty("UnitPrice", value) + Me._unitPrice = value + Me.RaiseDataMemberChanged("UnitPrice") + Me.OnUnitPriceChanged + End If + End Set + End Property + + Private Function FilterOrder(ByVal entity As Order) As Boolean + Return Object.Equals(entity.OrderID, Me.OrderID) + End Function + + Private Function FilterProduct(ByVal entity As Product) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return EntityKey.Create(Me._orderID, Me._productID) + End Function + End Class + + ''' + ''' The 'Product' entity class. + ''' + _ + Partial Public NotInheritable Class Product + Inherits Entity + + Private _category As EntityRef(Of Category) + + Private _categoryID As Nullable(Of Integer) + + Private _categoryName As String + + Private _discontinued As Boolean + + Private _order_Details As EntityCollection(Of Order_Detail) + + Private _productID As Integer + + Private _productName As String + + Private _quantityPerUnit As String + + Private _reorderLevel As Nullable(Of Short) + + Private _resolveMethod As String + + Private _supplierID As Nullable(Of Integer) + + Private _supplierName As String + + Private _unitPrice As Nullable(Of Decimal) + + Private _unitsInStock As Nullable(Of Short) + + Private _unitsOnOrder As Nullable(Of Short) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCategoryIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Private Partial Sub OnCategoryIDChanged() + End Sub + Private Partial Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCategoryNameChanged() + End Sub + Private Partial Sub OnDiscontinuedChanging(ByVal value As Boolean) + End Sub + Private Partial Sub OnDiscontinuedChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnProductNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnProductNameChanged() + End Sub + Private Partial Sub OnQuantityPerUnitChanging(ByVal value As String) + End Sub + Private Partial Sub OnQuantityPerUnitChanged() + End Sub + Private Partial Sub OnReorderLevelChanging(ByVal value As Nullable(Of Short)) + End Sub + Private Partial Sub OnReorderLevelChanged() + End Sub + Private Partial Sub OnResolveMethodChanging(ByVal value As String) + End Sub + Private Partial Sub OnResolveMethodChanged() + End Sub + Private Partial Sub OnSupplierIDChanging(ByVal value As Nullable(Of Integer)) + End Sub + Private Partial Sub OnSupplierIDChanged() + End Sub + Private Partial Sub OnSupplierNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnSupplierNameChanged() + End Sub + Private Partial Sub OnUnitPriceChanging(ByVal value As Nullable(Of Decimal)) + End Sub + Private Partial Sub OnUnitPriceChanged() + End Sub + Private Partial Sub OnUnitsInStockChanging(ByVal value As Nullable(Of Short)) + End Sub + Private Partial Sub OnUnitsInStockChanged() + End Sub + Private Partial Sub OnUnitsOnOrderChanging(ByVal value As Nullable(Of Short)) + End Sub + Private Partial Sub OnUnitsOnOrderChanged() + End Sub + Private Partial Sub OnDiscontinueProductInvoking() + End Sub + Private Partial Sub OnDiscontinueProductInvoked() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Category() As Category + Get + If (Me._category Is Nothing) Then + Me._category = New EntityRef(Of Category)(Me, "Category", AddressOf Me.FilterCategory) + End If + Return Me._category.Entity + End Get + Set + Dim previous As Category = Me.Category + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Category", value) + If (Not (previous) Is Nothing) Then + Me._category.Entity = Nothing + previous.Products.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.CategoryID = value.CategoryID + Else + Me.CategoryID = CType(Nothing, Nullable(Of Integer)) + End If + Me._category.Entity = value + If (Not (value) Is Nothing) Then + value.Products.Add(Me) + End If + Me.RaisePropertyChanged("Category") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryID' value. + ''' + _ + Public Property CategoryID() As Nullable(Of Integer) + Get + Return Me._categoryID + End Get + Set + If (Me._categoryID.Equals(value) = false) Then + Me.OnCategoryIDChanging(value) + Me.RaiseDataMemberChanging("CategoryID") + Me.ValidateProperty("CategoryID", value) + Me._categoryID = value + Me.RaiseDataMemberChanged("CategoryID") + Me.OnCategoryIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + _ + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value + Me.RaisePropertyChanged("CategoryName") + Me.OnCategoryNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Discontinued' value. + ''' + _ + Public Property Discontinued() As Boolean + Get + Return Me._discontinued + End Get + Set + If ((Me._discontinued = value) _ + = false) Then + Me.OnDiscontinuedChanging(value) + Me.RaiseDataMemberChanging("Discontinued") + Me.ValidateProperty("Discontinued", value) + Me._discontinued = value + Me.RaiseDataMemberChanged("Discontinued") + Me.OnDiscontinuedChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) + Get + If (Me._order_Details Is Nothing) Then + Me._order_Details = New EntityCollection(Of Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + End If + Return Me._order_Details + End Get + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaisePropertyChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductName' value. + ''' + _ + Public Property ProductName() As String + Get + Return Me._productName + End Get + Set + If (String.Equals(Me._productName, value) = false) Then + Me.OnProductNameChanging(value) + Me.RaiseDataMemberChanging("ProductName") + Me.ValidateProperty("ProductName", value) + Me._productName = value + Me.RaiseDataMemberChanged("ProductName") + Me.OnProductNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'QuantityPerUnit' value. + ''' + _ + Public Property QuantityPerUnit() As String + Get + Return Me._quantityPerUnit + End Get + Set + If (String.Equals(Me._quantityPerUnit, value) = false) Then + Me.OnQuantityPerUnitChanging(value) + Me.RaiseDataMemberChanging("QuantityPerUnit") + Me.ValidateProperty("QuantityPerUnit", value) + Me._quantityPerUnit = value + Me.RaiseDataMemberChanged("QuantityPerUnit") + Me.OnQuantityPerUnitChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ReorderLevel' value. + ''' + _ + Public Property ReorderLevel() As Nullable(Of Short) + Get + Return Me._reorderLevel + End Get + Set + If (Me._reorderLevel.Equals(value) = false) Then + Me.OnReorderLevelChanging(value) + Me.RaiseDataMemberChanging("ReorderLevel") + Me.ValidateProperty("ReorderLevel", value) + Me._reorderLevel = value + Me.RaiseDataMemberChanged("ReorderLevel") + Me.OnReorderLevelChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ResolveMethod' value. + ''' + _ + Public Property ResolveMethod() As String + Get + Return Me._resolveMethod + End Get + Set + If (String.Equals(Me._resolveMethod, value) = false) Then + Me.OnResolveMethodChanging(value) + Me.RaiseDataMemberChanging("ResolveMethod") + Me.ValidateProperty("ResolveMethod", value) + Me._resolveMethod = value + Me.RaiseDataMemberChanged("ResolveMethod") + Me.OnResolveMethodChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierID' value. + ''' + _ + Public Property SupplierID() As Nullable(Of Integer) + Get + Return Me._supplierID + End Get + Set + If (Me._supplierID.Equals(value) = false) Then + Me.OnSupplierIDChanging(value) + Me.RaiseDataMemberChanging("SupplierID") + Me.ValidateProperty("SupplierID", value) + Me._supplierID = value + Me.RaiseDataMemberChanged("SupplierID") + Me.OnSupplierIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierName' value. + ''' + _ + Public Property SupplierName() As String + Get + Return Me._supplierName + End Get + Set + If (String.Equals(Me._supplierName, value) = false) Then + Me.OnSupplierNameChanging(value) + Me.ValidateProperty("SupplierName", value) + Me._supplierName = value + Me.RaisePropertyChanged("SupplierName") + Me.OnSupplierNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitPrice' value. + ''' + _ + Public Property UnitPrice() As Nullable(Of Decimal) + Get + Return Me._unitPrice + End Get + Set + If (Me._unitPrice.Equals(value) = false) Then + Me.OnUnitPriceChanging(value) + Me.RaiseDataMemberChanging("UnitPrice") + Me.ValidateProperty("UnitPrice", value) + Me._unitPrice = value + Me.RaiseDataMemberChanged("UnitPrice") + Me.OnUnitPriceChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitsInStock' value. + ''' + _ + Public Property UnitsInStock() As Nullable(Of Short) + Get + Return Me._unitsInStock + End Get + Set + If (Me._unitsInStock.Equals(value) = false) Then + Me.OnUnitsInStockChanging(value) + Me.RaiseDataMemberChanging("UnitsInStock") + Me.ValidateProperty("UnitsInStock", value) + Me._unitsInStock = value + Me.RaiseDataMemberChanged("UnitsInStock") + Me.OnUnitsInStockChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitsOnOrder' value. + ''' + _ + Public Property UnitsOnOrder() As Nullable(Of Short) + Get + Return Me._unitsOnOrder + End Get + Set + If (Me._unitsOnOrder.Equals(value) = false) Then + Me.OnUnitsOnOrderChanging(value) + Me.RaiseDataMemberChanging("UnitsOnOrder") + Me.ValidateProperty("UnitsOnOrder", value) + Me._unitsOnOrder = value + Me.RaiseDataMemberChanged("UnitsOnOrder") + Me.OnUnitsOnOrderChanged + End If + End Set + End Property + + ''' + ''' Gets a value indicating whether the 'DiscontinueProduct' action has been invoked on this entity. + ''' + _ + Public ReadOnly Property IsDiscontinueProductInvoked() As Boolean + Get + Return MyBase.IsActionInvoked("DiscontinueProduct") + End Get + End Property + + ''' + ''' Gets a value indicating whether the 'DiscontinueProduct' method can be invoked on this entity. + ''' + _ + Public ReadOnly Property CanDiscontinueProduct() As Boolean + Get + Return MyBase.CanInvokeAction("DiscontinueProduct") + End Get + End Property + + Private Function FilterCategory(ByVal entity As Category) As Boolean + Return Object.Equals(entity.CategoryID, Me.CategoryID) + End Function + + Private Sub AttachOrder_Details(ByVal entity As Order_Detail) + entity.Product = Me + End Sub + + Private Sub DetachOrder_Details(ByVal entity As Order_Detail) + entity.Product = Nothing + End Sub + + Private Function FilterOrder_Details(ByVal entity As Order_Detail) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._productID + End Function + + ''' + ''' Invokes the 'DiscontinueProduct' action on this entity. + ''' + _ + Public Sub DiscontinueProduct() + Me.OnDiscontinueProductInvoking + MyBase.InvokeAction("DiscontinueProduct") + Me.OnDiscontinueProductInvoked + End Sub + End Class + + ''' + ''' The 'ProductInfo' entity class. + ''' + _ + Partial Public NotInheritable Class ProductInfo + Inherits Entity + + Private _categoryName As String + + Private _productID As Integer + + Private _productName As String + + Private _supplierName As String + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCategoryNameChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnProductNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnProductNameChanged() + End Sub + Private Partial Sub OnSupplierNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnSupplierNameChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + _ + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value + Me.RaisePropertyChanged("CategoryName") + Me.OnCategoryNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaisePropertyChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductName' value. + ''' + _ + Public Property ProductName() As String + Get + Return Me._productName + End Get + Set + If (String.Equals(Me._productName, value) = false) Then + Me.OnProductNameChanging(value) + Me.RaiseDataMemberChanging("ProductName") + Me.ValidateProperty("ProductName", value) + Me._productName = value + Me.RaiseDataMemberChanged("ProductName") + Me.OnProductNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierName' value. + ''' + _ + Public Property SupplierName() As String + Get + Return Me._supplierName + End Get + Set + If (String.Equals(Me._supplierName, value) = false) Then + Me.OnSupplierNameChanging(value) + Me.ValidateProperty("SupplierName", value) + Me._supplierName = value + Me.RaisePropertyChanged("SupplierName") + Me.OnSupplierNameChanged + End If + End Set + End Property + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._productID + End Function + End Class + + ''' + ''' The 'Region' entity class. + ''' + _ + Partial Public NotInheritable Class Region + Inherits Entity + + Private _regionDescription As String + + Private _regionID As Integer + + Private _territories As EntityCollection(Of Territory) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnRegionDescriptionChanging(ByVal value As String) + End Sub + Private Partial Sub OnRegionDescriptionChanged() + End Sub + Private Partial Sub OnRegionIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnRegionIDChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'RegionDescription' value. + ''' + _ + Public Property RegionDescription() As String + Get + Return Me._regionDescription + End Get + Set + If (String.Equals(Me._regionDescription, value) = false) Then + Me.OnRegionDescriptionChanging(value) + Me.RaiseDataMemberChanging("RegionDescription") + Me.ValidateProperty("RegionDescription", value) + Me._regionDescription = value + Me.RaiseDataMemberChanged("RegionDescription") + Me.OnRegionDescriptionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RegionID' value. + ''' + _ + Public Property RegionID() As Integer + Get + Return Me._regionID + End Get + Set + If ((Me._regionID = value) _ + = false) Then + Me.OnRegionIDChanging(value) + Me.ValidateProperty("RegionID", value) + Me._regionID = value + Me.RaisePropertyChanged("RegionID") + Me.OnRegionIDChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Territories() As EntityCollection(Of Territory) + Get + If (Me._territories Is Nothing) Then + Me._territories = New EntityCollection(Of Territory)(Me, "Territories", AddressOf Me.FilterTerritories, AddressOf Me.AttachTerritories, AddressOf Me.DetachTerritories) + End If + Return Me._territories + End Get + End Property + + Private Sub AttachTerritories(ByVal entity As Territory) + entity.Region = Me + End Sub + + Private Sub DetachTerritories(ByVal entity As Territory) + entity.Region = Nothing + End Sub + + Private Function FilterTerritories(ByVal entity As Territory) As Boolean + Return Object.Equals(entity.RegionID, Me.RegionID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._regionID + End Function + End Class + + ''' + ''' The 'Territory' entity class. + ''' + _ + Partial Public NotInheritable Class Territory + Inherits Entity + + Private _region As EntityRef(Of Region) + + Private _regionID As Integer + + Private _territoryDescription As String + + Private _territoryID As String + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnRegionIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnRegionIDChanged() + End Sub + Private Partial Sub OnTerritoryDescriptionChanging(ByVal value As String) + End Sub + Private Partial Sub OnTerritoryDescriptionChanged() + End Sub + Private Partial Sub OnTerritoryIDChanging(ByVal value As String) + End Sub + Private Partial Sub OnTerritoryIDChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Region() As Region + Get + If (Me._region Is Nothing) Then + Me._region = New EntityRef(Of Region)(Me, "Region", AddressOf Me.FilterRegion) + End If + Return Me._region.Entity + End Get + Set + Dim previous As Region = Me.Region + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Region", value) + If (Not (previous) Is Nothing) Then + Me._region.Entity = Nothing + previous.Territories.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.RegionID = value.RegionID + Else + Me.RegionID = CType(Nothing, Integer) + End If + Me._region.Entity = value + If (Not (value) Is Nothing) Then + value.Territories.Add(Me) + End If + Me.RaisePropertyChanged("Region") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RegionID' value. + ''' + _ + Public Property RegionID() As Integer + Get + Return Me._regionID + End Get + Set + If ((Me._regionID = value) _ + = false) Then + Me.OnRegionIDChanging(value) + Me.RaiseDataMemberChanging("RegionID") + Me.ValidateProperty("RegionID", value) + Me._regionID = value + Me.RaiseDataMemberChanged("RegionID") + Me.OnRegionIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TerritoryDescription' value. + ''' + _ + Public Property TerritoryDescription() As String + Get + Return Me._territoryDescription + End Get + Set + If (String.Equals(Me._territoryDescription, value) = false) Then + Me.OnTerritoryDescriptionChanging(value) + Me.RaiseDataMemberChanging("TerritoryDescription") + Me.ValidateProperty("TerritoryDescription", value) + Me._territoryDescription = value + Me.RaiseDataMemberChanged("TerritoryDescription") + Me.OnTerritoryDescriptionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TerritoryID' value. + ''' + _ + Public Property TerritoryID() As String + Get + Return Me._territoryID + End Get + Set + If (String.Equals(Me._territoryID, value) = false) Then + Me.OnTerritoryIDChanging(value) + Me.ValidateProperty("TerritoryID", value) + Me._territoryID = value + Me.RaisePropertyChanged("TerritoryID") + Me.OnTerritoryIDChanged + End If + End Set + End Property + + Private Function FilterRegion(ByVal entity As Region) As Boolean + Return Object.Equals(entity.RegionID, Me.RegionID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._territoryID + End Function + End Class +End Namespace + +Namespace TestDomainServices.EFCore + + ''' + ''' The DomainContext corresponding to the 'Northwind' DomainService. + ''' + Partial Public NotInheritable Class Northwind + Inherits DomainContext + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + Me.New(New Uri("TestDomainServices-EFCore-Northwind.svc", UriKind.Relative)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified service URI. + ''' + ''' The Northwind service URI. + Public Sub New(ByVal serviceUri As Uri) + Me.New(DomainContext.CreateDomainClient(GetType(INorthwindContract), serviceUri, false)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified . + ''' + ''' The DomainClient instance to use for this DomainContext. + Public Sub New(ByVal domainClient As DomainClient) + MyBase.New(domainClient) + Me.OnCreated + End Sub + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Categories() As EntitySet(Of Category) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Category) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Customers() As EntitySet(Of Customer) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Customer) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Order_Details() As EntitySet(Of Order_Detail) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Order_Detail) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Orders() As EntitySet(Of Order) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Order) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Products() As EntitySet(Of Product) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Product) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property ProductInfos() As EntitySet(Of ProductInfo) + Get + Return MyBase.EntityContainer.GetEntitySet(Of ProductInfo) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Regions() As EntitySet(Of Region) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Region) + End Get + End Property + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetCategoriesQuery() As EntityQuery(Of Category) + Me.ValidateMethod("GetCategoriesQuery", Nothing) + Return MyBase.CreateQuery(Of Category)("GetCategories", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetCustomersQuery() As EntityQuery(Of Customer) + Me.ValidateMethod("GetCustomersQuery", Nothing) + Return MyBase.CreateQuery(Of Customer)("GetCustomers", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetOrderDetailsQuery() As EntityQuery(Of Order_Detail) + Me.ValidateMethod("GetOrderDetailsQuery", Nothing) + Return MyBase.CreateQuery(Of Order_Detail)("GetOrderDetails", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetOrdersQuery() As EntityQuery(Of Order) + Me.ValidateMethod("GetOrdersQuery", Nothing) + Return MyBase.CreateQuery(Of Order)("GetOrders", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductById' query. + ''' + ''' The value for the 'id' parameter of the query. + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductByIdQuery(ByVal id As Integer) As EntityQuery(Of Product) + Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() + parameters.Add("id", id) + Me.ValidateMethod("GetProductByIdQuery", parameters) + Return MyBase.CreateQuery(Of Product)("GetProductById", parameters, false, false) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductInfosQuery() As EntityQuery(Of ProductInfo) + Me.ValidateMethod("GetProductInfosQuery", Nothing) + Return MyBase.CreateQuery(Of ProductInfo)("GetProductInfos", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductsQuery() As EntityQuery(Of Product) + Me.ValidateMethod("GetProductsQuery", Nothing) + Return MyBase.CreateQuery(Of Product)("GetProducts", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegionById' query. + ''' + ''' The value for the 'id' parameter of the query. + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetRegionByIdQuery(ByVal id As Integer) As EntityQuery(Of Region) + Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() + parameters.Add("id", id) + Me.ValidateMethod("GetRegionByIdQuery", parameters) + Return MyBase.CreateQuery(Of Region)("GetRegionById", parameters, false, false) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetRegionsQuery() As EntityQuery(Of Region) + Me.ValidateMethod("GetRegionsQuery", Nothing) + Return MyBase.CreateQuery(Of Region)("GetRegions", Nothing, false, true) + End Function + + ''' + ''' Invokes the 'DiscontinueProduct' method of the specified entity. + ''' + ''' The entity instance. + Public Sub DiscontinueProduct(ByVal product As Product) + product.DiscontinueProduct + End Sub + + ''' + ''' Creates a new EntityContainer for this DomainContext's EntitySets. + ''' + ''' A new container instance. + Protected Overrides Function CreateEntityContainer() As EntityContainer + Return New NorthwindEntityContainer() + End Function + + ''' + ''' Service contract for the 'Northwind' DomainService. + ''' + _ + Public Interface INorthwindContract + + ''' + ''' Asynchronously invokes the 'GetCategories' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetCategories(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetCategories'. + ''' + ''' The IAsyncResult returned from 'BeginGetCategories'. + ''' The 'QueryResult' returned from the 'GetCategories' operation. + Function EndGetCategories(ByVal result As IAsyncResult) As QueryResult(Of Category) + + ''' + ''' Asynchronously invokes the 'GetCustomers' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetCustomers(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetCustomers'. + ''' + ''' The IAsyncResult returned from 'BeginGetCustomers'. + ''' The 'QueryResult' returned from the 'GetCustomers' operation. + Function EndGetCustomers(ByVal result As IAsyncResult) As QueryResult(Of Customer) + + ''' + ''' Asynchronously invokes the 'GetOrderDetails' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetOrderDetails(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetOrderDetails'. + ''' + ''' The IAsyncResult returned from 'BeginGetOrderDetails'. + ''' The 'QueryResult' returned from the 'GetOrderDetails' operation. + Function EndGetOrderDetails(ByVal result As IAsyncResult) As QueryResult(Of Order_Detail) + + ''' + ''' Asynchronously invokes the 'GetOrders' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetOrders(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetOrders'. + ''' + ''' The IAsyncResult returned from 'BeginGetOrders'. + ''' The 'QueryResult' returned from the 'GetOrders' operation. + Function EndGetOrders(ByVal result As IAsyncResult) As QueryResult(Of Order) + + ''' + ''' Asynchronously invokes the 'GetProductById' operation. + ''' + ''' The value for the 'id' parameter of this action. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProductById(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductById'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductById'. + ''' The 'QueryResult' returned from the 'GetProductById' operation. + Function EndGetProductById(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetProductInfos' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProductInfos(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductInfos'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductInfos'. + ''' The 'QueryResult' returned from the 'GetProductInfos' operation. + Function EndGetProductInfos(ByVal result As IAsyncResult) As QueryResult(Of ProductInfo) + + ''' + ''' Asynchronously invokes the 'GetProducts' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProducts(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProducts'. + ''' + ''' The IAsyncResult returned from 'BeginGetProducts'. + ''' The 'QueryResult' returned from the 'GetProducts' operation. + Function EndGetProducts(ByVal result As IAsyncResult) As QueryResult(Of Product) + + ''' + ''' Asynchronously invokes the 'GetRegionById' operation. + ''' + ''' The value for the 'id' parameter of this action. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetRegionById(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetRegionById'. + ''' + ''' The IAsyncResult returned from 'BeginGetRegionById'. + ''' The 'QueryResult' returned from the 'GetRegionById' operation. + Function EndGetRegionById(ByVal result As IAsyncResult) As QueryResult(Of Region) + + ''' + ''' Asynchronously invokes the 'GetRegions' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetRegions(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetRegions'. + ''' + ''' The IAsyncResult returned from 'BeginGetRegions'. + ''' The 'QueryResult' returned from the 'GetRegions' operation. + Function EndGetRegions(ByVal result As IAsyncResult) As QueryResult(Of Region) + + ''' + ''' Asynchronously invokes the 'SubmitChanges' operation. + ''' + ''' The change-set to submit. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginSubmitChanges(ByVal changeSet As IEnumerable(Of ChangeSetEntry), ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginSubmitChanges'. + ''' + ''' The IAsyncResult returned from 'BeginSubmitChanges'. + ''' The collection of change-set entry elements returned from 'SubmitChanges'. + Function EndSubmitChanges(ByVal result As IAsyncResult) As IEnumerable(Of ChangeSetEntry) + End Interface + + Friend NotInheritable Class NorthwindEntityContainer + Inherits EntityContainer + + Public Sub New() + MyBase.New + Me.CreateEntitySet(Of Category)(EntitySetOperations.All) + Me.CreateEntitySet(Of Customer)(EntitySetOperations.All) + Me.CreateEntitySet(Of Order)(EntitySetOperations.All) + Me.CreateEntitySet(Of Order_Detail)(EntitySetOperations.All) + Me.CreateEntitySet(Of Product)(EntitySetOperations.All) + Me.CreateEntitySet(Of ProductInfo)(EntitySetOperations.Edit) + Me.CreateEntitySet(Of Region)(EntitySetOperations.All) + Me.CreateEntitySet(Of Territory)(EntitySetOperations.All) + End Sub + End Class + End Class +End Namespace diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index 3645bbbc1..a674751ce 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -38,6 +38,9 @@ Always + + Always + PreserveNewest @@ -594,8 +597,14 @@ + + + + Always + + TextTemplatingFileGenerator From 402f80ab304b45d4a1bad626fe6207f700d554c3 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Fri, 1 Apr 2022 09:11:26 +0200 Subject: [PATCH 56/99] Delete BackupDB.ps1 --- BackupDB.ps1 | 125 --------------------------------------------------- 1 file changed, 125 deletions(-) delete mode 100644 BackupDB.ps1 diff --git a/BackupDB.ps1 b/BackupDB.ps1 deleted file mode 100644 index 9868473f7..000000000 --- a/BackupDB.ps1 +++ /dev/null @@ -1,125 +0,0 @@ - -param($RepositoryRoot = "$PSScriptRoot", $SqlServer = "(localdb)\MSSQLLocalDB", [switch]$UseSqlCmd = $false) - -$DatabaseFolder = join-path $RepositoryRoot "src/Test/Databases" - -# Verify SqlServer or SQLPS module is installed -if (-not $UseSqlCmd) -{ - if ((-not (Get-Module SqlServer -ListAvailable)) -and (-not (Get-Module SQLPS))) - { - # This will install the nuget provider if not already installed - Get-PackageProvider -Name NuGet -Force - # Install-PackageProvider -Name NuGet -Force -Scope CurrentUser - # Installs SQL Module - Install-Module -Name SqlServer -AllowClobber -Force -Scope CurrentUser - } - - # Check if module is loaded and if not import it - if ((Get-Module SqlServer -ListAvailable) -and (-not (Get-Module SqlServer))) { - Import-Module SqlServer - } - elseif ((Get-Module SQLPS -ListAvailable) -and (-not (Get-Module SQLPS))) { - Import-Module SQLPS - } -} - -function Execute-SQL([string]$sql) -{ - if ($UseSqlCmd) - { - & sqlcmd -S $SqlServer -Q $sql - } - else - { - Invoke-Sqlcmd -ServerInstance $SqlServer -Query $sql - } -} - -# Remove old databases if any -function Remove-Database([string]$databaseName) -{ - $SqlCommand = -@" -USE master -GO -if exists (select * from sysdatabases where name='$databaseName') - drop database $databaseName -GO -"@; - Execute-SQL $SqlCommand -} - -function CreateDatabaseFromBackup([string]$databaseName, [string]$LogicalNameMDF, [string]$LogicalNameLDF) -{ - $DatabaseFileWithoutExt = join-path $DatabaseFolder $databaseName - - $BackupFile = $DatabaseFileWithoutExt + ".bak" - $DataFile = $DatabaseFileWithoutExt + ".mdf" - $LogFile = $DatabaseFileWithoutExt + ".ldf" - - - echo "Restoring a new backup of '$databaseName' from '$BackupFile' to '$DataFile'" - - Remove-Database $databaseName - - $SqlCommand = -@" -RESTORE DATABASE $databaseName -FROM DISK = '$BackupFile' -WITH MOVE '$($LogicalNameMDF)' TO '$DataFile', -MOVE '$($LogicalNameLDF)' TO '$LogFile' -GO - -DBCC SHRINKDATABASE('$databaseName'); -GO - -ALTER DATABASE [$databaseName] SET READ_ONLY; -go -"@; - Execute-SQL $SqlCommand -} - -function Take-Offline([string]$databaseName) -{ -$SqlCommand = -@" -Alter database [$databaseName] set single_user with ROLLBACK IMMEDIATE; -go -alter database [$databaseName] set offline; -"@; - Execute-SQL $SqlCommand -} - -function Take-Online([string]$databaseName) -{ -$SqlCommand = -@" -alter database [$databaseName] set online; -go -Alter database [$databaseName] set multi_user; -"@; - Execute-SQL $SqlCommand -} - -CreateDatabaseFromBackup "Northwind" "Northwind" "Northwind_log" -CreateDatabaseFromBackup "AdventureWorks" "AdventureWorks_Data" "AdventureWorks_Log" - -# Take northwind offline and copy to templates folder -echo "Copying northwind database to websites" - -Take-Offline "Northwind" -$mdf = (join-path $DatabaseFolder Northwind.mdf) -$ldf = (join-path $DatabaseFolder Northwind.ldf) -foreach($website in "src\Test\WebsiteFullTrust") -{ - $templateDir = Join-Path $RepositoryRoot "$website\App_Data\Templates\" - if (-not (Test-Path $templateDir)) - { - mkdir $templateDir -Force > $null - echo "Created $templateDir" - } - copy $mdf $templateDir -Force - copy $ldf $templateDir -Force -} -Take-Online "Northwind" From a83d467d91659f661bb7c251d3502fc9598fb432 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Fri, 1 Apr 2022 22:52:54 +0200 Subject: [PATCH 57/99] allow passing in dbcontext in ctor --- .../Framework/DbDomainService.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs index 9f302f28d..ca1c6e0de 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs @@ -41,6 +41,16 @@ protected DbDomainService() { } + + /// + /// Initialize the domainservice with a specific context. + /// + /// initial value for + protected DbDomainService(TContext dbContext) + { + _dbContext = dbContext; + } + /// /// Initializes the . must be called /// prior to invoking any operations on the instance. From 6a75bf4fb64c1c449c102d6aa45d9dd3e9eaa703 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 4 Apr 2022 08:35:41 +0200 Subject: [PATCH 58/99] Move property descriptors outside the loop --- .../Framework/DbDomainService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs index ca1c6e0de..8e547731d 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs @@ -267,6 +267,8 @@ private async Task SetChangeSetConflictsAsync(Dictionary Date: Mon, 4 Apr 2022 10:55:16 +0200 Subject: [PATCH 59/99] Remove reference --- .../Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj b/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj index 8603062d2..2c835edec 100644 --- a/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj +++ b/src/OpenRiaServices.Hosting.Wcf.OData/Test/OpenRiaServices.Hosting.Wcf.OData.Test.csproj @@ -35,7 +35,6 @@ - From ddd4f5108670787c1ab4cc03fa6eb0b79e217c92 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 4 Apr 2022 10:57:31 +0200 Subject: [PATCH 60/99] Remove unused methods. --- .../Framework/EFCoreTypeDescriptionContext.cs | 74 ------------------- 1 file changed, 74 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs index 96fd4881c..e739c3fd2 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs @@ -47,43 +47,6 @@ public IModel Model public IEntityType GetEntityType(Type type) => Model.FindEntityType(type); - ///// - ///// Returns the association information for the specified navigation property. - ///// - ///// The navigation property to return association information for - ///// The association info - //internal AssociationInfo GetAssociationInfo(NavigationProperty navigationProperty) - //{ - // lock (this._associationMap) - // { - // string associationName = navigationProperty.RelationshipType.FullName; - // AssociationInfo associationInfo = null; - // if (!this._associationMap.TryGetValue(associationName, out associationInfo)) - // { - // AssociationType associationType = (AssociationType)navigationProperty.RelationshipType; - - // if (!associationType.ReferentialConstraints.Any()) - // { - // // We only support EF models where FK info is part of the model. - // throw new NotSupportedException( - // string.Format(CultureInfo.CurrentCulture, - // ResourceEFCore.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); - // } - - // associationInfo = new AssociationInfo(); - // associationInfo.FKRole = associationType.ReferentialConstraints[0].ToRole.Name; - // associationInfo.Name = this.GetAssociationName(navigationProperty, associationInfo.FKRole); - // associationInfo.ThisKey = associationType.ReferentialConstraints[0].ToProperties.Select(p => p.Name).ToArray(); - // associationInfo.OtherKey = associationType.ReferentialConstraints[0].FromProperties.Select(p => p.Name).ToArray(); - // associationInfo.IsRequired = associationType.RelationshipEndMembers[0].RelationshipMultiplicity == RelationshipMultiplicity.One; - - // this._associationMap[associationName] = associationInfo; - // } - - // return associationInfo; - // } - //} - /// /// Creates an AssociationAttribute for the specified navigation property /// @@ -93,13 +56,6 @@ internal AssociationAttribute CreateAssociationAttribute(INavigation navigationP { var fk = navigationProperty.ForeignKey; - - //// // We only support EF models where FK info is part of the model. - //if (fk is null) - // throw new NotSupportedException( - // string.Format(CultureInfo.CurrentCulture, - // ResourceEFCore.LinqToEntitiesProvider_UnableToRetrieveAssociationInfo, associationName)); - string thisKey; string otherKey; if (navigationProperty.IsDependentToPrincipal()) @@ -119,35 +75,5 @@ internal AssociationAttribute CreateAssociationAttribute(INavigation navigationP assocAttrib.IsForeignKey = navigationProperty.IsDependentToPrincipal(); // TODO: isForeignKey; return assocAttrib; } - - /// - /// Returns a unique association name for the specified navigation property. - /// - /// The navigation property - /// The foreign key role name for the property's association - /// A unique association name for the specified navigation property. - /* - private string GetAssociationName(NavigationProperty navigationProperty, string foreignKeyRoleName) - { - RelationshipEndMember fromMember = navigationProperty.FromEndMember; - RelationshipEndMember toMember = navigationProperty.ToEndMember; - - RefType toRefType = toMember.TypeUsage.EdmType as RefType; - EntityType toEntityType = toRefType.ElementType as EntityType; - - RefType fromRefType = fromMember.TypeUsage.EdmType as RefType; - EntityType fromEntityType = fromRefType.ElementType as EntityType; - - bool isForeignKey = navigationProperty.FromEndMember.Name == foreignKeyRoleName; - string fromTypeName = isForeignKey ? fromEntityType.Name : toEntityType.Name; - string toTypeName = isForeignKey ? toEntityType.Name : fromEntityType.Name; - - // names are always formatted non-FK side type name followed by FK side type name - string associationName = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", toTypeName, fromTypeName); - associationName = MakeUniqueName(associationName, this._associationMap.Values.Select(p => p.Name)); - - return associationName; - } - */ } } From a8145ee7309800c8510ecc1b066e90a6f60783bb Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 4 Apr 2022 11:18:49 +0200 Subject: [PATCH 61/99] Removed metadataResource --- .../Framework/MetadataResource.Designer.cs | 72 ---------- .../Framework/MetadataResource.resx | 123 ------------------ ...Services.Server.EntityFrameworkCore.csproj | 10 -- 3 files changed, 205 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs deleted file mode 100644 index e9ea4873d..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace System.Data.Mapping { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class MetadataResource { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal MetadataResource() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.Server.EntityFrameworkCore.MetadataResource", typeof(MetadataResource).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Unable to find metadata for '{0}'.. - /// - internal static string LinqToEntitiesProvider_UnableToRetrieveMetadata { - get { - return ResourceManager.GetString("LinqToEntitiesProvider_UnableToRetrieveMetadata", resourceCulture); - } - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx deleted file mode 100644 index 3aae8f7cf..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/MetadataResource.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Unable to find metadata for '{0}'. - - \ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 4ad0cc6e7..3cba70428 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -20,11 +20,6 @@ True DbResource.resx - - MetadataResource.resx - True - True - ResourceEFCore.resx True @@ -40,11 +35,6 @@ DbResource.Designer.cs Designer - - ResXFileCodeGenerator - MetadataResource.Designer.cs - System.Data.Mapping - ResXFileCodeGenerator ResourceEFCore.Designer.cs From f7fa5228a32116ed56581cf2b07cf17e47e5ce73 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 4 Apr 2022 13:21:12 +0200 Subject: [PATCH 62/99] Remove unused properties. --- .../Framework/EFCoreTypeDescriptionContext.cs | 21 +++++++- .../Framework/TypeDescriptionContextBase.cs | 51 ------------------- .../AdventureWorks/AdventureworksContext.cs | 1 - .../Test/DomainServiceDescriptionTest.cs | 6 --- .../Test/OpenRiaServices.Server.Test.csproj | 7 --- 5 files changed, 20 insertions(+), 66 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs index e739c3fd2..a1febea41 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs @@ -12,7 +12,7 @@ namespace OpenRiaServices.Server.EntityFrameworkCore /// /// Metadata context for LINQ To Entities domain services /// - internal class EFCoreTypeDescriptionContext : TypeDescriptionContextBase + internal class EFCoreTypeDescriptionContext { // private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; @@ -75,5 +75,24 @@ internal AssociationAttribute CreateAssociationAttribute(INavigation navigationP assocAttrib.IsForeignKey = navigationProperty.IsDependentToPrincipal(); // TODO: isForeignKey; return assocAttrib; } + + /// + /// Comma delimits the specified member name collection + /// + /// A collection of members. + /// A comma delimited list of member names. + protected static string FormatMemberList(IEnumerable members) + { + string memberList = string.Empty; + foreach (var prop in members) + { + if (memberList.Length > 0) + { + memberList += ","; + } + memberList += prop.Name; + } + return memberList; + } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs deleted file mode 100644 index f1e1b48a9..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/TypeDescriptionContextBase.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using Microsoft.EntityFrameworkCore.Metadata; - -namespace OpenRiaServices.Server -{ - /// - /// Base class for LTS and EF type description contexts - /// - internal abstract class TypeDescriptionContextBase - { - /// - /// Given a suggested name and a collection of existing names, this method - /// creates a unique name by appending a numerix suffix as required. - /// - /// The desired name - /// Collection of existing names - /// The unique name - protected static string MakeUniqueName(string suggested, IEnumerable existing) - { - int i = 1; - string currSuggestion = suggested; - while (existing.Contains(currSuggestion)) - { - currSuggestion = suggested + (i++).ToString(CultureInfo.InvariantCulture); - } - - return currSuggestion; - } - - /// - /// Comma delimits the specified member name collection - /// - /// A collection of members. - /// A comma delimited list of member names. - protected static string FormatMemberList(IEnumerable members) - { - string memberList = string.Empty; - foreach (var prop in members) - { - if (memberList.Length > 0) - { - memberList += ","; - } - memberList += prop.Name; - } - return memberList; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs index 2e2d943c6..8f8e52e38 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/AdventureWorks/AdventureworksContext.cs @@ -97,7 +97,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(e => e.Employee) .WithOne(e => e.SalesPerson) .HasForeignKey(e => e.SalesPersonID) -// .HasPrincipalKey(e => e.EmployeeID) .IsRequired(); entity.HasOne(e => e.SalesTerritory) diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 846913d37..1127fffea 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -34,7 +34,6 @@ namespace OpenRiaServices.Server.Test using OpenRiaServices.Server.EntityFrameworkCore; using MetaType = SystemWebDomainServices::OpenRiaServices.Server.MetaType; - // TODO Begin here to make it work with the new /// /// DomainServiceDescription tests /// @@ -358,10 +357,8 @@ public void EFTypeDescriptor_ExcludedEntityMembers() [TestMethod] public void EFCoreTypeDescriptor_ExcludedEntityMembers() { - // TODO: Not applicable to EF CORE so might be removed PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(EFCorePocoEntity_IEntityChangeTracker))["EntityState"]; Assert.IsTrue(EFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); - } /// @@ -396,13 +393,10 @@ public void DomainServiceDescription_EFPOCO() [TestMethod] public void DomainServiceDescription_EFCoreTestFindEntityType() { - // TODO: Use code such as this to - // First create a context manually and verify that POCO metadata is configured correctly var ctxt = new EFCoreModels.Northwind.EFCoreDbCtxNorthwindEntities(); IEntityType entityType = ctxt.Model.FindEntityType(typeof(EFCoreModels.Northwind.Product).FullName); Assert.IsNotNull(entityType); - } diff --git a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj index 7b44cd496..8851f41d1 100644 --- a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj +++ b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj @@ -9,13 +9,7 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - - - runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -24,7 +18,6 @@ - From 5b31dddfcc174e87cd6312f056cd0da9e96d54f0 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 4 Apr 2022 13:24:02 +0200 Subject: [PATCH 63/99] Removed unused folder --- src/Test/Desktop/EFCodePOCOModels/App.Config | 23 --- .../EFCodePOCOModels/EFCodePOCOModels.csproj | 4 - .../EFCodePOCOModels/EFCorePOCOModels.csproj | 19 --- .../Desktop/EFCodePOCOModels/Northwind.edmx | 158 ------------------ .../Desktop/EFCodePOCOModels/NorthwindPOCO.cs | 64 ------- .../Properties/AssemblyInfo.cs | 39 ----- 6 files changed, 307 deletions(-) delete mode 100644 src/Test/Desktop/EFCodePOCOModels/App.Config delete mode 100644 src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj delete mode 100644 src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj delete mode 100644 src/Test/Desktop/EFCodePOCOModels/Northwind.edmx delete mode 100644 src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs delete mode 100644 src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs diff --git a/src/Test/Desktop/EFCodePOCOModels/App.Config b/src/Test/Desktop/EFCodePOCOModels/App.Config deleted file mode 100644 index ee18356c5..000000000 --- a/src/Test/Desktop/EFCodePOCOModels/App.Config +++ /dev/null @@ -1,23 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj b/src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj deleted file mode 100644 index 88a550947..000000000 --- a/src/Test/Desktop/EFCodePOCOModels/EFCodePOCOModels.csproj +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj b/src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj deleted file mode 100644 index 6e9a7e177..000000000 --- a/src/Test/Desktop/EFCodePOCOModels/EFCorePOCOModels.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - false - net472 - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/Northwind.edmx b/src/Test/Desktop/EFCodePOCOModels/Northwind.edmx deleted file mode 100644 index b199645d9..000000000 --- a/src/Test/Desktop/EFCodePOCOModels/Northwind.edmx +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs b/src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs deleted file mode 100644 index dd34f723e..000000000 --- a/src/Test/Desktop/EFCodePOCOModels/NorthwindPOCO.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.SqlServer; -using System.Runtime.Serialization; -using System; - -// These assembly attributes allow us to serialize different CLR types into the same contract -[assembly: ContractNamespace("http://schemas.datacontract.org/2004/07/DataTests.Northwind", - ClrNamespace = "NorthwindEFCorePOCOModel")] -namespace NorthwindEFCorePOCOModel -{ - /// - /// Hand crafted POCO ObjectContext. These entity types are matched to the edmx metadata - /// by convention - the names and members must match up. - /// - public class NorthwindEntities : DbContext - { - public const string ConnectionStringName = "NorthwindEFCorePOCOEntities"; - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder.UseSqlServer(ConnectionStringName); - base.OnConfiguring(optionsBuilder); - } - - public List Products { get; set; } = new List(); - } - - public class Category - { - private List _products = new List(); - - public int CategoryID { get; set; } - public string CategoryName { get; set; } - public string Description { get; set; } - public byte[] Picture { get; set; } - public List Products - { - get - { - return this._products; - } - set - { - this._products = value; - } - } - } - - public class Product - { - public int ProductID { get; set; } - public string ProductName { get; set; } - public Nullable SupplierID { get; set; } - public string QuantityPerUnit { get; set; } - public Nullable UnitPrice { get; set; } - public Nullable UnitsInStock { get; set; } - public Nullable UnitsOnOrder { get; set; } - public Nullable ReorderLevel { get; set; } - public bool Discontinued { get; set; } - public Nullable CategoryID { get; set; } - public Category Category { get; set; } - } -} diff --git a/src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs b/src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs deleted file mode 100644 index 122fc1101..000000000 --- a/src/Test/Desktop/EFCodePOCOModels/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EFPOCOModels")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Outercurve Foundation")] -[assembly: AssemblyProduct("EFPOCOModels")] -[assembly: AssemblyCopyright("© Outercurve Foundation. All rights reserved.")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("054e4462-88a4-4eba-8266-45e6fd9686a2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -// TODO: review -- v4.0 security model assumes transparent, making unit tests fail to build if this is set -// [assembly: AllowPartiallyTrustedCallers] \ No newline at end of file From ac48eea8fc394246861bbac4a6ffc0ea2f8211ea Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 6 Apr 2022 07:18:18 +0200 Subject: [PATCH 64/99] Use on file --- ...mainServiceDescriptionProviderAttribute.cs | 38 +++++-- .../OpenRiaServices.EntityFramework.csproj | 4 + .../Framework/Resource.Designer.cs | 16 +-- ...mainServiceDescriptionProviderAttribute.cs | 99 ------------------- ...Services.Server.EntityFrameworkCore.csproj | 9 +- ...FCore.Designer.cs => Resource.Designer.cs} | 6 +- .../{ResourceEFCore.resx => Resource.resx} | 0 7 files changed, 49 insertions(+), 123 deletions(-) delete mode 100644 src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{ResourceEFCore.Designer.cs => Resource.Designer.cs} (96%) rename src/OpenRiaServices.Server.EntityFrameworkCore/Framework/{ResourceEFCore.resx => Resource.resx} (100%) diff --git a/src/OpenRiaServices.EntityFramework/Framework/DbDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.EntityFramework/Framework/DbDomainServiceDescriptionProviderAttribute.cs index 288bfb6d2..5e8b4563c 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/DbDomainServiceDescriptionProviderAttribute.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/DbDomainServiceDescriptionProviderAttribute.cs @@ -1,10 +1,19 @@ -using System; +#if EFCORE +using System; +using System.ComponentModel; +using Microsoft.EntityFrameworkCore; +using System.Globalization; + +namespace OpenRiaServices.Server.EntityFrameworkCore +#else +using System; using System.ComponentModel; using System.Data.Entity; using System.Globalization; using OpenRiaServices.Server; namespace OpenRiaServices.EntityFramework +#endif { /// /// Attribute applied to a that exposes LINQ to Entities mapped @@ -21,7 +30,11 @@ public sealed class DbDomainServiceDescriptionProviderAttribute : DomainServiceD /// attribute is applied to. /// public DbDomainServiceDescriptionProviderAttribute() +#if EFCORE + : base(typeof(EFCoreDescriptionProvider)) +#else : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) +#endif { } @@ -31,9 +44,13 @@ public DbDomainServiceDescriptionProviderAttribute() ///
/// The LINQ To Entities ObjectContext Type. public DbDomainServiceDescriptionProviderAttribute(Type dbContextType) +#if EFCORE + : base(typeof(EFCoreDescriptionProvider)) +#else : base(typeof(LinqToEntitiesDomainServiceDescriptionProvider)) +#endif { - this._dbContextType = dbContextType; + _dbContextType = dbContextType; } /// @@ -43,7 +60,7 @@ public Type DbContextType { get { - return this._dbContextType; + return _dbContextType; } } @@ -60,19 +77,22 @@ public override DomainServiceDescriptionProvider CreateProvider(Type domainServi throw new ArgumentNullException(nameof(domainServiceType)); } - if (this._dbContextType == null) + if (_dbContextType == null) { - this._dbContextType = GetContextType(domainServiceType); + _dbContextType = GetContextType(domainServiceType); } - if (!typeof(DbContext).IsAssignableFrom(this._dbContextType)) + if (!typeof(DbContext).IsAssignableFrom(_dbContextType)) { throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, DbResource.InvalidDbDomainServiceDescriptionProviderSpecification, - this._dbContextType)); + _dbContextType)); } - - return new LinqToEntitiesDomainServiceDescriptionProvider(domainServiceType, this._dbContextType, parent); +#if EFCORE + return new EFCoreDescriptionProvider(domainServiceType, _dbContextType, parent); +#else + return new LinqToEntitiesDomainServiceDescriptionProvider(domainServiceType, _dbContextType, parent); +#endif } /// diff --git a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj index 67279cef4..b58d9bfa4 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj +++ b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj @@ -43,5 +43,9 @@ MetadataResource.Designer.cs System.Data.Mapping + + PublicResXFileCodeGenerator + Resource.Designer.cs + \ No newline at end of file diff --git a/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs b/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs index 59c36df61..0fcd31f76 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs @@ -19,10 +19,10 @@ namespace OpenRiaServices.EntityFramework { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resource { + public class Resource { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ internal Resource() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { + public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.Resource", typeof(Resource).Assembly); @@ -51,7 +51,7 @@ internal Resource() { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { + public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Resource() { /// /// Looks up a localized string similar to DatabaseGeneratedOption value '{0}' is not defined.. /// - internal static string DatabaseGeneratedOptionNotDefined { + public static string DatabaseGeneratedOptionNotDefined { get { return ResourceManager.GetString("DatabaseGeneratedOptionNotDefined", resourceCulture); } @@ -72,7 +72,7 @@ internal static string DatabaseGeneratedOptionNotDefined { /// /// Looks up a localized string similar to Type '{0}' is not a valid LinqToEntitiesDomainServiceDescriptionProviderAttribute parameter because it does not derive from ObjectContext.. /// - internal static string InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification { + public static string InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification { get { return ResourceManager.GetString("InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification", resourceCulture); } @@ -81,7 +81,7 @@ internal static string InvalidLinqToEntitiesDomainServiceDescriptionProviderSpec /// /// Looks up a localized string similar to '{0}' cannot be applied to DomainService Type '{1}' because '{1}' does not derive from '{2}'.. /// - internal static string InvalidMetadataProviderSpecification { + public static string InvalidMetadataProviderSpecification { get { return ResourceManager.GetString("InvalidMetadataProviderSpecification", resourceCulture); } @@ -90,7 +90,7 @@ internal static string InvalidMetadataProviderSpecification { /// /// Looks up a localized string similar to Unable to retrieve association information for association '{0}'. Only models that include foreign key information are supported. See Entity Framework documentation for details on creating models that include foreign key information.. /// - internal static string LinqToEntitiesProvider_UnableToRetrieveAssociationInfo { + public static string LinqToEntitiesProvider_UnableToRetrieveAssociationInfo { get { return ResourceManager.GetString("LinqToEntitiesProvider_UnableToRetrieveAssociationInfo", resourceCulture); } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs deleted file mode 100644 index e7254336a..000000000 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/DbDomainServiceDescriptionProviderAttribute.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.ComponentModel; -using Microsoft.EntityFrameworkCore; -using System.Globalization; - -namespace OpenRiaServices.Server.EntityFrameworkCore -{ - /// - /// Attribute applied to a that exposes LINQ to Entities mapped - /// Types. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] - public sealed class DbDomainServiceDescriptionProviderAttribute : DomainServiceDescriptionProviderAttribute - { - private Type _dbContextType; - - /// - /// Default constructor. Using this constructor, the Type of the LINQ To Entities - /// DbContext will be inferred from the the - /// attribute is applied to. - /// - public DbDomainServiceDescriptionProviderAttribute() - : base(typeof(EFCoreDescriptionProvider)) - { - } - - /// - /// Constructs an attribute for the specified LINQ To Entities - /// DbContext Type. - /// - /// The LINQ To Entities ObjectContext Type. - public DbDomainServiceDescriptionProviderAttribute(Type dbContextType) - : base(typeof(EFCoreDescriptionProvider)) - { - _dbContextType = dbContextType; - } - - /// - /// The Linq To Entities DbContext Type. - /// - public Type DbContextType - { - get - { - return _dbContextType; - } - } - - /// - /// This method creates an instance of the . - /// - /// The Type to create a description provider for. - /// The existing parent description provider. - /// The description provider. - public override DomainServiceDescriptionProvider CreateProvider(Type domainServiceType, DomainServiceDescriptionProvider parent) - { - if (domainServiceType == null) - { - throw new ArgumentNullException(nameof(domainServiceType)); - } - - if (_dbContextType == null) - { - _dbContextType = GetContextType(domainServiceType); - } - - if (!typeof(DbContext).IsAssignableFrom(_dbContextType)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, - DbResource.InvalidDbDomainServiceDescriptionProviderSpecification, - _dbContextType)); - } - - return new EFCoreDescriptionProvider(domainServiceType, _dbContextType, parent); - } - - /// - /// Extracts the context type from the specified . - /// - /// A LINQ to Entities domain service type. - /// The type of the object context. - private static Type GetContextType(Type domainServiceType) - { - Type efDomainServiceType = domainServiceType.BaseType; - while (!efDomainServiceType.IsGenericType || efDomainServiceType.GetGenericTypeDefinition() != typeof(DbDomainService<>)) - { - if (efDomainServiceType == typeof(object)) - { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, - ResourceEFCore.InvalidMetadataProviderSpecification, - typeof(DbDomainServiceDescriptionProviderAttribute).Name, domainServiceType.Name, typeof(DbDomainService<>).Name)); - } - efDomainServiceType = efDomainServiceType.BaseType; - } - - return efDomainServiceType.GetGenericArguments()[0]; - } - } -} diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 3cba70428..5215084e6 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -13,6 +13,7 @@ + @@ -20,8 +21,8 @@ True DbResource.resx - - ResourceEFCore.resx + + Resource.resx True True @@ -35,9 +36,9 @@ DbResource.Designer.cs Designer
- + ResXFileCodeGenerator - ResourceEFCore.Designer.cs + Resource.Designer.cs
\ No newline at end of file diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs similarity index 96% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs index a6c815772..1db77e5e1 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.Designer.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.Designer.cs @@ -22,14 +22,14 @@ namespace OpenRiaServices.Server.EntityFrameworkCore { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class ResourceEFCore { + internal class Resource { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal ResourceEFCore() { + internal Resource() { } /// @@ -39,7 +39,7 @@ internal ResourceEFCore() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.Server.EntityFrameworkCore.ResourceEFCore", typeof(ResourceEFCore).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.Server.EntityFrameworkCore.Resource", typeof(Resource).Assembly); resourceMan = temp; } return resourceMan; diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.resx b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx similarity index 100% rename from src/OpenRiaServices.Server.EntityFrameworkCore/Framework/ResourceEFCore.resx rename to src/OpenRiaServices.Server.EntityFrameworkCore/Framework/Resource.resx From 58a4ad55d0e1dd044289248ddcfd9250d8f985ae Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 6 Apr 2022 07:53:31 +0200 Subject: [PATCH 65/99] Fix TODO and introduce tests --- .../Data/CrossDomainServiceQueryTests.cs | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs index 751aee789..6b0d73f9f 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/CrossDomainServiceQueryTests.cs @@ -584,13 +584,12 @@ protected override Northwind CreateNorthwind() return new Northwind(TestURIs.DbCtx_Northwind); } } - /** TODO: - * copy EFQueryTests, do we want the added test from that one */ + [TestClass] public class EFCoreQueryTests : CrossDomainServiceQueryTests { public EFCoreQueryTests() - : base(TestURIs.EFCore_Catalog, /* TODO: remove? EFCore and only have a single provider type */ProviderType.EF) + : base(TestURIs.EFCore_Catalog, ProviderType.EFCore) { } @@ -598,5 +597,31 @@ protected override Northwind CreateNorthwind() { return new Northwind(TestURIs.EFCore_Northwind); } + + /// + /// Test queries on projected FK members to make sure they work + /// + [TestMethod] + [Asynchronous] + public void TestFKProjectionQuery() + { + Catalog catalog = new Catalog(TestURIs.EFCore_Catalog); + LoadOperation lo1 = catalog.Load(catalog.GetEmployeesQuery(), false); + + // test both Where and OrderBy expressions involving projected members + LoadOperation lo2 = catalog.Load(catalog.GetPurchaseOrdersQuery().Where(p => p.EmployeeID > 5).OrderBy(p => p.EmployeeID).Take(1), false); + + EnqueueConditional(delegate + { + return !catalog.IsLoading; + }); + EnqueueCallback(delegate + { + Assert.IsFalse(lo1.HasError || lo2.HasError); + Assert.IsTrue(catalog.Employees.Count > 0, "catalog.Employees.Count should be greater than 0"); + Assert.IsTrue(catalog.PurchaseOrders.Count > 0, "catalog.PurchaseOrders.Count should be greater than 0"); + }); + EnqueueTestComplete(); + } } } From b46ce136a5fee7a12684a06185e2653254c98c41 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Thu, 7 Apr 2022 09:03:10 +0200 Subject: [PATCH 66/99] Fix test due to change in resource name --- .../Test/DomainServiceDescriptionTest.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 1127fffea..0786f47c7 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -31,7 +31,6 @@ namespace OpenRiaServices.Server.Test using System.Threading.Tasks; using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; using Microsoft.EntityFrameworkCore.Metadata; - using OpenRiaServices.Server.EntityFrameworkCore; using MetaType = SystemWebDomainServices::OpenRiaServices.Server.MetaType; /// @@ -358,7 +357,7 @@ public void EFTypeDescriptor_ExcludedEntityMembers() public void EFCoreTypeDescriptor_ExcludedEntityMembers() { PropertyDescriptor pd = TypeDescriptor.GetProperties(typeof(EFCorePocoEntity_IEntityChangeTracker))["EntityState"]; - Assert.IsTrue(EFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); + Assert.IsTrue(EntityFrameworkCore.EFCoreTypeDescriptor.ShouldExcludeEntityMember(pd)); } /// From bc815ed463f73d4d3278f993946f1e0e1119ce74 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Thu, 7 Apr 2022 17:42:43 +0200 Subject: [PATCH 67/99] Add concurrency to ShipVia --- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 4 ++++ src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index 214ac8a1c..425e944e0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -302,6 +302,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.OrderID).HasColumnName("OrderID") .IsConcurrencyToken(); + entity.Property(e => e.ShipVia) + .HasColumnName("ShipVia") + .IsConcurrencyToken(); + entity.Property(e => e.CustomerID) .HasColumnName("CustomerID") .HasMaxLength(5) diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index 85a95bd80..4ba18840d 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -166,15 +166,15 @@ public void TestClientCodegen_EFDbCtxDomainServices_FullTypes() typeof(TestDomainServices.DbCtx.Northwind), sharedFiles, true)); } - [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFCoreContext")] - [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFCoreContext")] + [DeploymentItem(@"Baselines\Default\Scenarios", "CG_Scenarios_EFContext")] + [DeploymentItem(@"ProjectPath.txt", "CG_Scenarios_EFContext")] [TestMethod] public void TestClientCodegen_EFCoreDomainServices() { string[] sharedFiles = Array.Empty(); // Default codegen - TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\Scenarios", "CG_Scenarios_EFCoreContext", "EFCoreContextScenarios.g", + TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\Scenarios", "CG_Scenarios_EFContext", "EFCoreContextScenarios.g", typeof(TestDomainServices.EFCore.Northwind), sharedFiles, false)); } From e40e98c78586f167093eeeccd800c95becafbf37 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Thu, 7 Apr 2022 18:19:58 +0200 Subject: [PATCH 68/99] Fix only FK constraints failing in test. --- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 29 ++++++++++--------- src/OpenRiaServices.Tools/Test/TestHelper.cs | 3 ++ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index 425e944e0..9487574c0 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -57,12 +57,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(entity => { - entity.HasKey(e => e.CategoryID); + entity.HasKey(e => e.CategoryID) + .HasName("CategoryID"); entity.HasIndex(e => e.CategoryName) .HasName("CategoryName"); - entity.Property(e => e.CategoryID).HasColumnName("CategoryID"); + entity.Property(e => e.CategoryID) + .HasColumnName("CategoryID") + .IsConcurrencyToken(); entity.Property(e => e.CategoryName) .IsRequired() @@ -131,7 +134,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .HasName("Region"); entity.Property(e => e.CustomerID) - .HasMaxLength(5) + .HasMaxLength(15) .IsFixedLength() .IsConcurrencyToken(); @@ -140,7 +143,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.City).HasMaxLength(15).IsConcurrencyToken(); entity.Property(e => e.CompanyName) - .IsRequired() .HasMaxLength(40) .IsConcurrencyToken(); @@ -268,13 +270,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .WithMany(p => p.Order_Details) .HasForeignKey(d => d.OrderID) .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Order_Details_Orders"); + .HasConstraintName("Order_Details_Orders"); entity.HasOne(d => d.Product) .WithMany(p => p.Order_Details) .HasForeignKey(d => d.ProductID) .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Order_Details_Products"); + .HasConstraintName("Order_Details_Products"); }); modelBuilder.Entity(entity => @@ -340,7 +342,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(d => d.Customer) .WithMany(p => p.Orders) .HasForeignKey(d => d.CustomerID) - .HasConstraintName("FK_Orders_Customers"); + .HasConstraintName("Orders_Customers"); entity.HasOne(d => d.Employee) .WithMany(p => p.Orders) @@ -357,7 +359,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) modelBuilder.Entity(entity => { - entity.HasKey(e => e.ProductID); + entity.HasKey(e => e.ProductID) + .HasName("ProductID"); entity.HasIndex(e => e.CategoryID) .HasName("CategoryID"); @@ -368,9 +371,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasIndex(e => e.SupplierID) .HasName("SuppliersProducts"); - entity.Property(e => e.ProductID).IsConcurrencyToken(); + entity.Property(e => e.ProductID); - entity.Property(e => e.CategoryID).IsConcurrencyToken(); + entity.Property(e => e.CategoryID) + .IsConcurrencyToken(); entity.Property(e => e.Discontinued) .IsRequired() @@ -399,7 +403,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(d => d.Category) .WithMany(p => p.Products) .HasForeignKey(d => d.CategoryID) - .HasConstraintName("FK_Products_Categories"); + .HasConstraintName("Products_Categories"); entity.HasOne(d => d.Supplier) .WithMany(p => p.Products) @@ -422,7 +426,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .ValueGeneratedNever(); entity.Property(e => e.RegionDescription) - .IsRequired() .HasMaxLength(50) .IsFixedLength(); }); @@ -434,7 +437,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.ShipperID).HasColumnName("ShipperID"); entity.Property(e => e.CompanyName) - .IsRequired() .HasMaxLength(40); entity.Property(e => e.Phone).HasMaxLength(24); @@ -489,7 +491,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.RegionID).HasColumnName("RegionID"); entity.Property(e => e.TerritoryDescription) - .IsRequired() .HasMaxLength(50) .IsFixedLength(); diff --git a/src/OpenRiaServices.Tools/Test/TestHelper.cs b/src/OpenRiaServices.Tools/Test/TestHelper.cs index 771bc0a79..0006a2ea8 100644 --- a/src/OpenRiaServices.Tools/Test/TestHelper.cs +++ b/src/OpenRiaServices.Tools/Test/TestHelper.cs @@ -95,6 +95,7 @@ public static bool FilesMatch(string relativeTestDir, string relativeDeployDir, // Generate CMD strings to diff and to copy string tfDiffCommand = "tf diff \"" + referenceFileName + "\" \"" + generatedFileName + "\"\r\n"; + string codeDiffCommand = "code --diff \"" + referenceFileName + "\" \"" + generatedFileName + "\"\r\n"; string tfEditCommand = "tf edit \"" + realFileInProject + "\"\r\n"; string copyCommand = "copy \"" + generatedFileName + "\" \"" + realFileInProject + "\""; @@ -114,6 +115,8 @@ public static bool FilesMatch(string relativeTestDir, string relativeDeployDir, " Newly generated file: " + generatedFileName + "\r\n" + "\r\n ------------------- To diff these files, execute this ------------------\r\n\r\n " + tfDiffCommand + + "\r\n or using vscode \r\n\r\n " + + codeDiffCommand + "\r\n ---------------- To make this the new reference file, execute this ------------------\r\n\r\n " + tfEditCommand + " " + copyCommand + "\r\n\r\n" + From 2ad4350bea92cfccc6ee4c705e7dcce740e71316 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 8 Apr 2022 08:00:52 +0200 Subject: [PATCH 69/99] Update test file --- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 10 +++++----- .../Default/Scenarios/EFCoreContextScenarios.g.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index 9487574c0..0ecf079de 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -270,13 +270,13 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .WithMany(p => p.Order_Details) .HasForeignKey(d => d.OrderID) .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("Order_Details_Orders"); + .HasConstraintName("Order_Order_Detail"); entity.HasOne(d => d.Product) .WithMany(p => p.Order_Details) .HasForeignKey(d => d.ProductID) .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("Order_Details_Products"); + .HasConstraintName("Product_Order_Detail"); }); modelBuilder.Entity(entity => @@ -342,7 +342,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(d => d.Customer) .WithMany(p => p.Orders) .HasForeignKey(d => d.CustomerID) - .HasConstraintName("Orders_Customers"); + .HasConstraintName("Customer_Order"); entity.HasOne(d => d.Employee) .WithMany(p => p.Orders) @@ -403,7 +403,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.HasOne(d => d.Category) .WithMany(p => p.Products) .HasForeignKey(d => d.CategoryID) - .HasConstraintName("Products_Categories"); + .HasConstraintName("Category_Product"); entity.HasOne(d => d.Supplier) .WithMany(p => p.Products) @@ -498,7 +498,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .WithMany(p => p.Territories) .HasForeignKey(d => d.RegionID) .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Territories_Region"); + .HasConstraintName("Region_Territory"); }); OnModelCreatingPartial(modelBuilder); diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs index d2e1d8629..63552bbbd 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -2492,7 +2492,7 @@ namespace TestDomainServices.EFCore using System.Linq; using System.ServiceModel; using System.Threading.Tasks; - using CodeFirstModels; + using EFCoreModels.Northwind; using OpenRiaServices; using OpenRiaServices.Client; using OpenRiaServices.Client.Authentication; From fb4958e3c9c74f2fb5b35dd5cba1e2940bb047a1 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 8 Apr 2022 08:09:25 +0200 Subject: [PATCH 70/99] Remove test. --- .../Test/DomainServiceDescriptionTest.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs index 0786f47c7..173c5932c 100644 --- a/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs +++ b/src/OpenRiaServices.Server/Test/DomainServiceDescriptionTest.cs @@ -386,19 +386,6 @@ public void DomainServiceDescription_EFPOCO() Assert.IsNotNull(assocAttrib); } - /// - /// Verify FindEntityType for EF Core - /// - [TestMethod] - public void DomainServiceDescription_EFCoreTestFindEntityType() - { - // First create a context manually and verify that POCO metadata is configured correctly - var ctxt = new EFCoreModels.Northwind.EFCoreDbCtxNorthwindEntities(); - IEntityType entityType = ctxt.Model.FindEntityType(typeof(EFCoreModels.Northwind.Product).FullName); - Assert.IsNotNull(entityType); - } - - /// /// Verify that after deriving from an EF type TypeDescriptor continues to work as expected. /// From 8a7f5e059e16fe3f0b41e2377970c062d8ea61b0 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 8 Apr 2022 08:21:45 +0200 Subject: [PATCH 71/99] Update vb file --- .../Scenarios/EFCoreContextScenarios.g.vb | 1954 ++++++++--------- 1 file changed, 977 insertions(+), 977 deletions(-) diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb index 955aaaebc..18f4a8356 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -13,7 +13,7 @@ Option Infer On Option Strict On Option Explicit On -Imports CodeFirstModels +Imports EFCoreModels.Northwind Imports OpenRiaServices Imports OpenRiaServices.Client Imports OpenRiaServices.Client.Authentication @@ -27,150 +27,150 @@ Imports System.ServiceModel Imports System.Threading.Tasks Namespace EFCoreModels.Northwind - + ''' ''' The 'Category' entity class. ''' - + _ Partial Public NotInheritable Class Category Inherits Entity - + Private _categoryID As Integer - + Private _categoryName As String - + Private _description As String - + Private _picture() As Byte - + Private _products As EntityCollection(Of Product) - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnCategoryIDChanging(ByVal value As Integer) + Private Partial Sub OnCategoryIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnCategoryIDChanged() + Private Partial Sub OnCategoryIDChanged() End Sub - Partial Private Sub OnCategoryNameChanging(ByVal value As String) + Private Partial Sub OnCategoryNameChanging(ByVal value As String) End Sub - Partial Private Sub OnCategoryNameChanged() + Private Partial Sub OnCategoryNameChanged() End Sub - Partial Private Sub OnDescriptionChanging(ByVal value As String) + Private Partial Sub OnDescriptionChanging(ByVal value As String) End Sub - Partial Private Sub OnDescriptionChanged() + Private Partial Sub OnDescriptionChanged() End Sub - Partial Private Sub OnPictureChanging(ByVal value() As Byte) + Private Partial Sub OnPictureChanging(ByVal value() As Byte) End Sub - Partial Private Sub OnPictureChanged() + Private Partial Sub OnPictureChanged() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the 'CategoryID' value. ''' - + _ Public Property CategoryID() As Integer Get Return Me._categoryID End Get Set - If ((Me._categoryID = Value) _ - = False) Then - Me.OnCategoryIDChanging(Value) - Me.ValidateProperty("CategoryID", Value) - Me._categoryID = Value + If ((Me._categoryID = value) _ + = false) Then + Me.OnCategoryIDChanging(value) + Me.ValidateProperty("CategoryID", value) + Me._categoryID = value Me.RaisePropertyChanged("CategoryID") - Me.OnCategoryIDChanged() + Me.OnCategoryIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'CategoryName' value. ''' - + _ Public Property CategoryName() As String Get Return Me._categoryName End Get Set - If (String.Equals(Me._categoryName, Value) = False) Then - Me.OnCategoryNameChanging(Value) + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) Me.RaiseDataMemberChanging("CategoryName") - Me.ValidateProperty("CategoryName", Value) - Me._categoryName = Value + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value Me.RaiseDataMemberChanged("CategoryName") - Me.OnCategoryNameChanged() + Me.OnCategoryNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'Description' value. ''' - + _ Public Property Description() As String Get Return Me._description End Get Set - If (String.Equals(Me._description, Value) = False) Then - Me.OnDescriptionChanging(Value) + If (String.Equals(Me._description, value) = false) Then + Me.OnDescriptionChanging(value) Me.RaiseDataMemberChanging("Description") - Me.ValidateProperty("Description", Value) - Me._description = Value + Me.ValidateProperty("Description", value) + Me._description = value Me.RaiseDataMemberChanged("Description") - Me.OnDescriptionChanged() + Me.OnDescriptionChanged End If End Set End Property - + ''' ''' Gets or sets the 'Picture' value. ''' - + _ Public Property Picture() As Byte() Get Return Me._picture End Get Set - If (Object.Equals(Me._picture, Value) = False) Then - Me.OnPictureChanging(Value) + If (Object.Equals(Me._picture, value) = false) Then + Me.OnPictureChanging(value) Me.RaiseDataMemberChanging("Picture") - Me.ValidateProperty("Picture", Value) - Me._picture = Value + Me.ValidateProperty("Picture", value) + Me._picture = value Me.RaiseDataMemberChanged("Picture") - Me.OnPictureChanged() + Me.OnPictureChanged End If End Set End Property - + ''' ''' Gets the collection of associated entity instances. ''' - + _ Public ReadOnly Property Products() As EntityCollection(Of Product) Get If (Me._products Is Nothing) Then @@ -179,19 +179,19 @@ Namespace EFCoreModels.Northwind Return Me._products End Get End Property - + Private Sub AttachProducts(ByVal entity As Product) entity.Category = Me End Sub - + Private Sub DetachProducts(ByVal entity As Product) entity.Category = Nothing End Sub - + Private Function FilterProducts(ByVal entity As Product) As Boolean Return Object.Equals(entity.CategoryID, Me.CategoryID) End Function - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -200,292 +200,292 @@ Namespace EFCoreModels.Northwind Return Me._categoryID End Function End Class - + ''' ''' The 'Customer' entity class. ''' - + _ Partial Public NotInheritable Class Customer Inherits Entity - + Private _address As String - + Private _city As String - + Private _companyName As String - + Private _contactName As String - + Private _contactTitle As String - + Private _country As String - + Private _customerID As String - + Private _fax As String - + Private _orders As EntityCollection(Of Order) - + Private _phone As String - + Private _postalCode As String - + Private _region As String - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnAddressChanging(ByVal value As String) + Private Partial Sub OnAddressChanging(ByVal value As String) End Sub - Partial Private Sub OnAddressChanged() + Private Partial Sub OnAddressChanged() End Sub - Partial Private Sub OnCityChanging(ByVal value As String) + Private Partial Sub OnCityChanging(ByVal value As String) End Sub - Partial Private Sub OnCityChanged() + Private Partial Sub OnCityChanged() End Sub - Partial Private Sub OnCompanyNameChanging(ByVal value As String) + Private Partial Sub OnCompanyNameChanging(ByVal value As String) End Sub - Partial Private Sub OnCompanyNameChanged() + Private Partial Sub OnCompanyNameChanged() End Sub - Partial Private Sub OnContactNameChanging(ByVal value As String) + Private Partial Sub OnContactNameChanging(ByVal value As String) End Sub - Partial Private Sub OnContactNameChanged() + Private Partial Sub OnContactNameChanged() End Sub - Partial Private Sub OnContactTitleChanging(ByVal value As String) + Private Partial Sub OnContactTitleChanging(ByVal value As String) End Sub - Partial Private Sub OnContactTitleChanged() + Private Partial Sub OnContactTitleChanged() End Sub - Partial Private Sub OnCountryChanging(ByVal value As String) + Private Partial Sub OnCountryChanging(ByVal value As String) End Sub - Partial Private Sub OnCountryChanged() + Private Partial Sub OnCountryChanged() End Sub - Partial Private Sub OnCustomerIDChanging(ByVal value As String) + Private Partial Sub OnCustomerIDChanging(ByVal value As String) End Sub - Partial Private Sub OnCustomerIDChanged() + Private Partial Sub OnCustomerIDChanged() End Sub - Partial Private Sub OnFaxChanging(ByVal value As String) + Private Partial Sub OnFaxChanging(ByVal value As String) End Sub - Partial Private Sub OnFaxChanged() + Private Partial Sub OnFaxChanged() End Sub - Partial Private Sub OnPhoneChanging(ByVal value As String) + Private Partial Sub OnPhoneChanging(ByVal value As String) End Sub - Partial Private Sub OnPhoneChanged() + Private Partial Sub OnPhoneChanged() End Sub - Partial Private Sub OnPostalCodeChanging(ByVal value As String) + Private Partial Sub OnPostalCodeChanging(ByVal value As String) End Sub - Partial Private Sub OnPostalCodeChanged() + Private Partial Sub OnPostalCodeChanged() End Sub - Partial Private Sub OnRegionChanging(ByVal value As String) + Private Partial Sub OnRegionChanging(ByVal value As String) End Sub - Partial Private Sub OnRegionChanged() + Private Partial Sub OnRegionChanged() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the 'Address' value. ''' - + _ Public Property Address() As String Get Return Me._address End Get Set - If (String.Equals(Me._address, Value) = False) Then - Me.OnAddressChanging(Value) + If (String.Equals(Me._address, value) = false) Then + Me.OnAddressChanging(value) Me.RaiseDataMemberChanging("Address") - Me.ValidateProperty("Address", Value) - Me._address = Value + Me.ValidateProperty("Address", value) + Me._address = value Me.RaiseDataMemberChanged("Address") - Me.OnAddressChanged() + Me.OnAddressChanged End If End Set End Property - + ''' ''' Gets or sets the 'City' value. ''' - + _ Public Property City() As String Get Return Me._city End Get Set - If (String.Equals(Me._city, Value) = False) Then - Me.OnCityChanging(Value) + If (String.Equals(Me._city, value) = false) Then + Me.OnCityChanging(value) Me.RaiseDataMemberChanging("City") - Me.ValidateProperty("City", Value) - Me._city = Value + Me.ValidateProperty("City", value) + Me._city = value Me.RaiseDataMemberChanged("City") - Me.OnCityChanged() + Me.OnCityChanged End If End Set End Property - + ''' ''' Gets or sets the 'CompanyName' value. ''' - + _ Public Property CompanyName() As String Get Return Me._companyName End Get Set - If (String.Equals(Me._companyName, Value) = False) Then - Me.OnCompanyNameChanging(Value) + If (String.Equals(Me._companyName, value) = false) Then + Me.OnCompanyNameChanging(value) Me.RaiseDataMemberChanging("CompanyName") - Me.ValidateProperty("CompanyName", Value) - Me._companyName = Value + Me.ValidateProperty("CompanyName", value) + Me._companyName = value Me.RaiseDataMemberChanged("CompanyName") - Me.OnCompanyNameChanged() + Me.OnCompanyNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'ContactName' value. ''' - + _ Public Property ContactName() As String Get Return Me._contactName End Get Set - If (String.Equals(Me._contactName, Value) = False) Then - Me.OnContactNameChanging(Value) + If (String.Equals(Me._contactName, value) = false) Then + Me.OnContactNameChanging(value) Me.RaiseDataMemberChanging("ContactName") - Me.ValidateProperty("ContactName", Value) - Me._contactName = Value + Me.ValidateProperty("ContactName", value) + Me._contactName = value Me.RaiseDataMemberChanged("ContactName") - Me.OnContactNameChanged() + Me.OnContactNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'ContactTitle' value. ''' - + _ Public Property ContactTitle() As String Get Return Me._contactTitle End Get Set - If (String.Equals(Me._contactTitle, Value) = False) Then - Me.OnContactTitleChanging(Value) + If (String.Equals(Me._contactTitle, value) = false) Then + Me.OnContactTitleChanging(value) Me.RaiseDataMemberChanging("ContactTitle") - Me.ValidateProperty("ContactTitle", Value) - Me._contactTitle = Value + Me.ValidateProperty("ContactTitle", value) + Me._contactTitle = value Me.RaiseDataMemberChanged("ContactTitle") - Me.OnContactTitleChanged() + Me.OnContactTitleChanged End If End Set End Property - + ''' ''' Gets or sets the 'Country' value. ''' - + _ Public Property Country() As String Get Return Me._country End Get Set - If (String.Equals(Me._country, Value) = False) Then - Me.OnCountryChanging(Value) + If (String.Equals(Me._country, value) = false) Then + Me.OnCountryChanging(value) Me.RaiseDataMemberChanging("Country") - Me.ValidateProperty("Country", Value) - Me._country = Value + Me.ValidateProperty("Country", value) + Me._country = value Me.RaiseDataMemberChanged("Country") - Me.OnCountryChanged() + Me.OnCountryChanged End If End Set End Property - + ''' ''' Gets or sets the 'CustomerID' value. ''' - + _ Public Property CustomerID() As String Get Return Me._customerID End Get Set - If (String.Equals(Me._customerID, Value) = False) Then - Me.OnCustomerIDChanging(Value) - Me.ValidateProperty("CustomerID", Value) - Me._customerID = Value + If (String.Equals(Me._customerID, value) = false) Then + Me.OnCustomerIDChanging(value) + Me.ValidateProperty("CustomerID", value) + Me._customerID = value Me.RaisePropertyChanged("CustomerID") - Me.OnCustomerIDChanged() + Me.OnCustomerIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'Fax' value. ''' - + _ Public Property Fax() As String Get Return Me._fax End Get Set - If (String.Equals(Me._fax, Value) = False) Then - Me.OnFaxChanging(Value) + If (String.Equals(Me._fax, value) = false) Then + Me.OnFaxChanging(value) Me.RaiseDataMemberChanging("Fax") - Me.ValidateProperty("Fax", Value) - Me._fax = Value + Me.ValidateProperty("Fax", value) + Me._fax = value Me.RaiseDataMemberChanged("Fax") - Me.OnFaxChanged() + Me.OnFaxChanged End If End Set End Property - + ''' ''' Gets the collection of associated entity instances. ''' - + _ Public ReadOnly Property Orders() As EntityCollection(Of Order) Get If (Me._orders Is Nothing) Then @@ -494,88 +494,88 @@ Namespace EFCoreModels.Northwind Return Me._orders End Get End Property - + ''' ''' Gets or sets the 'Phone' value. ''' - + _ Public Property Phone() As String Get Return Me._phone End Get Set - If (String.Equals(Me._phone, Value) = False) Then - Me.OnPhoneChanging(Value) + If (String.Equals(Me._phone, value) = false) Then + Me.OnPhoneChanging(value) Me.RaiseDataMemberChanging("Phone") - Me.ValidateProperty("Phone", Value) - Me._phone = Value + Me.ValidateProperty("Phone", value) + Me._phone = value Me.RaiseDataMemberChanged("Phone") - Me.OnPhoneChanged() + Me.OnPhoneChanged End If End Set End Property - + ''' ''' Gets or sets the 'PostalCode' value. ''' - + _ Public Property PostalCode() As String Get Return Me._postalCode End Get Set - If (String.Equals(Me._postalCode, Value) = False) Then - Me.OnPostalCodeChanging(Value) + If (String.Equals(Me._postalCode, value) = false) Then + Me.OnPostalCodeChanging(value) Me.RaiseDataMemberChanging("PostalCode") - Me.ValidateProperty("PostalCode", Value) - Me._postalCode = Value + Me.ValidateProperty("PostalCode", value) + Me._postalCode = value Me.RaiseDataMemberChanged("PostalCode") - Me.OnPostalCodeChanged() + Me.OnPostalCodeChanged End If End Set End Property - + ''' ''' Gets or sets the 'Region' value. ''' - + _ Public Property Region() As String Get Return Me._region End Get Set - If (String.Equals(Me._region, Value) = False) Then - Me.OnRegionChanging(Value) + If (String.Equals(Me._region, value) = false) Then + Me.OnRegionChanging(value) Me.RaiseDataMemberChanging("Region") - Me.ValidateProperty("Region", Value) - Me._region = Value + Me.ValidateProperty("Region", value) + Me._region = value Me.RaiseDataMemberChanged("Region") - Me.OnRegionChanged() + Me.OnRegionChanged End If End Set End Property - + Private Sub AttachOrders(ByVal entity As Order) entity.Customer = Me End Sub - + Private Sub DetachOrders(ByVal entity As Order) entity.Customer = Nothing End Sub - + Private Function FilterOrders(ByVal entity As Order) As Boolean Return Object.Equals(entity.CustomerID, Me.CustomerID) End Function - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -584,132 +584,132 @@ Namespace EFCoreModels.Northwind Return Me._customerID End Function End Class - + ''' ''' The 'Order' entity class. ''' - + _ Partial Public NotInheritable Class Order Inherits Entity - + Private _customer As EntityRef(Of Customer) - + Private _customerID As String - + Private _employeeID As Nullable(Of Integer) - + Private _formattedName As String - + Private _freight As Nullable(Of Decimal) - + Private _order_Details As EntityCollection(Of Order_Detail) - + Private _orderDate As Nullable(Of DateTime) - + Private _orderID As Integer - + Private _requiredDate As Nullable(Of DateTime) - + Private _shipAddress As String - + Private _shipCity As String - + Private _shipCountry As String - + Private _shipName As String - + Private _shippedDate As Nullable(Of DateTime) - + Private _shipPostalCode As String - + Private _shipRegion As String - + Private _shipVia As Nullable(Of Integer) - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnCustomerIDChanging(ByVal value As String) + Private Partial Sub OnCustomerIDChanging(ByVal value As String) End Sub - Partial Private Sub OnCustomerIDChanged() + Private Partial Sub OnCustomerIDChanged() End Sub - Partial Private Sub OnEmployeeIDChanging(ByVal value As Nullable(Of Integer)) + Private Partial Sub OnEmployeeIDChanging(ByVal value As Nullable(Of Integer)) End Sub - Partial Private Sub OnEmployeeIDChanged() + Private Partial Sub OnEmployeeIDChanged() End Sub - Partial Private Sub OnFormattedNameChanging(ByVal value As String) + Private Partial Sub OnFormattedNameChanging(ByVal value As String) End Sub - Partial Private Sub OnFormattedNameChanged() + Private Partial Sub OnFormattedNameChanged() End Sub - Partial Private Sub OnFreightChanging(ByVal value As Nullable(Of Decimal)) + Private Partial Sub OnFreightChanging(ByVal value As Nullable(Of Decimal)) End Sub - Partial Private Sub OnFreightChanged() + Private Partial Sub OnFreightChanged() End Sub - Partial Private Sub OnOrderDateChanging(ByVal value As Nullable(Of DateTime)) + Private Partial Sub OnOrderDateChanging(ByVal value As Nullable(Of DateTime)) End Sub - Partial Private Sub OnOrderDateChanged() + Private Partial Sub OnOrderDateChanged() End Sub - Partial Private Sub OnOrderIDChanging(ByVal value As Integer) + Private Partial Sub OnOrderIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnOrderIDChanged() + Private Partial Sub OnOrderIDChanged() End Sub - Partial Private Sub OnRequiredDateChanging(ByVal value As Nullable(Of DateTime)) + Private Partial Sub OnRequiredDateChanging(ByVal value As Nullable(Of DateTime)) End Sub - Partial Private Sub OnRequiredDateChanged() + Private Partial Sub OnRequiredDateChanged() End Sub - Partial Private Sub OnShipAddressChanging(ByVal value As String) + Private Partial Sub OnShipAddressChanging(ByVal value As String) End Sub - Partial Private Sub OnShipAddressChanged() + Private Partial Sub OnShipAddressChanged() End Sub - Partial Private Sub OnShipCityChanging(ByVal value As String) + Private Partial Sub OnShipCityChanging(ByVal value As String) End Sub - Partial Private Sub OnShipCityChanged() + Private Partial Sub OnShipCityChanged() End Sub - Partial Private Sub OnShipCountryChanging(ByVal value As String) + Private Partial Sub OnShipCountryChanging(ByVal value As String) End Sub - Partial Private Sub OnShipCountryChanged() + Private Partial Sub OnShipCountryChanged() End Sub - Partial Private Sub OnShipNameChanging(ByVal value As String) + Private Partial Sub OnShipNameChanging(ByVal value As String) End Sub - Partial Private Sub OnShipNameChanged() + Private Partial Sub OnShipNameChanged() End Sub - Partial Private Sub OnShippedDateChanging(ByVal value As Nullable(Of DateTime)) + Private Partial Sub OnShippedDateChanging(ByVal value As Nullable(Of DateTime)) End Sub - Partial Private Sub OnShippedDateChanged() + Private Partial Sub OnShippedDateChanged() End Sub - Partial Private Sub OnShipPostalCodeChanging(ByVal value As String) + Private Partial Sub OnShipPostalCodeChanging(ByVal value As String) End Sub - Partial Private Sub OnShipPostalCodeChanged() + Private Partial Sub OnShipPostalCodeChanged() End Sub - Partial Private Sub OnShipRegionChanging(ByVal value As String) + Private Partial Sub OnShipRegionChanging(ByVal value As String) End Sub - Partial Private Sub OnShipRegionChanged() + Private Partial Sub OnShipRegionChanged() End Sub - Partial Private Sub OnShipViaChanging(ByVal value As Nullable(Of Integer)) + Private Partial Sub OnShipViaChanging(ByVal value As Nullable(Of Integer)) End Sub - Partial Private Sub OnShipViaChanged() + Private Partial Sub OnShipViaChanged() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the associated entity. ''' - + _ Public Property Customer() As Customer Get If (Me._customer Is Nothing) Then @@ -719,118 +719,118 @@ Namespace EFCoreModels.Northwind End Get Set Dim previous As Customer = Me.Customer - If (Object.Equals(previous, Value) = False) Then - Me.ValidateProperty("Customer", Value) + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Customer", value) If (Not (previous) Is Nothing) Then Me._customer.Entity = Nothing previous.Orders.Remove(Me) End If - If (Not (Value) Is Nothing) Then - Me.CustomerID = Value.CustomerID + If (Not (value) Is Nothing) Then + Me.CustomerID = value.CustomerID Else Me.CustomerID = CType(Nothing, String) End If - Me._customer.Entity = Value - If (Not (Value) Is Nothing) Then - Value.Orders.Add(Me) + Me._customer.Entity = value + If (Not (value) Is Nothing) Then + value.Orders.Add(Me) End If Me.RaisePropertyChanged("Customer") End If End Set End Property - + ''' ''' Gets or sets the 'CustomerID' value. ''' - + _ Public Property CustomerID() As String Get Return Me._customerID End Get Set - If (String.Equals(Me._customerID, Value) = False) Then - Me.OnCustomerIDChanging(Value) + If (String.Equals(Me._customerID, value) = false) Then + Me.OnCustomerIDChanging(value) Me.RaiseDataMemberChanging("CustomerID") - Me.ValidateProperty("CustomerID", Value) - Me._customerID = Value + Me.ValidateProperty("CustomerID", value) + Me._customerID = value Me.RaiseDataMemberChanged("CustomerID") - Me.OnCustomerIDChanged() + Me.OnCustomerIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'EmployeeID' value. ''' - + _ Public Property EmployeeID() As Nullable(Of Integer) Get Return Me._employeeID End Get Set - If (Me._employeeID.Equals(Value) = False) Then - Me.OnEmployeeIDChanging(Value) + If (Me._employeeID.Equals(value) = false) Then + Me.OnEmployeeIDChanging(value) Me.RaiseDataMemberChanging("EmployeeID") - Me.ValidateProperty("EmployeeID", Value) - Me._employeeID = Value + Me.ValidateProperty("EmployeeID", value) + Me._employeeID = value Me.RaiseDataMemberChanged("EmployeeID") - Me.OnEmployeeIDChanged() + Me.OnEmployeeIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'FormattedName' value. ''' - + _ Public Property FormattedName() As String Get Return Me._formattedName End Get Set - If (String.Equals(Me._formattedName, Value) = False) Then - Me.OnFormattedNameChanging(Value) - Me.ValidateProperty("FormattedName", Value) - Me._formattedName = Value + If (String.Equals(Me._formattedName, value) = false) Then + Me.OnFormattedNameChanging(value) + Me.ValidateProperty("FormattedName", value) + Me._formattedName = value Me.RaisePropertyChanged("FormattedName") - Me.OnFormattedNameChanged() + Me.OnFormattedNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'Freight' value. ''' - + _ Public Property Freight() As Nullable(Of Decimal) Get Return Me._freight End Get Set - If (Me._freight.Equals(Value) = False) Then - Me.OnFreightChanging(Value) + If (Me._freight.Equals(value) = false) Then + Me.OnFreightChanging(value) Me.RaiseDataMemberChanging("Freight") - Me.ValidateProperty("Freight", Value) - Me._freight = Value + Me.ValidateProperty("Freight", value) + Me._freight = value Me.RaiseDataMemberChanged("Freight") - Me.OnFreightChanged() + Me.OnFreightChanged End If End Set End Property - + ''' ''' Gets the collection of associated entity instances. ''' - + _ Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) Get If (Me._order_Details Is Nothing) Then @@ -839,273 +839,273 @@ Namespace EFCoreModels.Northwind Return Me._order_Details End Get End Property - + ''' ''' Gets or sets the 'OrderDate' value. ''' - + _ Public Property OrderDate() As Nullable(Of DateTime) Get Return Me._orderDate End Get Set - If (Me._orderDate.Equals(Value) = False) Then - Me.OnOrderDateChanging(Value) + If (Me._orderDate.Equals(value) = false) Then + Me.OnOrderDateChanging(value) Me.RaiseDataMemberChanging("OrderDate") - Me.ValidateProperty("OrderDate", Value) - Me._orderDate = Value + Me.ValidateProperty("OrderDate", value) + Me._orderDate = value Me.RaiseDataMemberChanged("OrderDate") - Me.OnOrderDateChanged() + Me.OnOrderDateChanged End If End Set End Property - + ''' ''' Gets or sets the 'OrderID' value. ''' - + _ Public Property OrderID() As Integer Get Return Me._orderID End Get Set - If ((Me._orderID = Value) _ - = False) Then - Me.OnOrderIDChanging(Value) - Me.ValidateProperty("OrderID", Value) - Me._orderID = Value + If ((Me._orderID = value) _ + = false) Then + Me.OnOrderIDChanging(value) + Me.ValidateProperty("OrderID", value) + Me._orderID = value Me.RaisePropertyChanged("OrderID") - Me.OnOrderIDChanged() + Me.OnOrderIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'RequiredDate' value. ''' - + _ Public Property RequiredDate() As Nullable(Of DateTime) Get Return Me._requiredDate End Get Set - If (Me._requiredDate.Equals(Value) = False) Then - Me.OnRequiredDateChanging(Value) + If (Me._requiredDate.Equals(value) = false) Then + Me.OnRequiredDateChanging(value) Me.RaiseDataMemberChanging("RequiredDate") - Me.ValidateProperty("RequiredDate", Value) - Me._requiredDate = Value + Me.ValidateProperty("RequiredDate", value) + Me._requiredDate = value Me.RaiseDataMemberChanged("RequiredDate") - Me.OnRequiredDateChanged() + Me.OnRequiredDateChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShipAddress' value. ''' - + _ Public Property ShipAddress() As String Get Return Me._shipAddress End Get Set - If (String.Equals(Me._shipAddress, Value) = False) Then - Me.OnShipAddressChanging(Value) + If (String.Equals(Me._shipAddress, value) = false) Then + Me.OnShipAddressChanging(value) Me.RaiseDataMemberChanging("ShipAddress") - Me.ValidateProperty("ShipAddress", Value) - Me._shipAddress = Value + Me.ValidateProperty("ShipAddress", value) + Me._shipAddress = value Me.RaiseDataMemberChanged("ShipAddress") - Me.OnShipAddressChanged() + Me.OnShipAddressChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShipCity' value. ''' - + _ Public Property ShipCity() As String Get Return Me._shipCity End Get Set - If (String.Equals(Me._shipCity, Value) = False) Then - Me.OnShipCityChanging(Value) + If (String.Equals(Me._shipCity, value) = false) Then + Me.OnShipCityChanging(value) Me.RaiseDataMemberChanging("ShipCity") - Me.ValidateProperty("ShipCity", Value) - Me._shipCity = Value + Me.ValidateProperty("ShipCity", value) + Me._shipCity = value Me.RaiseDataMemberChanged("ShipCity") - Me.OnShipCityChanged() + Me.OnShipCityChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShipCountry' value. ''' - + _ Public Property ShipCountry() As String Get Return Me._shipCountry End Get Set - If (String.Equals(Me._shipCountry, Value) = False) Then - Me.OnShipCountryChanging(Value) + If (String.Equals(Me._shipCountry, value) = false) Then + Me.OnShipCountryChanging(value) Me.RaiseDataMemberChanging("ShipCountry") - Me.ValidateProperty("ShipCountry", Value) - Me._shipCountry = Value + Me.ValidateProperty("ShipCountry", value) + Me._shipCountry = value Me.RaiseDataMemberChanged("ShipCountry") - Me.OnShipCountryChanged() + Me.OnShipCountryChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShipName' value. ''' - + _ Public Property ShipName() As String Get Return Me._shipName End Get Set - If (String.Equals(Me._shipName, Value) = False) Then - Me.OnShipNameChanging(Value) + If (String.Equals(Me._shipName, value) = false) Then + Me.OnShipNameChanging(value) Me.RaiseDataMemberChanging("ShipName") - Me.ValidateProperty("ShipName", Value) - Me._shipName = Value + Me.ValidateProperty("ShipName", value) + Me._shipName = value Me.RaiseDataMemberChanged("ShipName") - Me.OnShipNameChanged() + Me.OnShipNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShippedDate' value. ''' - + _ Public Property ShippedDate() As Nullable(Of DateTime) Get Return Me._shippedDate End Get Set - If (Me._shippedDate.Equals(Value) = False) Then - Me.OnShippedDateChanging(Value) + If (Me._shippedDate.Equals(value) = false) Then + Me.OnShippedDateChanging(value) Me.RaiseDataMemberChanging("ShippedDate") - Me.ValidateProperty("ShippedDate", Value) - Me._shippedDate = Value + Me.ValidateProperty("ShippedDate", value) + Me._shippedDate = value Me.RaiseDataMemberChanged("ShippedDate") - Me.OnShippedDateChanged() + Me.OnShippedDateChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShipPostalCode' value. ''' - + _ Public Property ShipPostalCode() As String Get Return Me._shipPostalCode End Get Set - If (String.Equals(Me._shipPostalCode, Value) = False) Then - Me.OnShipPostalCodeChanging(Value) + If (String.Equals(Me._shipPostalCode, value) = false) Then + Me.OnShipPostalCodeChanging(value) Me.RaiseDataMemberChanging("ShipPostalCode") - Me.ValidateProperty("ShipPostalCode", Value) - Me._shipPostalCode = Value + Me.ValidateProperty("ShipPostalCode", value) + Me._shipPostalCode = value Me.RaiseDataMemberChanged("ShipPostalCode") - Me.OnShipPostalCodeChanged() + Me.OnShipPostalCodeChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShipRegion' value. ''' - + _ Public Property ShipRegion() As String Get Return Me._shipRegion End Get Set - If (String.Equals(Me._shipRegion, Value) = False) Then - Me.OnShipRegionChanging(Value) + If (String.Equals(Me._shipRegion, value) = false) Then + Me.OnShipRegionChanging(value) Me.RaiseDataMemberChanging("ShipRegion") - Me.ValidateProperty("ShipRegion", Value) - Me._shipRegion = Value + Me.ValidateProperty("ShipRegion", value) + Me._shipRegion = value Me.RaiseDataMemberChanged("ShipRegion") - Me.OnShipRegionChanged() + Me.OnShipRegionChanged End If End Set End Property - + ''' ''' Gets or sets the 'ShipVia' value. ''' - + _ Public Property ShipVia() As Nullable(Of Integer) Get Return Me._shipVia End Get Set - If (Me._shipVia.Equals(Value) = False) Then - Me.OnShipViaChanging(Value) + If (Me._shipVia.Equals(value) = false) Then + Me.OnShipViaChanging(value) Me.RaiseDataMemberChanging("ShipVia") - Me.ValidateProperty("ShipVia", Value) - Me._shipVia = Value + Me.ValidateProperty("ShipVia", value) + Me._shipVia = value Me.RaiseDataMemberChanged("ShipVia") - Me.OnShipViaChanged() + Me.OnShipViaChanged End If End Set End Property - + Private Function FilterCustomer(ByVal entity As Customer) As Boolean Return Object.Equals(entity.CustomerID, Me.CustomerID) End Function - + Private Sub AttachOrder_Details(ByVal entity As Order_Detail) entity.Order = Me End Sub - + Private Sub DetachOrder_Details(ByVal entity As Order_Detail) entity.Order = Nothing End Sub - + Private Function FilterOrder_Details(ByVal entity As Order_Detail) As Boolean Return Object.Equals(entity.OrderID, Me.OrderID) End Function - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -1114,95 +1114,95 @@ Namespace EFCoreModels.Northwind Return Me._orderID End Function End Class - + ''' ''' The 'Order_Detail' entity class. ''' - + _ Partial Public NotInheritable Class Order_Detail Inherits Entity - + Private _discount As Single - + Private _order As EntityRef(Of Order) - + Private _orderID As Integer - + Private _product As EntityRef(Of Product) - + Private _productID As Integer - + Private _quantity As Short - + Private _unitPrice As Decimal - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnDiscountChanging(ByVal value As Single) + Private Partial Sub OnDiscountChanging(ByVal value As Single) End Sub - Partial Private Sub OnDiscountChanged() + Private Partial Sub OnDiscountChanged() End Sub - Partial Private Sub OnOrderIDChanging(ByVal value As Integer) + Private Partial Sub OnOrderIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnOrderIDChanged() + Private Partial Sub OnOrderIDChanged() End Sub - Partial Private Sub OnProductIDChanging(ByVal value As Integer) + Private Partial Sub OnProductIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnProductIDChanged() + Private Partial Sub OnProductIDChanged() End Sub - Partial Private Sub OnQuantityChanging(ByVal value As Short) + Private Partial Sub OnQuantityChanging(ByVal value As Short) End Sub - Partial Private Sub OnQuantityChanged() + Private Partial Sub OnQuantityChanged() End Sub - Partial Private Sub OnUnitPriceChanging(ByVal value As Decimal) + Private Partial Sub OnUnitPriceChanging(ByVal value As Decimal) End Sub - Partial Private Sub OnUnitPriceChanged() + Private Partial Sub OnUnitPriceChanged() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the 'Discount' value. ''' - + _ Public Property Discount() As Single Get Return Me._discount End Get Set - If ((Me._discount = Value) _ - = False) Then - Me.OnDiscountChanging(Value) + If ((Me._discount = value) _ + = false) Then + Me.OnDiscountChanging(value) Me.RaiseDataMemberChanging("Discount") - Me.ValidateProperty("Discount", Value) - Me._discount = Value + Me.ValidateProperty("Discount", value) + Me._discount = value Me.RaiseDataMemberChanged("Discount") - Me.OnDiscountChanged() + Me.OnDiscountChanged End If End Set End Property - + ''' ''' Gets or sets the associated entity. ''' - + _ Public Property Order() As Order Get If (Me._order Is Nothing) Then @@ -1212,54 +1212,54 @@ Namespace EFCoreModels.Northwind End Get Set Dim previous As Order = Me.Order - If (Object.Equals(previous, Value) = False) Then - Me.ValidateProperty("Order", Value) + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Order", value) If (Not (previous) Is Nothing) Then Me._order.Entity = Nothing previous.Order_Details.Remove(Me) End If - If (Not (Value) Is Nothing) Then - Me.OrderID = Value.OrderID + If (Not (value) Is Nothing) Then + Me.OrderID = value.OrderID Else Me.OrderID = CType(Nothing, Integer) End If - Me._order.Entity = Value - If (Not (Value) Is Nothing) Then - Value.Order_Details.Add(Me) + Me._order.Entity = value + If (Not (value) Is Nothing) Then + value.Order_Details.Add(Me) End If Me.RaisePropertyChanged("Order") End If End Set End Property - + ''' ''' Gets or sets the 'OrderID' value. ''' - + _ Public Property OrderID() As Integer Get Return Me._orderID End Get Set - If ((Me._orderID = Value) _ - = False) Then - Me.OnOrderIDChanging(Value) + If ((Me._orderID = value) _ + = false) Then + Me.OnOrderIDChanging(value) Me.RaiseDataMemberChanging("OrderID") - Me.ValidateProperty("OrderID", Value) - Me._orderID = Value + Me.ValidateProperty("OrderID", value) + Me._orderID = value Me.RaiseDataMemberChanged("OrderID") - Me.OnOrderIDChanged() + Me.OnOrderIDChanged End If End Set End Property - + ''' ''' Gets or sets the associated entity. ''' - + _ Public Property Product() As Product Get If (Me._product Is Nothing) Then @@ -1269,104 +1269,104 @@ Namespace EFCoreModels.Northwind End Get Set Dim previous As Product = Me.Product - If (Object.Equals(previous, Value) = False) Then - Me.ValidateProperty("Product", Value) + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Product", value) If (Not (previous) Is Nothing) Then Me._product.Entity = Nothing previous.Order_Details.Remove(Me) End If - If (Not (Value) Is Nothing) Then - Me.ProductID = Value.ProductID + If (Not (value) Is Nothing) Then + Me.ProductID = value.ProductID Else Me.ProductID = CType(Nothing, Integer) End If - Me._product.Entity = Value - If (Not (Value) Is Nothing) Then - Value.Order_Details.Add(Me) + Me._product.Entity = value + If (Not (value) Is Nothing) Then + value.Order_Details.Add(Me) End If Me.RaisePropertyChanged("Product") End If End Set End Property - + ''' ''' Gets or sets the 'ProductID' value. ''' - + _ Public Property ProductID() As Integer Get Return Me._productID End Get Set - If ((Me._productID = Value) _ - = False) Then - Me.OnProductIDChanging(Value) + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) Me.RaiseDataMemberChanging("ProductID") - Me.ValidateProperty("ProductID", Value) - Me._productID = Value + Me.ValidateProperty("ProductID", value) + Me._productID = value Me.RaiseDataMemberChanged("ProductID") - Me.OnProductIDChanged() + Me.OnProductIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'Quantity' value. ''' - + _ Public Property Quantity() As Short Get Return Me._quantity End Get Set - If ((Me._quantity = Value) _ - = False) Then - Me.OnQuantityChanging(Value) + If ((Me._quantity = value) _ + = false) Then + Me.OnQuantityChanging(value) Me.RaiseDataMemberChanging("Quantity") - Me.ValidateProperty("Quantity", Value) - Me._quantity = Value + Me.ValidateProperty("Quantity", value) + Me._quantity = value Me.RaiseDataMemberChanged("Quantity") - Me.OnQuantityChanged() + Me.OnQuantityChanged End If End Set End Property - + ''' ''' Gets or sets the 'UnitPrice' value. ''' - + _ Public Property UnitPrice() As Decimal Get Return Me._unitPrice End Get Set - If ((Me._unitPrice = Value) _ - = False) Then - Me.OnUnitPriceChanging(Value) + If ((Me._unitPrice = value) _ + = false) Then + Me.OnUnitPriceChanging(value) Me.RaiseDataMemberChanging("UnitPrice") - Me.ValidateProperty("UnitPrice", Value) - Me._unitPrice = Value + Me.ValidateProperty("UnitPrice", value) + Me._unitPrice = value Me.RaiseDataMemberChanged("UnitPrice") - Me.OnUnitPriceChanged() + Me.OnUnitPriceChanged End If End Set End Property - + Private Function FilterOrder(ByVal entity As Order) As Boolean Return Object.Equals(entity.OrderID, Me.OrderID) End Function - + Private Function FilterProduct(ByVal entity As Product) As Boolean Return Object.Equals(entity.ProductID, Me.ProductID) End Function - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -1375,124 +1375,124 @@ Namespace EFCoreModels.Northwind Return EntityKey.Create(Me._orderID, Me._productID) End Function End Class - + ''' ''' The 'Product' entity class. ''' - + _ Partial Public NotInheritable Class Product Inherits Entity - + Private _category As EntityRef(Of Category) - + Private _categoryID As Nullable(Of Integer) - + Private _categoryName As String - + Private _discontinued As Boolean - + Private _order_Details As EntityCollection(Of Order_Detail) - + Private _productID As Integer - + Private _productName As String - + Private _quantityPerUnit As String - + Private _reorderLevel As Nullable(Of Short) - + Private _resolveMethod As String - + Private _supplierID As Nullable(Of Integer) - + Private _supplierName As String - + Private _unitPrice As Nullable(Of Decimal) - + Private _unitsInStock As Nullable(Of Short) - + Private _unitsOnOrder As Nullable(Of Short) - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnCategoryIDChanging(ByVal value As Nullable(Of Integer)) + Private Partial Sub OnCategoryIDChanging(ByVal value As Nullable(Of Integer)) End Sub - Partial Private Sub OnCategoryIDChanged() + Private Partial Sub OnCategoryIDChanged() End Sub - Partial Private Sub OnCategoryNameChanging(ByVal value As String) + Private Partial Sub OnCategoryNameChanging(ByVal value As String) End Sub - Partial Private Sub OnCategoryNameChanged() + Private Partial Sub OnCategoryNameChanged() End Sub - Partial Private Sub OnDiscontinuedChanging(ByVal value As Boolean) + Private Partial Sub OnDiscontinuedChanging(ByVal value As Boolean) End Sub - Partial Private Sub OnDiscontinuedChanged() + Private Partial Sub OnDiscontinuedChanged() End Sub - Partial Private Sub OnProductIDChanging(ByVal value As Integer) + Private Partial Sub OnProductIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnProductIDChanged() + Private Partial Sub OnProductIDChanged() End Sub - Partial Private Sub OnProductNameChanging(ByVal value As String) + Private Partial Sub OnProductNameChanging(ByVal value As String) End Sub - Partial Private Sub OnProductNameChanged() + Private Partial Sub OnProductNameChanged() End Sub - Partial Private Sub OnQuantityPerUnitChanging(ByVal value As String) + Private Partial Sub OnQuantityPerUnitChanging(ByVal value As String) End Sub - Partial Private Sub OnQuantityPerUnitChanged() + Private Partial Sub OnQuantityPerUnitChanged() End Sub - Partial Private Sub OnReorderLevelChanging(ByVal value As Nullable(Of Short)) + Private Partial Sub OnReorderLevelChanging(ByVal value As Nullable(Of Short)) End Sub - Partial Private Sub OnReorderLevelChanged() + Private Partial Sub OnReorderLevelChanged() End Sub - Partial Private Sub OnResolveMethodChanging(ByVal value As String) + Private Partial Sub OnResolveMethodChanging(ByVal value As String) End Sub - Partial Private Sub OnResolveMethodChanged() + Private Partial Sub OnResolveMethodChanged() End Sub - Partial Private Sub OnSupplierIDChanging(ByVal value As Nullable(Of Integer)) + Private Partial Sub OnSupplierIDChanging(ByVal value As Nullable(Of Integer)) End Sub - Partial Private Sub OnSupplierIDChanged() + Private Partial Sub OnSupplierIDChanged() End Sub - Partial Private Sub OnSupplierNameChanging(ByVal value As String) + Private Partial Sub OnSupplierNameChanging(ByVal value As String) End Sub - Partial Private Sub OnSupplierNameChanged() + Private Partial Sub OnSupplierNameChanged() End Sub - Partial Private Sub OnUnitPriceChanging(ByVal value As Nullable(Of Decimal)) + Private Partial Sub OnUnitPriceChanging(ByVal value As Nullable(Of Decimal)) End Sub - Partial Private Sub OnUnitPriceChanged() + Private Partial Sub OnUnitPriceChanged() End Sub - Partial Private Sub OnUnitsInStockChanging(ByVal value As Nullable(Of Short)) + Private Partial Sub OnUnitsInStockChanging(ByVal value As Nullable(Of Short)) End Sub - Partial Private Sub OnUnitsInStockChanged() + Private Partial Sub OnUnitsInStockChanged() End Sub - Partial Private Sub OnUnitsOnOrderChanging(ByVal value As Nullable(Of Short)) + Private Partial Sub OnUnitsOnOrderChanging(ByVal value As Nullable(Of Short)) End Sub - Partial Private Sub OnUnitsOnOrderChanged() + Private Partial Sub OnUnitsOnOrderChanged() End Sub - Partial Private Sub OnDiscontinueProductInvoking() + Private Partial Sub OnDiscontinueProductInvoking() End Sub - Partial Private Sub OnDiscontinueProductInvoked() + Private Partial Sub OnDiscontinueProductInvoked() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the associated entity. ''' - + _ Public Property Category() As Category Get If (Me._category Is Nothing) Then @@ -1502,96 +1502,96 @@ Namespace EFCoreModels.Northwind End Get Set Dim previous As Category = Me.Category - If (Object.Equals(previous, Value) = False) Then - Me.ValidateProperty("Category", Value) + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Category", value) If (Not (previous) Is Nothing) Then Me._category.Entity = Nothing previous.Products.Remove(Me) End If - If (Not (Value) Is Nothing) Then - Me.CategoryID = Value.CategoryID + If (Not (value) Is Nothing) Then + Me.CategoryID = value.CategoryID Else Me.CategoryID = CType(Nothing, Nullable(Of Integer)) End If - Me._category.Entity = Value - If (Not (Value) Is Nothing) Then - Value.Products.Add(Me) + Me._category.Entity = value + If (Not (value) Is Nothing) Then + value.Products.Add(Me) End If Me.RaisePropertyChanged("Category") End If End Set End Property - + ''' ''' Gets or sets the 'CategoryID' value. ''' - + _ Public Property CategoryID() As Nullable(Of Integer) Get Return Me._categoryID End Get Set - If (Me._categoryID.Equals(Value) = False) Then - Me.OnCategoryIDChanging(Value) + If (Me._categoryID.Equals(value) = false) Then + Me.OnCategoryIDChanging(value) Me.RaiseDataMemberChanging("CategoryID") - Me.ValidateProperty("CategoryID", Value) - Me._categoryID = Value + Me.ValidateProperty("CategoryID", value) + Me._categoryID = value Me.RaiseDataMemberChanged("CategoryID") - Me.OnCategoryIDChanged() + Me.OnCategoryIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'CategoryName' value. ''' - + _ Public Property CategoryName() As String Get Return Me._categoryName End Get Set - If (String.Equals(Me._categoryName, Value) = False) Then - Me.OnCategoryNameChanging(Value) - Me.ValidateProperty("CategoryName", Value) - Me._categoryName = Value + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value Me.RaisePropertyChanged("CategoryName") - Me.OnCategoryNameChanged() + Me.OnCategoryNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'Discontinued' value. ''' - + _ Public Property Discontinued() As Boolean Get Return Me._discontinued End Get Set - If ((Me._discontinued = Value) _ - = False) Then - Me.OnDiscontinuedChanging(Value) + If ((Me._discontinued = value) _ + = false) Then + Me.OnDiscontinuedChanging(value) Me.RaiseDataMemberChanging("Discontinued") - Me.ValidateProperty("Discontinued", Value) - Me._discontinued = Value + Me.ValidateProperty("Discontinued", value) + Me._discontinued = value Me.RaiseDataMemberChanged("Discontinued") - Me.OnDiscontinuedChanged() + Me.OnDiscontinuedChanged End If End Set End Property - + ''' ''' Gets the collection of associated entity instances. ''' - + _ Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) Get If (Me._order_Details Is Nothing) Then @@ -1600,263 +1600,263 @@ Namespace EFCoreModels.Northwind Return Me._order_Details End Get End Property - + ''' ''' Gets or sets the 'ProductID' value. ''' - + _ Public Property ProductID() As Integer Get Return Me._productID End Get Set - If ((Me._productID = Value) _ - = False) Then - Me.OnProductIDChanging(Value) - Me.ValidateProperty("ProductID", Value) - Me._productID = Value + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.ValidateProperty("ProductID", value) + Me._productID = value Me.RaisePropertyChanged("ProductID") - Me.OnProductIDChanged() + Me.OnProductIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'ProductName' value. ''' - + _ Public Property ProductName() As String Get Return Me._productName End Get Set - If (String.Equals(Me._productName, Value) = False) Then - Me.OnProductNameChanging(Value) + If (String.Equals(Me._productName, value) = false) Then + Me.OnProductNameChanging(value) Me.RaiseDataMemberChanging("ProductName") - Me.ValidateProperty("ProductName", Value) - Me._productName = Value + Me.ValidateProperty("ProductName", value) + Me._productName = value Me.RaiseDataMemberChanged("ProductName") - Me.OnProductNameChanged() + Me.OnProductNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'QuantityPerUnit' value. ''' - + _ Public Property QuantityPerUnit() As String Get Return Me._quantityPerUnit End Get Set - If (String.Equals(Me._quantityPerUnit, Value) = False) Then - Me.OnQuantityPerUnitChanging(Value) + If (String.Equals(Me._quantityPerUnit, value) = false) Then + Me.OnQuantityPerUnitChanging(value) Me.RaiseDataMemberChanging("QuantityPerUnit") - Me.ValidateProperty("QuantityPerUnit", Value) - Me._quantityPerUnit = Value + Me.ValidateProperty("QuantityPerUnit", value) + Me._quantityPerUnit = value Me.RaiseDataMemberChanged("QuantityPerUnit") - Me.OnQuantityPerUnitChanged() + Me.OnQuantityPerUnitChanged End If End Set End Property - + ''' ''' Gets or sets the 'ReorderLevel' value. ''' - + _ Public Property ReorderLevel() As Nullable(Of Short) Get Return Me._reorderLevel End Get Set - If (Me._reorderLevel.Equals(Value) = False) Then - Me.OnReorderLevelChanging(Value) + If (Me._reorderLevel.Equals(value) = false) Then + Me.OnReorderLevelChanging(value) Me.RaiseDataMemberChanging("ReorderLevel") - Me.ValidateProperty("ReorderLevel", Value) - Me._reorderLevel = Value + Me.ValidateProperty("ReorderLevel", value) + Me._reorderLevel = value Me.RaiseDataMemberChanged("ReorderLevel") - Me.OnReorderLevelChanged() + Me.OnReorderLevelChanged End If End Set End Property - + ''' ''' Gets or sets the 'ResolveMethod' value. ''' - + _ Public Property ResolveMethod() As String Get Return Me._resolveMethod End Get Set - If (String.Equals(Me._resolveMethod, Value) = False) Then - Me.OnResolveMethodChanging(Value) + If (String.Equals(Me._resolveMethod, value) = false) Then + Me.OnResolveMethodChanging(value) Me.RaiseDataMemberChanging("ResolveMethod") - Me.ValidateProperty("ResolveMethod", Value) - Me._resolveMethod = Value + Me.ValidateProperty("ResolveMethod", value) + Me._resolveMethod = value Me.RaiseDataMemberChanged("ResolveMethod") - Me.OnResolveMethodChanged() + Me.OnResolveMethodChanged End If End Set End Property - + ''' ''' Gets or sets the 'SupplierID' value. ''' - + _ Public Property SupplierID() As Nullable(Of Integer) Get Return Me._supplierID End Get Set - If (Me._supplierID.Equals(Value) = False) Then - Me.OnSupplierIDChanging(Value) + If (Me._supplierID.Equals(value) = false) Then + Me.OnSupplierIDChanging(value) Me.RaiseDataMemberChanging("SupplierID") - Me.ValidateProperty("SupplierID", Value) - Me._supplierID = Value + Me.ValidateProperty("SupplierID", value) + Me._supplierID = value Me.RaiseDataMemberChanged("SupplierID") - Me.OnSupplierIDChanged() + Me.OnSupplierIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'SupplierName' value. ''' - + _ Public Property SupplierName() As String Get Return Me._supplierName End Get Set - If (String.Equals(Me._supplierName, Value) = False) Then - Me.OnSupplierNameChanging(Value) - Me.ValidateProperty("SupplierName", Value) - Me._supplierName = Value + If (String.Equals(Me._supplierName, value) = false) Then + Me.OnSupplierNameChanging(value) + Me.ValidateProperty("SupplierName", value) + Me._supplierName = value Me.RaisePropertyChanged("SupplierName") - Me.OnSupplierNameChanged() + Me.OnSupplierNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'UnitPrice' value. ''' - + _ Public Property UnitPrice() As Nullable(Of Decimal) Get Return Me._unitPrice End Get Set - If (Me._unitPrice.Equals(Value) = False) Then - Me.OnUnitPriceChanging(Value) + If (Me._unitPrice.Equals(value) = false) Then + Me.OnUnitPriceChanging(value) Me.RaiseDataMemberChanging("UnitPrice") - Me.ValidateProperty("UnitPrice", Value) - Me._unitPrice = Value + Me.ValidateProperty("UnitPrice", value) + Me._unitPrice = value Me.RaiseDataMemberChanged("UnitPrice") - Me.OnUnitPriceChanged() + Me.OnUnitPriceChanged End If End Set End Property - + ''' ''' Gets or sets the 'UnitsInStock' value. ''' - + _ Public Property UnitsInStock() As Nullable(Of Short) Get Return Me._unitsInStock End Get Set - If (Me._unitsInStock.Equals(Value) = False) Then - Me.OnUnitsInStockChanging(Value) + If (Me._unitsInStock.Equals(value) = false) Then + Me.OnUnitsInStockChanging(value) Me.RaiseDataMemberChanging("UnitsInStock") - Me.ValidateProperty("UnitsInStock", Value) - Me._unitsInStock = Value + Me.ValidateProperty("UnitsInStock", value) + Me._unitsInStock = value Me.RaiseDataMemberChanged("UnitsInStock") - Me.OnUnitsInStockChanged() + Me.OnUnitsInStockChanged End If End Set End Property - + ''' ''' Gets or sets the 'UnitsOnOrder' value. ''' - + _ Public Property UnitsOnOrder() As Nullable(Of Short) Get Return Me._unitsOnOrder End Get Set - If (Me._unitsOnOrder.Equals(Value) = False) Then - Me.OnUnitsOnOrderChanging(Value) + If (Me._unitsOnOrder.Equals(value) = false) Then + Me.OnUnitsOnOrderChanging(value) Me.RaiseDataMemberChanging("UnitsOnOrder") - Me.ValidateProperty("UnitsOnOrder", Value) - Me._unitsOnOrder = Value + Me.ValidateProperty("UnitsOnOrder", value) + Me._unitsOnOrder = value Me.RaiseDataMemberChanged("UnitsOnOrder") - Me.OnUnitsOnOrderChanged() + Me.OnUnitsOnOrderChanged End If End Set End Property - + ''' ''' Gets a value indicating whether the 'DiscontinueProduct' action has been invoked on this entity. ''' - + _ Public ReadOnly Property IsDiscontinueProductInvoked() As Boolean Get Return MyBase.IsActionInvoked("DiscontinueProduct") End Get End Property - + ''' ''' Gets a value indicating whether the 'DiscontinueProduct' method can be invoked on this entity. ''' - + _ Public ReadOnly Property CanDiscontinueProduct() As Boolean Get Return MyBase.CanInvokeAction("DiscontinueProduct") End Get End Property - + Private Function FilterCategory(ByVal entity As Category) As Boolean Return Object.Equals(entity.CategoryID, Me.CategoryID) End Function - + Private Sub AttachOrder_Details(ByVal entity As Order_Detail) entity.Product = Me End Sub - + Private Sub DetachOrder_Details(ByVal entity As Order_Detail) entity.Product = Nothing End Sub - + Private Function FilterOrder_Details(ByVal entity As Order_Detail) As Boolean Return Object.Equals(entity.ProductID, Me.ProductID) End Function - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -1864,152 +1864,152 @@ Namespace EFCoreModels.Northwind Public Overrides Function GetIdentity() As Object Return Me._productID End Function - + ''' ''' Invokes the 'DiscontinueProduct' action on this entity. ''' - + _ Public Sub DiscontinueProduct() - Me.OnDiscontinueProductInvoking() + Me.OnDiscontinueProductInvoking MyBase.InvokeAction("DiscontinueProduct") - Me.OnDiscontinueProductInvoked() + Me.OnDiscontinueProductInvoked End Sub End Class - + ''' ''' The 'ProductInfo' entity class. ''' - + _ Partial Public NotInheritable Class ProductInfo Inherits Entity - + Private _categoryName As String - + Private _productID As Integer - + Private _productName As String - + Private _supplierName As String - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnCategoryNameChanging(ByVal value As String) + Private Partial Sub OnCategoryNameChanging(ByVal value As String) End Sub - Partial Private Sub OnCategoryNameChanged() + Private Partial Sub OnCategoryNameChanged() End Sub - Partial Private Sub OnProductIDChanging(ByVal value As Integer) + Private Partial Sub OnProductIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnProductIDChanged() + Private Partial Sub OnProductIDChanged() End Sub - Partial Private Sub OnProductNameChanging(ByVal value As String) + Private Partial Sub OnProductNameChanging(ByVal value As String) End Sub - Partial Private Sub OnProductNameChanged() + Private Partial Sub OnProductNameChanged() End Sub - Partial Private Sub OnSupplierNameChanging(ByVal value As String) + Private Partial Sub OnSupplierNameChanging(ByVal value As String) End Sub - Partial Private Sub OnSupplierNameChanged() + Private Partial Sub OnSupplierNameChanged() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the 'CategoryName' value. ''' - + _ Public Property CategoryName() As String Get Return Me._categoryName End Get Set - If (String.Equals(Me._categoryName, Value) = False) Then - Me.OnCategoryNameChanging(Value) - Me.ValidateProperty("CategoryName", Value) - Me._categoryName = Value + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value Me.RaisePropertyChanged("CategoryName") - Me.OnCategoryNameChanged() + Me.OnCategoryNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'ProductID' value. ''' - + _ Public Property ProductID() As Integer Get Return Me._productID End Get Set - If ((Me._productID = Value) _ - = False) Then - Me.OnProductIDChanging(Value) - Me.ValidateProperty("ProductID", Value) - Me._productID = Value + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.ValidateProperty("ProductID", value) + Me._productID = value Me.RaisePropertyChanged("ProductID") - Me.OnProductIDChanged() + Me.OnProductIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'ProductName' value. ''' - + _ Public Property ProductName() As String Get Return Me._productName End Get Set - If (String.Equals(Me._productName, Value) = False) Then - Me.OnProductNameChanging(Value) + If (String.Equals(Me._productName, value) = false) Then + Me.OnProductNameChanging(value) Me.RaiseDataMemberChanging("ProductName") - Me.ValidateProperty("ProductName", Value) - Me._productName = Value + Me.ValidateProperty("ProductName", value) + Me._productName = value Me.RaiseDataMemberChanged("ProductName") - Me.OnProductNameChanged() + Me.OnProductNameChanged End If End Set End Property - + ''' ''' Gets or sets the 'SupplierName' value. ''' - + _ Public Property SupplierName() As String Get Return Me._supplierName End Get Set - If (String.Equals(Me._supplierName, Value) = False) Then - Me.OnSupplierNameChanging(Value) - Me.ValidateProperty("SupplierName", Value) - Me._supplierName = Value + If (String.Equals(Me._supplierName, value) = false) Then + Me.OnSupplierNameChanging(value) + Me.ValidateProperty("SupplierName", value) + Me._supplierName = value Me.RaisePropertyChanged("SupplierName") - Me.OnSupplierNameChanged() + Me.OnSupplierNameChanged End If End Set End Property - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -2018,97 +2018,97 @@ Namespace EFCoreModels.Northwind Return Me._productID End Function End Class - + ''' ''' The 'Region' entity class. ''' - + _ Partial Public NotInheritable Class Region Inherits Entity - + Private _regionDescription As String - + Private _regionID As Integer - + Private _territories As EntityCollection(Of Territory) - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnRegionDescriptionChanging(ByVal value As String) + Private Partial Sub OnRegionDescriptionChanging(ByVal value As String) End Sub - Partial Private Sub OnRegionDescriptionChanged() + Private Partial Sub OnRegionDescriptionChanged() End Sub - Partial Private Sub OnRegionIDChanging(ByVal value As Integer) + Private Partial Sub OnRegionIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnRegionIDChanged() + Private Partial Sub OnRegionIDChanged() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the 'RegionDescription' value. ''' - + _ Public Property RegionDescription() As String Get Return Me._regionDescription End Get Set - If (String.Equals(Me._regionDescription, Value) = False) Then - Me.OnRegionDescriptionChanging(Value) + If (String.Equals(Me._regionDescription, value) = false) Then + Me.OnRegionDescriptionChanging(value) Me.RaiseDataMemberChanging("RegionDescription") - Me.ValidateProperty("RegionDescription", Value) - Me._regionDescription = Value + Me.ValidateProperty("RegionDescription", value) + Me._regionDescription = value Me.RaiseDataMemberChanged("RegionDescription") - Me.OnRegionDescriptionChanged() + Me.OnRegionDescriptionChanged End If End Set End Property - + ''' ''' Gets or sets the 'RegionID' value. ''' - + _ Public Property RegionID() As Integer Get Return Me._regionID End Get Set - If ((Me._regionID = Value) _ - = False) Then - Me.OnRegionIDChanging(Value) - Me.ValidateProperty("RegionID", Value) - Me._regionID = Value + If ((Me._regionID = value) _ + = false) Then + Me.OnRegionIDChanging(value) + Me.ValidateProperty("RegionID", value) + Me._regionID = value Me.RaisePropertyChanged("RegionID") - Me.OnRegionIDChanged() + Me.OnRegionIDChanged End If End Set End Property - + ''' ''' Gets the collection of associated entity instances. ''' - + _ Public ReadOnly Property Territories() As EntityCollection(Of Territory) Get If (Me._territories Is Nothing) Then @@ -2117,19 +2117,19 @@ Namespace EFCoreModels.Northwind Return Me._territories End Get End Property - + Private Sub AttachTerritories(ByVal entity As Territory) entity.Region = Me End Sub - + Private Sub DetachTerritories(ByVal entity As Territory) entity.Region = Nothing End Sub - + Private Function FilterTerritories(ByVal entity As Territory) As Boolean Return Object.Equals(entity.RegionID, Me.RegionID) End Function - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -2138,58 +2138,58 @@ Namespace EFCoreModels.Northwind Return Me._regionID End Function End Class - + ''' ''' The 'Territory' entity class. ''' - + _ Partial Public NotInheritable Class Territory Inherits Entity - + Private _region As EntityRef(Of Region) - + Private _regionID As Integer - + Private _territoryDescription As String - + Private _territoryID As String - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub - Partial Private Sub OnRegionIDChanging(ByVal value As Integer) + Private Partial Sub OnRegionIDChanging(ByVal value As Integer) End Sub - Partial Private Sub OnRegionIDChanged() + Private Partial Sub OnRegionIDChanged() End Sub - Partial Private Sub OnTerritoryDescriptionChanging(ByVal value As String) + Private Partial Sub OnTerritoryDescriptionChanging(ByVal value As String) End Sub - Partial Private Sub OnTerritoryDescriptionChanged() + Private Partial Sub OnTerritoryDescriptionChanged() End Sub - Partial Private Sub OnTerritoryIDChanging(ByVal value As String) + Private Partial Sub OnTerritoryIDChanging(ByVal value As String) End Sub - Partial Private Sub OnTerritoryIDChanged() + Private Partial Sub OnTerritoryIDChanged() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() MyBase.New - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets or sets the associated entity. ''' - + _ Public Property Region() As Region Get If (Me._region Is Nothing) Then @@ -2199,97 +2199,97 @@ Namespace EFCoreModels.Northwind End Get Set Dim previous As Region = Me.Region - If (Object.Equals(previous, Value) = False) Then - Me.ValidateProperty("Region", Value) + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Region", value) If (Not (previous) Is Nothing) Then Me._region.Entity = Nothing previous.Territories.Remove(Me) End If - If (Not (Value) Is Nothing) Then - Me.RegionID = Value.RegionID + If (Not (value) Is Nothing) Then + Me.RegionID = value.RegionID Else Me.RegionID = CType(Nothing, Integer) End If - Me._region.Entity = Value - If (Not (Value) Is Nothing) Then - Value.Territories.Add(Me) + Me._region.Entity = value + If (Not (value) Is Nothing) Then + value.Territories.Add(Me) End If Me.RaisePropertyChanged("Region") End If End Set End Property - + ''' ''' Gets or sets the 'RegionID' value. ''' - + _ Public Property RegionID() As Integer Get Return Me._regionID End Get Set - If ((Me._regionID = Value) _ - = False) Then - Me.OnRegionIDChanging(Value) + If ((Me._regionID = value) _ + = false) Then + Me.OnRegionIDChanging(value) Me.RaiseDataMemberChanging("RegionID") - Me.ValidateProperty("RegionID", Value) - Me._regionID = Value + Me.ValidateProperty("RegionID", value) + Me._regionID = value Me.RaiseDataMemberChanged("RegionID") - Me.OnRegionIDChanged() + Me.OnRegionIDChanged End If End Set End Property - + ''' ''' Gets or sets the 'TerritoryDescription' value. ''' - + _ Public Property TerritoryDescription() As String Get Return Me._territoryDescription End Get Set - If (String.Equals(Me._territoryDescription, Value) = False) Then - Me.OnTerritoryDescriptionChanging(Value) + If (String.Equals(Me._territoryDescription, value) = false) Then + Me.OnTerritoryDescriptionChanging(value) Me.RaiseDataMemberChanging("TerritoryDescription") - Me.ValidateProperty("TerritoryDescription", Value) - Me._territoryDescription = Value + Me.ValidateProperty("TerritoryDescription", value) + Me._territoryDescription = value Me.RaiseDataMemberChanged("TerritoryDescription") - Me.OnTerritoryDescriptionChanged() + Me.OnTerritoryDescriptionChanged End If End Set End Property - + ''' ''' Gets or sets the 'TerritoryID' value. ''' - + _ Public Property TerritoryID() As String Get Return Me._territoryID End Get Set - If (String.Equals(Me._territoryID, Value) = False) Then - Me.OnTerritoryIDChanging(Value) - Me.ValidateProperty("TerritoryID", Value) - Me._territoryID = Value + If (String.Equals(Me._territoryID, value) = false) Then + Me.OnTerritoryIDChanging(value) + Me.ValidateProperty("TerritoryID", value) + Me._territoryID = value Me.RaisePropertyChanged("TerritoryID") - Me.OnTerritoryIDChanged() + Me.OnTerritoryIDChanged End If End Set End Property - + Private Function FilterRegion(ByVal entity As Region) As Boolean Return Object.Equals(entity.RegionID, Me.RegionID) End Function - + ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -2301,49 +2301,49 @@ Namespace EFCoreModels.Northwind End Namespace Namespace TestDomainServices.EFCore - + ''' ''' The DomainContext corresponding to the 'Northwind' DomainService. ''' Partial Public NotInheritable Class Northwind Inherits DomainContext - -#Region "Extensibility Method Definitions" + + #Region "Extensibility Method Definitions" ''' ''' This method is invoked from the constructor once initialization is complete and ''' can be used for further object setup. ''' - Partial Private Sub OnCreated() + Private Partial Sub OnCreated() End Sub -#End Region - - + #End Region + + ''' ''' Initializes a new instance of the class. ''' Public Sub New() Me.New(New Uri("TestDomainServices-EFCore-Northwind.svc", UriKind.Relative)) End Sub - + ''' ''' Initializes a new instance of the class with the specified service URI. ''' ''' The Northwind service URI. Public Sub New(ByVal serviceUri As Uri) - Me.New(DomainContext.CreateDomainClient(GetType(INorthwindContract), serviceUri, False)) + Me.New(DomainContext.CreateDomainClient(GetType(INorthwindContract), serviceUri, false)) End Sub - + ''' ''' Initializes a new instance of the class with the specified . ''' ''' The DomainClient instance to use for this DomainContext. Public Sub New(ByVal domainClient As DomainClient) MyBase.New(domainClient) - Me.OnCreated() + Me.OnCreated End Sub - + ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' @@ -2352,7 +2352,7 @@ Namespace TestDomainServices.EFCore Return MyBase.EntityContainer.GetEntitySet(Of Category) End Get End Property - + ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' @@ -2361,7 +2361,7 @@ Namespace TestDomainServices.EFCore Return MyBase.EntityContainer.GetEntitySet(Of Customer) End Get End Property - + ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' @@ -2370,7 +2370,7 @@ Namespace TestDomainServices.EFCore Return MyBase.EntityContainer.GetEntitySet(Of Order_Detail) End Get End Property - + ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' @@ -2379,7 +2379,7 @@ Namespace TestDomainServices.EFCore Return MyBase.EntityContainer.GetEntitySet(Of Order) End Get End Property - + ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' @@ -2388,7 +2388,7 @@ Namespace TestDomainServices.EFCore Return MyBase.EntityContainer.GetEntitySet(Of Product) End Get End Property - + ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' @@ -2397,7 +2397,7 @@ Namespace TestDomainServices.EFCore Return MyBase.EntityContainer.GetEntitySet(Of ProductInfo) End Get End Property - + ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' @@ -2406,43 +2406,43 @@ Namespace TestDomainServices.EFCore Return MyBase.EntityContainer.GetEntitySet(Of Region) End Get End Property - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. Public Function GetCategoriesQuery() As EntityQuery(Of Category) Me.ValidateMethod("GetCategoriesQuery", Nothing) - Return MyBase.CreateQuery(Of Category)("GetCategories", Nothing, False, True) + Return MyBase.CreateQuery(Of Category)("GetCategories", Nothing, false, true) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. Public Function GetCustomersQuery() As EntityQuery(Of Customer) Me.ValidateMethod("GetCustomersQuery", Nothing) - Return MyBase.CreateQuery(Of Customer)("GetCustomers", Nothing, False, True) + Return MyBase.CreateQuery(Of Customer)("GetCustomers", Nothing, false, true) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. Public Function GetOrderDetailsQuery() As EntityQuery(Of Order_Detail) Me.ValidateMethod("GetOrderDetailsQuery", Nothing) - Return MyBase.CreateQuery(Of Order_Detail)("GetOrderDetails", Nothing, False, True) + Return MyBase.CreateQuery(Of Order_Detail)("GetOrderDetails", Nothing, false, true) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. Public Function GetOrdersQuery() As EntityQuery(Of Order) Me.ValidateMethod("GetOrdersQuery", Nothing) - Return MyBase.CreateQuery(Of Order)("GetOrders", Nothing, False, True) + Return MyBase.CreateQuery(Of Order)("GetOrders", Nothing, false, true) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductById' query. ''' @@ -2452,27 +2452,27 @@ Namespace TestDomainServices.EFCore Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() parameters.Add("id", id) Me.ValidateMethod("GetProductByIdQuery", parameters) - Return MyBase.CreateQuery(Of Product)("GetProductById", parameters, False, False) + Return MyBase.CreateQuery(Of Product)("GetProductById", parameters, false, false) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. Public Function GetProductInfosQuery() As EntityQuery(Of ProductInfo) Me.ValidateMethod("GetProductInfosQuery", Nothing) - Return MyBase.CreateQuery(Of ProductInfo)("GetProductInfos", Nothing, False, True) + Return MyBase.CreateQuery(Of ProductInfo)("GetProductInfos", Nothing, false, true) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. Public Function GetProductsQuery() As EntityQuery(Of Product) Me.ValidateMethod("GetProductsQuery", Nothing) - Return MyBase.CreateQuery(Of Product)("GetProducts", Nothing, False, True) + Return MyBase.CreateQuery(Of Product)("GetProducts", Nothing, false, true) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegionById' query. ''' @@ -2482,18 +2482,18 @@ Namespace TestDomainServices.EFCore Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)() parameters.Add("id", id) Me.ValidateMethod("GetRegionByIdQuery", parameters) - Return MyBase.CreateQuery(Of Region)("GetRegionById", parameters, False, False) + Return MyBase.CreateQuery(Of Region)("GetRegionById", parameters, false, false) End Function - + ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. Public Function GetRegionsQuery() As EntityQuery(Of Region) Me.ValidateMethod("GetRegionsQuery", Nothing) - Return MyBase.CreateQuery(Of Region)("GetRegions", Nothing, False, True) + Return MyBase.CreateQuery(Of Region)("GetRegions", Nothing, false, true) End Function - + ''' ''' Invokes the 'DiscontinueProduct' method of the specified entity. ''' @@ -2501,7 +2501,7 @@ Namespace TestDomainServices.EFCore Public Sub DiscontinueProduct(ByVal product As Product) product.DiscontinueProduct End Sub - + ''' ''' Creates a new EntityContainer for this DomainContext's EntitySets. ''' @@ -2509,81 +2509,81 @@ Namespace TestDomainServices.EFCore Protected Overrides Function CreateEntityContainer() As EntityContainer Return New NorthwindEntityContainer() End Function - + ''' ''' Service contract for the 'Northwind' DomainService. ''' - + _ Public Interface INorthwindContract - + ''' ''' Asynchronously invokes the 'GetCategories' operation. ''' ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetCategories(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetCategories'. ''' ''' The IAsyncResult returned from 'BeginGetCategories'. ''' The 'QueryResult' returned from the 'GetCategories' operation. Function EndGetCategories(ByVal result As IAsyncResult) As QueryResult(Of Category) - + ''' ''' Asynchronously invokes the 'GetCustomers' operation. ''' ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetCustomers(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetCustomers'. ''' ''' The IAsyncResult returned from 'BeginGetCustomers'. ''' The 'QueryResult' returned from the 'GetCustomers' operation. Function EndGetCustomers(ByVal result As IAsyncResult) As QueryResult(Of Customer) - + ''' ''' Asynchronously invokes the 'GetOrderDetails' operation. ''' ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetOrderDetails(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetOrderDetails'. ''' ''' The IAsyncResult returned from 'BeginGetOrderDetails'. ''' The 'QueryResult' returned from the 'GetOrderDetails' operation. Function EndGetOrderDetails(ByVal result As IAsyncResult) As QueryResult(Of Order_Detail) - + ''' ''' Asynchronously invokes the 'GetOrders' operation. ''' ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetOrders(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetOrders'. ''' ''' The IAsyncResult returned from 'BeginGetOrders'. ''' The 'QueryResult' returned from the 'GetOrders' operation. Function EndGetOrders(ByVal result As IAsyncResult) As QueryResult(Of Order) - + ''' ''' Asynchronously invokes the 'GetProductById' operation. ''' @@ -2591,51 +2591,51 @@ Namespace TestDomainServices.EFCore ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetProductById(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetProductById'. ''' ''' The IAsyncResult returned from 'BeginGetProductById'. ''' The 'QueryResult' returned from the 'GetProductById' operation. Function EndGetProductById(ByVal result As IAsyncResult) As QueryResult(Of Product) - + ''' ''' Asynchronously invokes the 'GetProductInfos' operation. ''' ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetProductInfos(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetProductInfos'. ''' ''' The IAsyncResult returned from 'BeginGetProductInfos'. ''' The 'QueryResult' returned from the 'GetProductInfos' operation. Function EndGetProductInfos(ByVal result As IAsyncResult) As QueryResult(Of ProductInfo) - + ''' ''' Asynchronously invokes the 'GetProducts' operation. ''' ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetProducts(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetProducts'. ''' ''' The IAsyncResult returned from 'BeginGetProducts'. ''' The 'QueryResult' returned from the 'GetProducts' operation. Function EndGetProducts(ByVal result As IAsyncResult) As QueryResult(Of Product) - + ''' ''' Asynchronously invokes the 'GetRegionById' operation. ''' @@ -2643,34 +2643,34 @@ Namespace TestDomainServices.EFCore ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetRegionById(ByVal id As Integer, ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetRegionById'. ''' ''' The IAsyncResult returned from 'BeginGetRegionById'. ''' The 'QueryResult' returned from the 'GetRegionById' operation. Function EndGetRegionById(ByVal result As IAsyncResult) As QueryResult(Of Region) - + ''' ''' Asynchronously invokes the 'GetRegions' operation. ''' ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginGetRegions(ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginGetRegions'. ''' ''' The IAsyncResult returned from 'BeginGetRegions'. ''' The 'QueryResult' returned from the 'GetRegions' operation. Function EndGetRegions(ByVal result As IAsyncResult) As QueryResult(Of Region) - + ''' ''' Asynchronously invokes the 'SubmitChanges' operation. ''' @@ -2678,9 +2678,9 @@ Namespace TestDomainServices.EFCore ''' Callback to invoke on completion. ''' Optional state object. ''' An IAsyncResult that can be used to monitor the request. - + _ Function BeginSubmitChanges(ByVal changeSet As IEnumerable(Of ChangeSetEntry), ByVal callback As AsyncCallback, ByVal asyncState As Object) As IAsyncResult - + ''' ''' Completes the asynchronous operation begun by 'BeginSubmitChanges'. ''' @@ -2688,10 +2688,10 @@ Namespace TestDomainServices.EFCore ''' The collection of change-set entry elements returned from 'SubmitChanges'. Function EndSubmitChanges(ByVal result As IAsyncResult) As IEnumerable(Of ChangeSetEntry) End Interface - + Friend NotInheritable Class NorthwindEntityContainer Inherits EntityContainer - + Public Sub New() MyBase.New Me.CreateEntitySet(Of Category)(EntitySetOperations.All) From 6f25e807733e23eb56f119be4aa4f0b37c766cbd Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 25 Apr 2022 09:07:16 +0200 Subject: [PATCH 72/99] WIP --- .../Test/CodeGenDomainServices.cs | 2 +- .../Scenarios/EFCoreDbContextScenarios.g.cs | 2844 +++++++++++++++++ .../Scenarios/EFCoreDbContextScenarios.g.vb | 2699 ++++++++++++++++ .../Scenarios/EFDbContextScenarios.g.cs | 124 +- ...Services.Common.DomainServices.Test.csproj | 6 + 5 files changed, 5647 insertions(+), 28 deletions(-) create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs create mode 100644 src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index 4ba18840d..2eae7d46b 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -186,7 +186,7 @@ public void TestClientCodegen_EFCoreEFDbCtxDomainServices_FullTypes() string[] sharedFiles = Array.Empty(); // Full type names - TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"FullTypeNames\Scenarios", "CG_Scenarios_EFDbContext_FullTypes", "EFDbContextScenarios.g", + TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"FullTypeNames\Scenarios", "CG_Scenarios_EFDbContext_FullTypes", "EFCoreDbContextScenarios.g", typeof(TestDomainServices.EFCore.Northwind), sharedFiles, true)); } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs new file mode 100644 index 000000000..1325ffd40 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs @@ -0,0 +1,2844 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DbContextModels.Northwind +{ + + + /// + /// The 'Category' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class Category : global::OpenRiaServices.Client.Entity + { + + private int _categoryID; + + private string _categoryName; + + private string _description; + + private byte[] _picture; + + private global::OpenRiaServices.Client.EntityCollection _products; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryIDChanging(int value); + partial void OnCategoryIDChanged(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnDescriptionChanging(string value); + partial void OnDescriptionChanged(); + partial void OnPictureChanging(byte[] value); + partial void OnPictureChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Category() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'CategoryID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int CategoryID + { + get + { + return this._categoryID; + } + set + { + if ((this._categoryID != value)) + { + this.OnCategoryIDChanging(value); + this.ValidateProperty("CategoryID", value); + this._categoryID = value; + this.RaisePropertyChanged("CategoryID"); + this.OnCategoryIDChanged(); + } + } + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.RaiseDataMemberChanging("CategoryName"); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaiseDataMemberChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Description' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Description + { + get + { + return this._description; + } + set + { + if ((this._description != value)) + { + this.OnDescriptionChanging(value); + this.RaiseDataMemberChanging("Description"); + this.ValidateProperty("Description", value); + this._description = value; + this.RaiseDataMemberChanged("Description"); + this.OnDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'Picture' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public byte[] Picture + { + get + { + return this._picture; + } + set + { + if ((this._picture != value)) + { + this.OnPictureChanging(value); + this.RaiseDataMemberChanging("Picture"); + this.ValidateProperty("Picture", value); + this._picture = value; + this.RaiseDataMemberChanged("Picture"); + this.OnPictureChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID")] + public global::OpenRiaServices.Client.EntityCollection Products + { + get + { + if ((this._products == null)) + { + this._products = new global::OpenRiaServices.Client.EntityCollection(this, "Products", this.FilterProducts, this.AttachProducts, this.DetachProducts); + } + return this._products; + } + } + + private void AttachProducts(global::DbContextModels.Northwind.Product entity) + { + entity.Category = this; + } + + private void DetachProducts(global::DbContextModels.Northwind.Product entity) + { + entity.Category = null; + } + + private bool FilterProducts(global::DbContextModels.Northwind.Product entity) + { + return (entity.CategoryID == this.CategoryID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._categoryID; + } + } + + /// + /// The 'Customer' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class Customer : global::OpenRiaServices.Client.Entity + { + + private string _address; + + private string _city; + + private string _companyName; + + private string _contactName; + + private string _contactTitle; + + private string _country; + + private string _customerID; + + private string _fax; + + private global::OpenRiaServices.Client.EntityCollection _orders; + + private string _phone; + + private string _postalCode; + + private string _region; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnAddressChanging(string value); + partial void OnAddressChanged(); + partial void OnCityChanging(string value); + partial void OnCityChanged(); + partial void OnCompanyNameChanging(string value); + partial void OnCompanyNameChanged(); + partial void OnContactNameChanging(string value); + partial void OnContactNameChanged(); + partial void OnContactTitleChanging(string value); + partial void OnContactTitleChanged(); + partial void OnCountryChanging(string value); + partial void OnCountryChanged(); + partial void OnCustomerIDChanging(string value); + partial void OnCustomerIDChanged(); + partial void OnFaxChanging(string value); + partial void OnFaxChanged(); + partial void OnPhoneChanging(string value); + partial void OnPhoneChanged(); + partial void OnPostalCodeChanging(string value); + partial void OnPostalCodeChanged(); + partial void OnRegionChanging(string value); + partial void OnRegionChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Customer() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'Address' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Address + { + get + { + return this._address; + } + set + { + if ((this._address != value)) + { + this.OnAddressChanging(value); + this.RaiseDataMemberChanging("Address"); + this.ValidateProperty("Address", value); + this._address = value; + this.RaiseDataMemberChanged("Address"); + this.OnAddressChanged(); + } + } + } + + /// + /// Gets or sets the 'City' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string City + { + get + { + return this._city; + } + set + { + if ((this._city != value)) + { + this.OnCityChanging(value); + this.RaiseDataMemberChanging("City"); + this.ValidateProperty("City", value); + this._city = value; + this.RaiseDataMemberChanged("City"); + this.OnCityChanged(); + } + } + } + + /// + /// Gets or sets the 'CompanyName' value. + /// + [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string CompanyName + { + get + { + return this._companyName; + } + set + { + if ((this._companyName != value)) + { + this.OnCompanyNameChanging(value); + this.RaiseDataMemberChanging("CompanyName"); + this.ValidateProperty("CompanyName", value); + this._companyName = value; + this.RaiseDataMemberChanged("CompanyName"); + this.OnCompanyNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ContactName' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ContactName + { + get + { + return this._contactName; + } + set + { + if ((this._contactName != value)) + { + this.OnContactNameChanging(value); + this.RaiseDataMemberChanging("ContactName"); + this.ValidateProperty("ContactName", value); + this._contactName = value; + this.RaiseDataMemberChanged("ContactName"); + this.OnContactNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ContactTitle' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ContactTitle + { + get + { + return this._contactTitle; + } + set + { + if ((this._contactTitle != value)) + { + this.OnContactTitleChanging(value); + this.RaiseDataMemberChanging("ContactTitle"); + this.ValidateProperty("ContactTitle", value); + this._contactTitle = value; + this.RaiseDataMemberChanged("ContactTitle"); + this.OnContactTitleChanged(); + } + } + } + + /// + /// Gets or sets the 'Country' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Country + { + get + { + return this._country; + } + set + { + if ((this._country != value)) + { + this.OnCountryChanging(value); + this.RaiseDataMemberChanging("Country"); + this.ValidateProperty("Country", value); + this._country = value; + this.RaiseDataMemberChanged("Country"); + this.OnCountryChanged(); + } + } + } + + /// + /// Gets or sets the 'CustomerID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(5)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string CustomerID + { + get + { + return this._customerID; + } + set + { + if ((this._customerID != value)) + { + this.OnCustomerIDChanging(value); + this.ValidateProperty("CustomerID", value); + this._customerID = value; + this.RaisePropertyChanged("CustomerID"); + this.OnCustomerIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Fax' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Fax + { + get + { + return this._fax; + } + set + { + if ((this._fax != value)) + { + this.OnFaxChanging(value); + this.RaiseDataMemberChanging("Fax"); + this.ValidateProperty("Fax", value); + this._fax = value; + this.RaiseDataMemberChanged("Fax"); + this.OnFaxChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID")] + public global::OpenRiaServices.Client.EntityCollection Orders + { + get + { + if ((this._orders == null)) + { + this._orders = new global::OpenRiaServices.Client.EntityCollection(this, "Orders", this.FilterOrders, this.AttachOrders, this.DetachOrders); + } + return this._orders; + } + } + + /// + /// Gets or sets the 'Phone' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Phone + { + get + { + return this._phone; + } + set + { + if ((this._phone != value)) + { + this.OnPhoneChanging(value); + this.RaiseDataMemberChanging("Phone"); + this.ValidateProperty("Phone", value); + this._phone = value; + this.RaiseDataMemberChanged("Phone"); + this.OnPhoneChanged(); + } + } + } + + /// + /// Gets or sets the 'PostalCode' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string PostalCode + { + get + { + return this._postalCode; + } + set + { + if ((this._postalCode != value)) + { + this.OnPostalCodeChanging(value); + this.RaiseDataMemberChanging("PostalCode"); + this.ValidateProperty("PostalCode", value); + this._postalCode = value; + this.RaiseDataMemberChanged("PostalCode"); + this.OnPostalCodeChanged(); + } + } + } + + /// + /// Gets or sets the 'Region' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string Region + { + get + { + return this._region; + } + set + { + if ((this._region != value)) + { + this.OnRegionChanging(value); + this.RaiseDataMemberChanging("Region"); + this.ValidateProperty("Region", value); + this._region = value; + this.RaiseDataMemberChanged("Region"); + this.OnRegionChanged(); + } + } + } + + private void AttachOrders(global::DbContextModels.Northwind.Order entity) + { + entity.Customer = this; + } + + private void DetachOrders(global::DbContextModels.Northwind.Order entity) + { + entity.Customer = null; + } + + private bool FilterOrders(global::DbContextModels.Northwind.Order entity) + { + return (entity.CustomerID == this.CustomerID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._customerID; + } + } + + /// + /// The 'Order' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class Order : global::OpenRiaServices.Client.Entity + { + + private global::OpenRiaServices.Client.EntityRef _customer; + + private string _customerID; + + private global::System.Nullable _employeeID; + + private string _formattedName; + + private global::System.Nullable _freight; + + private global::OpenRiaServices.Client.EntityCollection _order_Details; + + private global::System.Nullable _orderDate; + + private int _orderID; + + private global::System.Nullable _requiredDate; + + private string _shipAddress; + + private string _shipCity; + + private string _shipCountry; + + private string _shipName; + + private global::System.Nullable _shippedDate; + + private string _shipPostalCode; + + private string _shipRegion; + + private global::System.Nullable _shipVia; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCustomerIDChanging(string value); + partial void OnCustomerIDChanged(); + partial void OnEmployeeIDChanging(global::System.Nullable value); + partial void OnEmployeeIDChanged(); + partial void OnFormattedNameChanging(string value); + partial void OnFormattedNameChanged(); + partial void OnFreightChanging(global::System.Nullable value); + partial void OnFreightChanged(); + partial void OnOrderDateChanging(global::System.Nullable value); + partial void OnOrderDateChanged(); + partial void OnOrderIDChanging(int value); + partial void OnOrderIDChanged(); + partial void OnRequiredDateChanging(global::System.Nullable value); + partial void OnRequiredDateChanged(); + partial void OnShipAddressChanging(string value); + partial void OnShipAddressChanged(); + partial void OnShipCityChanging(string value); + partial void OnShipCityChanged(); + partial void OnShipCountryChanging(string value); + partial void OnShipCountryChanged(); + partial void OnShipNameChanging(string value); + partial void OnShipNameChanged(); + partial void OnShippedDateChanging(global::System.Nullable value); + partial void OnShippedDateChanged(); + partial void OnShipPostalCodeChanging(string value); + partial void OnShipPostalCodeChanged(); + partial void OnShipRegionChanging(string value); + partial void OnShipRegionChanged(); + partial void OnShipViaChanging(global::System.Nullable value); + partial void OnShipViaChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Order() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID", IsForeignKey=true)] + public global::DbContextModels.Northwind.Customer Customer + { + get + { + if ((this._customer == null)) + { + this._customer = new global::OpenRiaServices.Client.EntityRef(this, "Customer", this.FilterCustomer); + } + return this._customer.Entity; + } + set + { + global::DbContextModels.Northwind.Customer previous = this.Customer; + if ((previous != value)) + { + this.ValidateProperty("Customer", value); + if ((previous != null)) + { + this._customer.Entity = null; + previous.Orders.Remove(this); + } + if ((value != null)) + { + this.CustomerID = value.CustomerID; + } + else + { + this.CustomerID = default(string); + } + this._customer.Entity = value; + if ((value != null)) + { + value.Orders.Add(this); + } + this.RaisePropertyChanged("Customer"); + } + } + } + + /// + /// Gets or sets the 'CustomerID' value. + /// + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(5)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string CustomerID + { + get + { + return this._customerID; + } + set + { + if ((this._customerID != value)) + { + this.OnCustomerIDChanging(value); + this.RaiseDataMemberChanging("CustomerID"); + this.ValidateProperty("CustomerID", value); + this._customerID = value; + this.RaiseDataMemberChanged("CustomerID"); + this.OnCustomerIDChanged(); + } + } + } + + /// + /// Gets or sets the 'EmployeeID' value. + /// + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable EmployeeID + { + get + { + return this._employeeID; + } + set + { + if ((this._employeeID != value)) + { + this.OnEmployeeIDChanging(value); + this.RaiseDataMemberChanging("EmployeeID"); + this.ValidateProperty("EmployeeID", value); + this._employeeID = value; + this.RaiseDataMemberChanged("EmployeeID"); + this.OnEmployeeIDChanged(); + } + } + } + + /// + /// Gets or sets the 'FormattedName' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false)] + [global::System.ComponentModel.ReadOnlyAttribute(true)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string FormattedName + { + get + { + return this._formattedName; + } + set + { + if ((this._formattedName != value)) + { + this.OnFormattedNameChanging(value); + this.ValidateProperty("FormattedName", value); + this._formattedName = value; + this.RaisePropertyChanged("FormattedName"); + this.OnFormattedNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Freight' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable Freight + { + get + { + return this._freight; + } + set + { + if ((this._freight != value)) + { + this.OnFreightChanging(value); + this.RaiseDataMemberChanging("Freight"); + this.ValidateProperty("Freight", value); + this._freight = value; + this.RaiseDataMemberChanged("Freight"); + this.OnFreightChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID")] + public global::OpenRiaServices.Client.EntityCollection Order_Details + { + get + { + if ((this._order_Details == null)) + { + this._order_Details = new global::OpenRiaServices.Client.EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + } + return this._order_Details; + } + } + + /// + /// Gets or sets the 'OrderDate' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable OrderDate + { + get + { + return this._orderDate; + } + set + { + if ((this._orderDate != value)) + { + this.OnOrderDateChanging(value); + this.RaiseDataMemberChanging("OrderDate"); + this.ValidateProperty("OrderDate", value); + this._orderDate = value; + this.RaiseDataMemberChanged("OrderDate"); + this.OnOrderDateChanged(); + } + } + } + + /// + /// Gets or sets the 'OrderID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int OrderID + { + get + { + return this._orderID; + } + set + { + if ((this._orderID != value)) + { + this.OnOrderIDChanging(value); + this.ValidateProperty("OrderID", value); + this._orderID = value; + this.RaisePropertyChanged("OrderID"); + this.OnOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the 'RequiredDate' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable RequiredDate + { + get + { + return this._requiredDate; + } + set + { + if ((this._requiredDate != value)) + { + this.OnRequiredDateChanging(value); + this.RaiseDataMemberChanging("RequiredDate"); + this.ValidateProperty("RequiredDate", value); + this._requiredDate = value; + this.RaiseDataMemberChanged("RequiredDate"); + this.OnRequiredDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipAddress' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ShipAddress + { + get + { + return this._shipAddress; + } + set + { + if ((this._shipAddress != value)) + { + this.OnShipAddressChanging(value); + this.RaiseDataMemberChanging("ShipAddress"); + this.ValidateProperty("ShipAddress", value); + this._shipAddress = value; + this.RaiseDataMemberChanged("ShipAddress"); + this.OnShipAddressChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipCity' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ShipCity + { + get + { + return this._shipCity; + } + set + { + if ((this._shipCity != value)) + { + this.OnShipCityChanging(value); + this.RaiseDataMemberChanging("ShipCity"); + this.ValidateProperty("ShipCity", value); + this._shipCity = value; + this.RaiseDataMemberChanged("ShipCity"); + this.OnShipCityChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipCountry' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ShipCountry + { + get + { + return this._shipCountry; + } + set + { + if ((this._shipCountry != value)) + { + this.OnShipCountryChanging(value); + this.RaiseDataMemberChanging("ShipCountry"); + this.ValidateProperty("ShipCountry", value); + this._shipCountry = value; + this.RaiseDataMemberChanged("ShipCountry"); + this.OnShipCountryChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipName' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ShipName + { + get + { + return this._shipName; + } + set + { + if ((this._shipName != value)) + { + this.OnShipNameChanging(value); + this.RaiseDataMemberChanging("ShipName"); + this.ValidateProperty("ShipName", value); + this._shipName = value; + this.RaiseDataMemberChanged("ShipName"); + this.OnShipNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ShippedDate' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable ShippedDate + { + get + { + return this._shippedDate; + } + set + { + if ((this._shippedDate != value)) + { + this.OnShippedDateChanging(value); + this.RaiseDataMemberChanging("ShippedDate"); + this.ValidateProperty("ShippedDate", value); + this._shippedDate = value; + this.RaiseDataMemberChanged("ShippedDate"); + this.OnShippedDateChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipPostalCode' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ShipPostalCode + { + get + { + return this._shipPostalCode; + } + set + { + if ((this._shipPostalCode != value)) + { + this.OnShipPostalCodeChanging(value); + this.RaiseDataMemberChanging("ShipPostalCode"); + this.ValidateProperty("ShipPostalCode", value); + this._shipPostalCode = value; + this.RaiseDataMemberChanged("ShipPostalCode"); + this.OnShipPostalCodeChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipRegion' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ShipRegion + { + get + { + return this._shipRegion; + } + set + { + if ((this._shipRegion != value)) + { + this.OnShipRegionChanging(value); + this.RaiseDataMemberChanging("ShipRegion"); + this.ValidateProperty("ShipRegion", value); + this._shipRegion = value; + this.RaiseDataMemberChanged("ShipRegion"); + this.OnShipRegionChanged(); + } + } + } + + /// + /// Gets or sets the 'ShipVia' value. + /// + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable ShipVia + { + get + { + return this._shipVia; + } + set + { + if ((this._shipVia != value)) + { + this.OnShipViaChanging(value); + this.RaiseDataMemberChanging("ShipVia"); + this.ValidateProperty("ShipVia", value); + this._shipVia = value; + this.RaiseDataMemberChanged("ShipVia"); + this.OnShipViaChanged(); + } + } + } + + private bool FilterCustomer(global::DbContextModels.Northwind.Customer entity) + { + return (entity.CustomerID == this.CustomerID); + } + + private void AttachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + { + entity.Order = this; + } + + private void DetachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + { + entity.Order = null; + } + + private bool FilterOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + { + return (entity.OrderID == this.OrderID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._orderID; + } + } + + /// + /// The 'Order_Detail' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class Order_Detail : global::OpenRiaServices.Client.Entity + { + + private float _discount; + + private global::OpenRiaServices.Client.EntityRef _order; + + private int _orderID; + + private global::OpenRiaServices.Client.EntityRef _product; + + private int _productID; + + private short _quantity; + + private decimal _unitPrice; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnDiscountChanging(float value); + partial void OnDiscountChanged(); + partial void OnOrderIDChanging(int value); + partial void OnOrderIDChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnQuantityChanging(short value); + partial void OnQuantityChanged(); + partial void OnUnitPriceChanging(decimal value); + partial void OnUnitPriceChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Order_Detail() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'Discount' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public float Discount + { + get + { + return this._discount; + } + set + { + if ((this._discount != value)) + { + this.OnDiscountChanging(value); + this.RaiseDataMemberChanging("Discount"); + this.ValidateProperty("Discount", value); + this._discount = value; + this.RaiseDataMemberChanged("Discount"); + this.OnDiscountChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID", IsForeignKey=true)] + public global::DbContextModels.Northwind.Order Order + { + get + { + if ((this._order == null)) + { + this._order = new global::OpenRiaServices.Client.EntityRef(this, "Order", this.FilterOrder); + } + return this._order.Entity; + } + set + { + global::DbContextModels.Northwind.Order previous = this.Order; + if ((previous != value)) + { + this.ValidateProperty("Order", value); + if ((previous != null)) + { + this._order.Entity = null; + previous.Order_Details.Remove(this); + } + if ((value != null)) + { + this.OrderID = value.OrderID; + } + else + { + this.OrderID = default(int); + } + this._order.Entity = value; + if ((value != null)) + { + value.Order_Details.Add(this); + } + this.RaisePropertyChanged("Order"); + } + } + } + + /// + /// Gets or sets the 'OrderID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int OrderID + { + get + { + return this._orderID; + } + set + { + if ((this._orderID != value)) + { + this.OnOrderIDChanging(value); + this.ValidateProperty("OrderID", value); + this._orderID = value; + this.RaisePropertyChanged("OrderID"); + this.OnOrderIDChanged(); + } + } + } + + /// + /// Gets or sets the associated entity. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID", IsForeignKey=true)] + public global::DbContextModels.Northwind.Product Product + { + get + { + if ((this._product == null)) + { + this._product = new global::OpenRiaServices.Client.EntityRef(this, "Product", this.FilterProduct); + } + return this._product.Entity; + } + set + { + global::DbContextModels.Northwind.Product previous = this.Product; + if ((previous != value)) + { + this.ValidateProperty("Product", value); + if ((previous != null)) + { + this._product.Entity = null; + previous.Order_Details.Remove(this); + } + if ((value != null)) + { + this.ProductID = value.ProductID; + } + else + { + this.ProductID = default(int); + } + this._product.Entity = value; + if ((value != null)) + { + value.Order_Details.Add(this); + } + this.RaisePropertyChanged("Product"); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'Quantity' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public short Quantity + { + get + { + return this._quantity; + } + set + { + if ((this._quantity != value)) + { + this.OnQuantityChanging(value); + this.RaiseDataMemberChanging("Quantity"); + this.ValidateProperty("Quantity", value); + this._quantity = value; + this.RaiseDataMemberChanged("Quantity"); + this.OnQuantityChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitPrice' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public decimal UnitPrice + { + get + { + return this._unitPrice; + } + set + { + if ((this._unitPrice != value)) + { + this.OnUnitPriceChanging(value); + this.RaiseDataMemberChanging("UnitPrice"); + this.ValidateProperty("UnitPrice", value); + this._unitPrice = value; + this.RaiseDataMemberChanged("UnitPrice"); + this.OnUnitPriceChanged(); + } + } + } + + private bool FilterOrder(global::DbContextModels.Northwind.Order entity) + { + return (entity.OrderID == this.OrderID); + } + + private bool FilterProduct(global::DbContextModels.Northwind.Product entity) + { + return (entity.ProductID == this.ProductID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return global::OpenRiaServices.Client.EntityKey.Create(this._orderID, this._productID); + } + } + + /// + /// The 'Product' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class Product : global::OpenRiaServices.Client.Entity + { + + private global::OpenRiaServices.Client.EntityRef _category; + + private global::System.Nullable _categoryID; + + private string _categoryName; + + private bool _discontinued; + + private global::OpenRiaServices.Client.EntityCollection _order_Details; + + private int _productID; + + private string _productName; + + private string _quantityPerUnit; + + private global::System.Nullable _reorderLevel; + + private string _resolveMethod; + + private global::System.Nullable _supplierID; + + private string _supplierName; + + private global::System.Nullable _unitPrice; + + private global::System.Nullable _unitsInStock; + + private global::System.Nullable _unitsOnOrder; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryIDChanging(global::System.Nullable value); + partial void OnCategoryIDChanged(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnDiscontinuedChanging(bool value); + partial void OnDiscontinuedChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnProductNameChanging(string value); + partial void OnProductNameChanged(); + partial void OnQuantityPerUnitChanging(string value); + partial void OnQuantityPerUnitChanged(); + partial void OnReorderLevelChanging(global::System.Nullable value); + partial void OnReorderLevelChanged(); + partial void OnResolveMethodChanging(string value); + partial void OnResolveMethodChanged(); + partial void OnSupplierIDChanging(global::System.Nullable value); + partial void OnSupplierIDChanged(); + partial void OnSupplierNameChanging(string value); + partial void OnSupplierNameChanged(); + partial void OnUnitPriceChanging(global::System.Nullable value); + partial void OnUnitPriceChanged(); + partial void OnUnitsInStockChanging(global::System.Nullable value); + partial void OnUnitsInStockChanged(); + partial void OnUnitsOnOrderChanging(global::System.Nullable value); + partial void OnUnitsOnOrderChanged(); + partial void OnDiscontinueProductInvoking(); + partial void OnDiscontinueProductInvoked(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Product() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID", IsForeignKey=true)] + public global::DbContextModels.Northwind.Category Category + { + get + { + if ((this._category == null)) + { + this._category = new global::OpenRiaServices.Client.EntityRef(this, "Category", this.FilterCategory); + } + return this._category.Entity; + } + set + { + global::DbContextModels.Northwind.Category previous = this.Category; + if ((previous != value)) + { + this.ValidateProperty("Category", value); + if ((previous != null)) + { + this._category.Entity = null; + previous.Products.Remove(this); + } + if ((value != null)) + { + this.CategoryID = value.CategoryID; + } + else + { + this.CategoryID = default(global::System.Nullable); + } + this._category.Entity = value; + if ((value != null)) + { + value.Products.Add(this); + } + this.RaisePropertyChanged("Category"); + } + } + } + + /// + /// Gets or sets the 'CategoryID' value. + /// + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable CategoryID + { + get + { + return this._categoryID; + } + set + { + if ((this._categoryID != value)) + { + this.OnCategoryIDChanging(value); + this.RaiseDataMemberChanging("CategoryID"); + this.ValidateProperty("CategoryID", value); + this._categoryID = value; + this.RaiseDataMemberChanged("CategoryID"); + this.OnCategoryIDChanged(); + } + } + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false)] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaisePropertyChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'Discontinued' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public bool Discontinued + { + get + { + return this._discontinued; + } + set + { + if ((this._discontinued != value)) + { + this.OnDiscontinuedChanging(value); + this.RaiseDataMemberChanging("Discontinued"); + this.ValidateProperty("Discontinued", value); + this._discontinued = value; + this.RaiseDataMemberChanged("Discontinued"); + this.OnDiscontinuedChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID")] + public global::OpenRiaServices.Client.EntityCollection Order_Details + { + get + { + if ((this._order_Details == null)) + { + this._order_Details = new global::OpenRiaServices.Client.EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + } + return this._order_Details; + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductName' value. + /// + [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ProductName + { + get + { + return this._productName; + } + set + { + if ((this._productName != value)) + { + this.OnProductNameChanging(value); + this.RaiseDataMemberChanging("ProductName"); + this.ValidateProperty("ProductName", value); + this._productName = value; + this.RaiseDataMemberChanged("ProductName"); + this.OnProductNameChanged(); + } + } + } + + /// + /// Gets or sets the 'QuantityPerUnit' value. + /// + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(20)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string QuantityPerUnit + { + get + { + return this._quantityPerUnit; + } + set + { + if ((this._quantityPerUnit != value)) + { + this.OnQuantityPerUnitChanging(value); + this.RaiseDataMemberChanging("QuantityPerUnit"); + this.ValidateProperty("QuantityPerUnit", value); + this._quantityPerUnit = value; + this.RaiseDataMemberChanged("QuantityPerUnit"); + this.OnQuantityPerUnitChanged(); + } + } + } + + /// + /// Gets or sets the 'ReorderLevel' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable ReorderLevel + { + get + { + return this._reorderLevel; + } + set + { + if ((this._reorderLevel != value)) + { + this.OnReorderLevelChanging(value); + this.RaiseDataMemberChanging("ReorderLevel"); + this.ValidateProperty("ReorderLevel", value); + this._reorderLevel = value; + this.RaiseDataMemberChanged("ReorderLevel"); + this.OnReorderLevelChanged(); + } + } + } + + /// + /// Gets or sets the 'ResolveMethod' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ResolveMethod + { + get + { + return this._resolveMethod; + } + set + { + if ((this._resolveMethod != value)) + { + this.OnResolveMethodChanging(value); + this.RaiseDataMemberChanging("ResolveMethod"); + this.ValidateProperty("ResolveMethod", value); + this._resolveMethod = value; + this.RaiseDataMemberChanged("ResolveMethod"); + this.OnResolveMethodChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierID' value. + /// + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable SupplierID + { + get + { + return this._supplierID; + } + set + { + if ((this._supplierID != value)) + { + this.OnSupplierIDChanging(value); + this.RaiseDataMemberChanging("SupplierID"); + this.ValidateProperty("SupplierID", value); + this._supplierID = value; + this.RaiseDataMemberChanged("SupplierID"); + this.OnSupplierIDChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierName' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string SupplierName + { + get + { + return this._supplierName; + } + set + { + if ((this._supplierName != value)) + { + this.OnSupplierNameChanging(value); + this.ValidateProperty("SupplierName", value); + this._supplierName = value; + this.RaisePropertyChanged("SupplierName"); + this.OnSupplierNameChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitPrice' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable UnitPrice + { + get + { + return this._unitPrice; + } + set + { + if ((this._unitPrice != value)) + { + this.OnUnitPriceChanging(value); + this.RaiseDataMemberChanging("UnitPrice"); + this.ValidateProperty("UnitPrice", value); + this._unitPrice = value; + this.RaiseDataMemberChanged("UnitPrice"); + this.OnUnitPriceChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitsInStock' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable UnitsInStock + { + get + { + return this._unitsInStock; + } + set + { + if ((this._unitsInStock != value)) + { + this.OnUnitsInStockChanging(value); + this.RaiseDataMemberChanging("UnitsInStock"); + this.ValidateProperty("UnitsInStock", value); + this._unitsInStock = value; + this.RaiseDataMemberChanged("UnitsInStock"); + this.OnUnitsInStockChanged(); + } + } + } + + /// + /// Gets or sets the 'UnitsOnOrder' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public global::System.Nullable UnitsOnOrder + { + get + { + return this._unitsOnOrder; + } + set + { + if ((this._unitsOnOrder != value)) + { + this.OnUnitsOnOrderChanging(value); + this.RaiseDataMemberChanging("UnitsOnOrder"); + this.ValidateProperty("UnitsOnOrder", value); + this._unitsOnOrder = value; + this.RaiseDataMemberChanged("UnitsOnOrder"); + this.OnUnitsOnOrderChanged(); + } + } + } + + /// + /// Gets a value indicating whether the 'DiscontinueProduct' action has been invoked on this entity. + /// + [global::System.ComponentModel.DataAnnotations.DisplayAttribute(AutoGenerateField=false)] + public bool IsDiscontinueProductInvoked + { + get + { + return base.IsActionInvoked("DiscontinueProduct"); + } + } + + /// + /// Gets a value indicating whether the 'DiscontinueProduct' method can be invoked on this entity. + /// + [global::System.ComponentModel.DataAnnotations.DisplayAttribute(AutoGenerateField=false)] + public bool CanDiscontinueProduct + { + get + { + return base.CanInvokeAction("DiscontinueProduct"); + } + } + + private bool FilterCategory(global::DbContextModels.Northwind.Category entity) + { + return (entity.CategoryID == this.CategoryID); + } + + private void AttachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + { + entity.Product = this; + } + + private void DetachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + { + entity.Product = null; + } + + private bool FilterOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + { + return (entity.ProductID == this.ProductID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._productID; + } + + /// + /// Invokes the 'DiscontinueProduct' action on this entity. + /// + [global::OpenRiaServices.Client.EntityAction("DiscontinueProduct", AllowMultipleInvocations=false)] + public void DiscontinueProduct() + { + this.OnDiscontinueProductInvoking(); + base.InvokeAction("DiscontinueProduct"); + this.OnDiscontinueProductInvoked(); + } + } + + /// + /// The 'ProductInfo' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class ProductInfo : global::OpenRiaServices.Client.Entity + { + + private string _categoryName; + + private int _productID; + + private string _productName; + + private string _supplierName; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnCategoryNameChanging(string value); + partial void OnCategoryNameChanged(); + partial void OnProductIDChanging(int value); + partial void OnProductIDChanged(); + partial void OnProductNameChanging(string value); + partial void OnProductNameChanged(); + partial void OnSupplierNameChanging(string value); + partial void OnSupplierNameChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public ProductInfo() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'CategoryName' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string CategoryName + { + get + { + return this._categoryName; + } + set + { + if ((this._categoryName != value)) + { + this.OnCategoryNameChanging(value); + this.ValidateProperty("CategoryName", value); + this._categoryName = value; + this.RaisePropertyChanged("CategoryName"); + this.OnCategoryNameChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int ProductID + { + get + { + return this._productID; + } + set + { + if ((this._productID != value)) + { + this.OnProductIDChanging(value); + this.ValidateProperty("ProductID", value); + this._productID = value; + this.RaisePropertyChanged("ProductID"); + this.OnProductIDChanged(); + } + } + } + + /// + /// Gets or sets the 'ProductName' value. + /// + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string ProductName + { + get + { + return this._productName; + } + set + { + if ((this._productName != value)) + { + this.OnProductNameChanging(value); + this.RaiseDataMemberChanging("ProductName"); + this.ValidateProperty("ProductName", value); + this._productName = value; + this.RaiseDataMemberChanged("ProductName"); + this.OnProductNameChanged(); + } + } + } + + /// + /// Gets or sets the 'SupplierName' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string SupplierName + { + get + { + return this._supplierName; + } + set + { + if ((this._supplierName != value)) + { + this.OnSupplierNameChanging(value); + this.ValidateProperty("SupplierName", value); + this._supplierName = value; + this.RaisePropertyChanged("SupplierName"); + this.OnSupplierNameChanged(); + } + } + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._productID; + } + } + + /// + /// The 'Region' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class Region : global::OpenRiaServices.Client.Entity + { + + private string _regionDescription; + + private int _regionID; + + private global::OpenRiaServices.Client.EntityCollection _territories; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnRegionDescriptionChanging(string value); + partial void OnRegionDescriptionChanged(); + partial void OnRegionIDChanging(int value); + partial void OnRegionIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Region() + { + this.OnCreated(); + } + + /// + /// Gets or sets the 'RegionDescription' value. + /// + [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(50)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string RegionDescription + { + get + { + return this._regionDescription; + } + set + { + if ((this._regionDescription != value)) + { + this.OnRegionDescriptionChanging(value); + this.RaiseDataMemberChanging("RegionDescription"); + this.ValidateProperty("RegionDescription", value); + this._regionDescription = value; + this.RaiseDataMemberChanged("RegionDescription"); + this.OnRegionDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'RegionID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int RegionID + { + get + { + return this._regionID; + } + set + { + if ((this._regionID != value)) + { + this.OnRegionIDChanging(value); + this.ValidateProperty("RegionID", value); + this._regionID = value; + this.RaisePropertyChanged("RegionID"); + this.OnRegionIDChanged(); + } + } + } + + /// + /// Gets the collection of associated entity instances. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID")] + [global::System.ComponentModel.DataAnnotations.CompositionAttribute()] + public global::OpenRiaServices.Client.EntityCollection Territories + { + get + { + if ((this._territories == null)) + { + this._territories = new global::OpenRiaServices.Client.EntityCollection(this, "Territories", this.FilterTerritories, this.AttachTerritories, this.DetachTerritories); + } + return this._territories; + } + } + + private void AttachTerritories(global::DbContextModels.Northwind.Territory entity) + { + entity.Region = this; + } + + private void DetachTerritories(global::DbContextModels.Northwind.Territory entity) + { + entity.Region = null; + } + + private bool FilterTerritories(global::DbContextModels.Northwind.Territory entity) + { + return (entity.RegionID == this.RegionID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._regionID; + } + } + + /// + /// The 'Territory' entity class. + /// + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + public sealed partial class Territory : global::OpenRiaServices.Client.Entity + { + + private global::OpenRiaServices.Client.EntityRef _region; + + private int _regionID; + + private string _territoryDescription; + + private string _territoryID; + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + partial void OnRegionIDChanging(int value); + partial void OnRegionIDChanged(); + partial void OnTerritoryDescriptionChanging(string value); + partial void OnTerritoryDescriptionChanged(); + partial void OnTerritoryIDChanging(string value); + partial void OnTerritoryIDChanged(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Territory() + { + this.OnCreated(); + } + + /// + /// Gets or sets the associated entity. + /// + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID", IsForeignKey=true)] + public global::DbContextModels.Northwind.Region Region + { + get + { + if ((this._region == null)) + { + this._region = new global::OpenRiaServices.Client.EntityRef(this, "Region", this.FilterRegion); + } + return this._region.Entity; + } + set + { + global::DbContextModels.Northwind.Region previous = this.Region; + if ((previous != value)) + { + this.ValidateProperty("Region", value); + if ((previous != null)) + { + this._region.Entity = null; + previous.Territories.Remove(this); + } + if ((value != null)) + { + this.RegionID = value.RegionID; + } + else + { + this.RegionID = default(int); + } + this._region.Entity = value; + if ((value != null)) + { + value.Territories.Add(this); + } + this.RaisePropertyChanged("Region"); + } + } + } + + /// + /// Gets or sets the 'RegionID' value. + /// + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public int RegionID + { + get + { + return this._regionID; + } + set + { + if ((this._regionID != value)) + { + this.OnRegionIDChanging(value); + this.RaiseDataMemberChanging("RegionID"); + this.ValidateProperty("RegionID", value); + this._regionID = value; + this.RaiseDataMemberChanged("RegionID"); + this.OnRegionIDChanged(); + } + } + } + + /// + /// Gets or sets the 'TerritoryDescription' value. + /// + [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(50)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string TerritoryDescription + { + get + { + return this._territoryDescription; + } + set + { + if ((this._territoryDescription != value)) + { + this.OnTerritoryDescriptionChanging(value); + this.RaiseDataMemberChanging("TerritoryDescription"); + this.ValidateProperty("TerritoryDescription", value); + this._territoryDescription = value; + this.RaiseDataMemberChanged("TerritoryDescription"); + this.OnTerritoryDescriptionChanged(); + } + } + } + + /// + /// Gets or sets the 'TerritoryID' value. + /// + [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.KeyAttribute()] + [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(20)] + [global::System.Runtime.Serialization.DataMemberAttribute()] + public string TerritoryID + { + get + { + return this._territoryID; + } + set + { + if ((this._territoryID != value)) + { + this.OnTerritoryIDChanging(value); + this.ValidateProperty("TerritoryID", value); + this._territoryID = value; + this.RaisePropertyChanged("TerritoryID"); + this.OnTerritoryIDChanged(); + } + } + } + + private bool FilterRegion(global::DbContextModels.Northwind.Region entity) + { + return (entity.RegionID == this.RegionID); + } + + /// + /// Computes a value from the key fields that uniquely identifies this entity instance. + /// + /// An object instance that uniquely identifies this entity instance. + public override object GetIdentity() + { + return this._territoryID; + } + } +} +namespace TestDomainServices.EFCore +{ + + + /// + /// The DomainContext corresponding to the 'Northwind' DomainService. + /// + public sealed partial class Northwind : global::OpenRiaServices.Client.DomainContext + { + + #region Extensibility Method Definitions + + /// + /// This method is invoked from the constructor once initialization is complete and + /// can be used for further object setup. + /// + partial void OnCreated(); + + #endregion + + + /// + /// Initializes a new instance of the class. + /// + public Northwind() : + this(new global::System.Uri("TestDomainServices-EFCore-Northwind.svc", global::System.UriKind.Relative)) + { + } + + /// + /// Initializes a new instance of the class with the specified service URI. + /// + /// The Northwind service URI. + public Northwind(global::System.Uri serviceUri) : + this(global::OpenRiaServices.Client.DomainContext.CreateDomainClient(typeof(global::TestDomainServices.EFCore.Northwind.INorthwindContract), serviceUri, false)) + { + } + + /// + /// Initializes a new instance of the class with the specified . + /// + /// The DomainClient instance to use for this DomainContext. + public Northwind(global::OpenRiaServices.Client.DomainClient domainClient) : + base(domainClient) + { + this.OnCreated(); + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public global::OpenRiaServices.Client.EntitySet Categories + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public global::OpenRiaServices.Client.EntitySet Customers + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public global::OpenRiaServices.Client.EntitySet Order_Details + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public global::OpenRiaServices.Client.EntitySet Orders + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public global::OpenRiaServices.Client.EntitySet Products + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public global::OpenRiaServices.Client.EntitySet ProductInfos + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets the set of entity instances that have been loaded into this instance. + /// + public global::OpenRiaServices.Client.EntitySet Regions + { + get + { + return base.EntityContainer.GetEntitySet(); + } + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetCategoriesQuery() + { + this.ValidateMethod("GetCategoriesQuery", null); + return base.CreateQuery("GetCategories", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetCustomersQuery() + { + this.ValidateMethod("GetCustomersQuery", null); + return base.CreateQuery("GetCustomers", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetOrderDetailsQuery() + { + this.ValidateMethod("GetOrderDetailsQuery", null); + return base.CreateQuery("GetOrderDetails", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetOrdersQuery() + { + this.ValidateMethod("GetOrdersQuery", null); + return base.CreateQuery("GetOrders", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductById' query. + /// + /// The value for the 'id' parameter of the query. + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetProductByIdQuery(int id) + { + global::System.Collections.Generic.Dictionary parameters = new global::System.Collections.Generic.Dictionary(); + parameters.Add("id", id); + this.ValidateMethod("GetProductByIdQuery", parameters); + return base.CreateQuery("GetProductById", parameters, false, false); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetProductInfosQuery() + { + this.ValidateMethod("GetProductInfosQuery", null); + return base.CreateQuery("GetProductInfos", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetProductsQuery() + { + this.ValidateMethod("GetProductsQuery", null); + return base.CreateQuery("GetProducts", null, false, true); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegionById' query. + /// + /// The value for the 'id' parameter of the query. + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetRegionByIdQuery(int id) + { + global::System.Collections.Generic.Dictionary parameters = new global::System.Collections.Generic.Dictionary(); + parameters.Add("id", id); + this.ValidateMethod("GetRegionByIdQuery", parameters); + return base.CreateQuery("GetRegionById", parameters, false, false); + } + + /// + /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. + /// + /// An EntityQuery that can be loaded to retrieve entity instances. + public global::OpenRiaServices.Client.EntityQuery GetRegionsQuery() + { + this.ValidateMethod("GetRegionsQuery", null); + return base.CreateQuery("GetRegions", null, false, true); + } + + /// + /// Invokes the 'DiscontinueProduct' method of the specified entity. + /// + /// The entity instance. + public void DiscontinueProduct(global::DbContextModels.Northwind.Product product) + { + product.DiscontinueProduct(); + } + + /// + /// Creates a new EntityContainer for this DomainContext's EntitySets. + /// + /// A new container instance. + protected override global::OpenRiaServices.Client.EntityContainer CreateEntityContainer() + { + return new global::TestDomainServices.EFCore.Northwind.NorthwindEntityContainer(); + } + + /// + /// Service contract for the 'Northwind' DomainService. + /// + [global::System.ServiceModel.ServiceContractAttribute()] + public interface INorthwindContract + { + + /// + /// Asynchronously invokes the 'GetCategories' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetCategories", ReplyAction="http://tempuri.org/Northwind/GetCategoriesResponse")] + global::System.IAsyncResult BeginGetCategories(global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetCategories'. + /// + /// The IAsyncResult returned from 'BeginGetCategories'. + /// The 'QueryResult' returned from the 'GetCategories' operation. + global::OpenRiaServices.Client.QueryResult EndGetCategories(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetCustomers' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetCustomers", ReplyAction="http://tempuri.org/Northwind/GetCustomersResponse")] + global::System.IAsyncResult BeginGetCustomers(global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetCustomers'. + /// + /// The IAsyncResult returned from 'BeginGetCustomers'. + /// The 'QueryResult' returned from the 'GetCustomers' operation. + global::OpenRiaServices.Client.QueryResult EndGetCustomers(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetOrderDetails' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetOrderDetails", ReplyAction="http://tempuri.org/Northwind/GetOrderDetailsResponse")] + global::System.IAsyncResult BeginGetOrderDetails(global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetOrderDetails'. + /// + /// The IAsyncResult returned from 'BeginGetOrderDetails'. + /// The 'QueryResult' returned from the 'GetOrderDetails' operation. + global::OpenRiaServices.Client.QueryResult EndGetOrderDetails(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetOrders' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetOrders", ReplyAction="http://tempuri.org/Northwind/GetOrdersResponse")] + global::System.IAsyncResult BeginGetOrders(global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetOrders'. + /// + /// The IAsyncResult returned from 'BeginGetOrders'. + /// The 'QueryResult' returned from the 'GetOrders' operation. + global::OpenRiaServices.Client.QueryResult EndGetOrders(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductById' operation. + /// + /// The value for the 'id' parameter of this action. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProductById", ReplyAction="http://tempuri.org/Northwind/GetProductByIdResponse")] + global::System.IAsyncResult BeginGetProductById(int id, global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductById'. + /// + /// The IAsyncResult returned from 'BeginGetProductById'. + /// The 'QueryResult' returned from the 'GetProductById' operation. + global::OpenRiaServices.Client.QueryResult EndGetProductById(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProductInfos' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProductInfos", ReplyAction="http://tempuri.org/Northwind/GetProductInfosResponse")] + global::System.IAsyncResult BeginGetProductInfos(global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProductInfos'. + /// + /// The IAsyncResult returned from 'BeginGetProductInfos'. + /// The 'QueryResult' returned from the 'GetProductInfos' operation. + global::OpenRiaServices.Client.QueryResult EndGetProductInfos(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetProducts' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetProducts", ReplyAction="http://tempuri.org/Northwind/GetProductsResponse")] + global::System.IAsyncResult BeginGetProducts(global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetProducts'. + /// + /// The IAsyncResult returned from 'BeginGetProducts'. + /// The 'QueryResult' returned from the 'GetProducts' operation. + global::OpenRiaServices.Client.QueryResult EndGetProducts(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetRegionById' operation. + /// + /// The value for the 'id' parameter of this action. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetRegionById", ReplyAction="http://tempuri.org/Northwind/GetRegionByIdResponse")] + global::System.IAsyncResult BeginGetRegionById(int id, global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetRegionById'. + /// + /// The IAsyncResult returned from 'BeginGetRegionById'. + /// The 'QueryResult' returned from the 'GetRegionById' operation. + global::OpenRiaServices.Client.QueryResult EndGetRegionById(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'GetRegions' operation. + /// + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::OpenRiaServices.Client.HasSideEffects(false)] + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/GetRegions", ReplyAction="http://tempuri.org/Northwind/GetRegionsResponse")] + global::System.IAsyncResult BeginGetRegions(global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginGetRegions'. + /// + /// The IAsyncResult returned from 'BeginGetRegions'. + /// The 'QueryResult' returned from the 'GetRegions' operation. + global::OpenRiaServices.Client.QueryResult EndGetRegions(global::System.IAsyncResult result); + + /// + /// Asynchronously invokes the 'SubmitChanges' operation. + /// + /// The change-set to submit. + /// Callback to invoke on completion. + /// Optional state object. + /// An IAsyncResult that can be used to monitor the request. + [global::System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://tempuri.org/Northwind/SubmitChanges", ReplyAction="http://tempuri.org/Northwind/SubmitChangesResponse")] + global::System.IAsyncResult BeginSubmitChanges(global::System.Collections.Generic.IEnumerable changeSet, global::System.AsyncCallback callback, object asyncState); + + /// + /// Completes the asynchronous operation begun by 'BeginSubmitChanges'. + /// + /// The IAsyncResult returned from 'BeginSubmitChanges'. + /// The collection of change-set entry elements returned from 'SubmitChanges'. + global::System.Collections.Generic.IEnumerable EndSubmitChanges(global::System.IAsyncResult result); + } + + internal sealed class NorthwindEntityContainer : global::OpenRiaServices.Client.EntityContainer + { + + public NorthwindEntityContainer() + { + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.Edit); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + } + } + } +} diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb new file mode 100644 index 000000000..b078bce73 --- /dev/null +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb @@ -0,0 +1,2699 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.34209 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Compare Binary +Option Infer On +Option Strict On +Option Explicit On + + +Namespace DbContextModels.Northwind + + ''' + ''' The 'Category' entity class. + ''' + _ + Partial Public NotInheritable Class Category + Inherits Global.OpenRiaServices.Client.Entity + + Private _categoryID As Integer + + Private _categoryName As String + + Private _description As String + + Private _picture() As Byte + + Private _products As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Product) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCategoryIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnCategoryIDChanged() + End Sub + Private Partial Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCategoryNameChanged() + End Sub + Private Partial Sub OnDescriptionChanging(ByVal value As String) + End Sub + Private Partial Sub OnDescriptionChanged() + End Sub + Private Partial Sub OnPictureChanging(ByVal value() As Byte) + End Sub + Private Partial Sub OnPictureChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'CategoryID' value. + ''' + _ + Public Property CategoryID() As Integer + Get + Return Me._categoryID + End Get + Set + If ((Me._categoryID = value) _ + = false) Then + Me.OnCategoryIDChanging(value) + Me.ValidateProperty("CategoryID", value) + Me._categoryID = value + Me.RaisePropertyChanged("CategoryID") + Me.OnCategoryIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + _ + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.RaiseDataMemberChanging("CategoryName") + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value + Me.RaiseDataMemberChanged("CategoryName") + Me.OnCategoryNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Description' value. + ''' + _ + Public Property Description() As String + Get + Return Me._description + End Get + Set + If (String.Equals(Me._description, value) = false) Then + Me.OnDescriptionChanging(value) + Me.RaiseDataMemberChanging("Description") + Me.ValidateProperty("Description", value) + Me._description = value + Me.RaiseDataMemberChanged("Description") + Me.OnDescriptionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Picture' value. + ''' + _ + Public Property Picture() As Byte() + Get + Return Me._picture + End Get + Set + If (Object.Equals(Me._picture, value) = false) Then + Me.OnPictureChanging(value) + Me.RaiseDataMemberChanging("Picture") + Me.ValidateProperty("Picture", value) + Me._picture = value + Me.RaiseDataMemberChanged("Picture") + Me.OnPictureChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Products() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Product) + Get + If (Me._products Is Nothing) Then + Me._products = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Product)(Me, "Products", AddressOf Me.FilterProducts, AddressOf Me.AttachProducts, AddressOf Me.DetachProducts) + End If + Return Me._products + End Get + End Property + + Private Sub AttachProducts(ByVal entity As Global.DbContextModels.Northwind.Product) + entity.Category = Me + End Sub + + Private Sub DetachProducts(ByVal entity As Global.DbContextModels.Northwind.Product) + entity.Category = Nothing + End Sub + + Private Function FilterProducts(ByVal entity As Global.DbContextModels.Northwind.Product) As Boolean + Return Object.Equals(entity.CategoryID, Me.CategoryID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._categoryID + End Function + End Class + + ''' + ''' The 'Customer' entity class. + ''' + _ + Partial Public NotInheritable Class Customer + Inherits Global.OpenRiaServices.Client.Entity + + Private _address As String + + Private _city As String + + Private _companyName As String + + Private _contactName As String + + Private _contactTitle As String + + Private _country As String + + Private _customerID As String + + Private _fax As String + + Private _orders As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order) + + Private _phone As String + + Private _postalCode As String + + Private _region As String + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnAddressChanging(ByVal value As String) + End Sub + Private Partial Sub OnAddressChanged() + End Sub + Private Partial Sub OnCityChanging(ByVal value As String) + End Sub + Private Partial Sub OnCityChanged() + End Sub + Private Partial Sub OnCompanyNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCompanyNameChanged() + End Sub + Private Partial Sub OnContactNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnContactNameChanged() + End Sub + Private Partial Sub OnContactTitleChanging(ByVal value As String) + End Sub + Private Partial Sub OnContactTitleChanged() + End Sub + Private Partial Sub OnCountryChanging(ByVal value As String) + End Sub + Private Partial Sub OnCountryChanged() + End Sub + Private Partial Sub OnCustomerIDChanging(ByVal value As String) + End Sub + Private Partial Sub OnCustomerIDChanged() + End Sub + Private Partial Sub OnFaxChanging(ByVal value As String) + End Sub + Private Partial Sub OnFaxChanged() + End Sub + Private Partial Sub OnPhoneChanging(ByVal value As String) + End Sub + Private Partial Sub OnPhoneChanged() + End Sub + Private Partial Sub OnPostalCodeChanging(ByVal value As String) + End Sub + Private Partial Sub OnPostalCodeChanged() + End Sub + Private Partial Sub OnRegionChanging(ByVal value As String) + End Sub + Private Partial Sub OnRegionChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'Address' value. + ''' + _ + Public Property Address() As String + Get + Return Me._address + End Get + Set + If (String.Equals(Me._address, value) = false) Then + Me.OnAddressChanging(value) + Me.RaiseDataMemberChanging("Address") + Me.ValidateProperty("Address", value) + Me._address = value + Me.RaiseDataMemberChanged("Address") + Me.OnAddressChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'City' value. + ''' + _ + Public Property City() As String + Get + Return Me._city + End Get + Set + If (String.Equals(Me._city, value) = false) Then + Me.OnCityChanging(value) + Me.RaiseDataMemberChanging("City") + Me.ValidateProperty("City", value) + Me._city = value + Me.RaiseDataMemberChanged("City") + Me.OnCityChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CompanyName' value. + ''' + _ + Public Property CompanyName() As String + Get + Return Me._companyName + End Get + Set + If (String.Equals(Me._companyName, value) = false) Then + Me.OnCompanyNameChanging(value) + Me.RaiseDataMemberChanging("CompanyName") + Me.ValidateProperty("CompanyName", value) + Me._companyName = value + Me.RaiseDataMemberChanged("CompanyName") + Me.OnCompanyNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ContactName' value. + ''' + _ + Public Property ContactName() As String + Get + Return Me._contactName + End Get + Set + If (String.Equals(Me._contactName, value) = false) Then + Me.OnContactNameChanging(value) + Me.RaiseDataMemberChanging("ContactName") + Me.ValidateProperty("ContactName", value) + Me._contactName = value + Me.RaiseDataMemberChanged("ContactName") + Me.OnContactNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ContactTitle' value. + ''' + _ + Public Property ContactTitle() As String + Get + Return Me._contactTitle + End Get + Set + If (String.Equals(Me._contactTitle, value) = false) Then + Me.OnContactTitleChanging(value) + Me.RaiseDataMemberChanging("ContactTitle") + Me.ValidateProperty("ContactTitle", value) + Me._contactTitle = value + Me.RaiseDataMemberChanged("ContactTitle") + Me.OnContactTitleChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Country' value. + ''' + _ + Public Property Country() As String + Get + Return Me._country + End Get + Set + If (String.Equals(Me._country, value) = false) Then + Me.OnCountryChanging(value) + Me.RaiseDataMemberChanging("Country") + Me.ValidateProperty("Country", value) + Me._country = value + Me.RaiseDataMemberChanged("Country") + Me.OnCountryChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CustomerID' value. + ''' + _ + Public Property CustomerID() As String + Get + Return Me._customerID + End Get + Set + If (String.Equals(Me._customerID, value) = false) Then + Me.OnCustomerIDChanging(value) + Me.ValidateProperty("CustomerID", value) + Me._customerID = value + Me.RaisePropertyChanged("CustomerID") + Me.OnCustomerIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Fax' value. + ''' + _ + Public Property Fax() As String + Get + Return Me._fax + End Get + Set + If (String.Equals(Me._fax, value) = false) Then + Me.OnFaxChanging(value) + Me.RaiseDataMemberChanging("Fax") + Me.ValidateProperty("Fax", value) + Me._fax = value + Me.RaiseDataMemberChanged("Fax") + Me.OnFaxChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Orders() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order) + Get + If (Me._orders Is Nothing) Then + Me._orders = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order)(Me, "Orders", AddressOf Me.FilterOrders, AddressOf Me.AttachOrders, AddressOf Me.DetachOrders) + End If + Return Me._orders + End Get + End Property + + ''' + ''' Gets or sets the 'Phone' value. + ''' + _ + Public Property Phone() As String + Get + Return Me._phone + End Get + Set + If (String.Equals(Me._phone, value) = false) Then + Me.OnPhoneChanging(value) + Me.RaiseDataMemberChanging("Phone") + Me.ValidateProperty("Phone", value) + Me._phone = value + Me.RaiseDataMemberChanged("Phone") + Me.OnPhoneChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'PostalCode' value. + ''' + _ + Public Property PostalCode() As String + Get + Return Me._postalCode + End Get + Set + If (String.Equals(Me._postalCode, value) = false) Then + Me.OnPostalCodeChanging(value) + Me.RaiseDataMemberChanging("PostalCode") + Me.ValidateProperty("PostalCode", value) + Me._postalCode = value + Me.RaiseDataMemberChanged("PostalCode") + Me.OnPostalCodeChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Region' value. + ''' + _ + Public Property Region() As String + Get + Return Me._region + End Get + Set + If (String.Equals(Me._region, value) = false) Then + Me.OnRegionChanging(value) + Me.RaiseDataMemberChanging("Region") + Me.ValidateProperty("Region", value) + Me._region = value + Me.RaiseDataMemberChanged("Region") + Me.OnRegionChanged + End If + End Set + End Property + + Private Sub AttachOrders(ByVal entity As Global.DbContextModels.Northwind.Order) + entity.Customer = Me + End Sub + + Private Sub DetachOrders(ByVal entity As Global.DbContextModels.Northwind.Order) + entity.Customer = Nothing + End Sub + + Private Function FilterOrders(ByVal entity As Global.DbContextModels.Northwind.Order) As Boolean + Return Object.Equals(entity.CustomerID, Me.CustomerID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._customerID + End Function + End Class + + ''' + ''' The 'Order' entity class. + ''' + _ + Partial Public NotInheritable Class Order + Inherits Global.OpenRiaServices.Client.Entity + + Private _customer As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Customer) + + Private _customerID As String + + Private _employeeID As Global.System.Nullable(Of Integer) + + Private _formattedName As String + + Private _freight As Global.System.Nullable(Of Decimal) + + Private _order_Details As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + + Private _orderDate As Global.System.Nullable(Of Date) + + Private _orderID As Integer + + Private _requiredDate As Global.System.Nullable(Of Date) + + Private _shipAddress As String + + Private _shipCity As String + + Private _shipCountry As String + + Private _shipName As String + + Private _shippedDate As Global.System.Nullable(Of Date) + + Private _shipPostalCode As String + + Private _shipRegion As String + + Private _shipVia As Global.System.Nullable(Of Integer) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCustomerIDChanging(ByVal value As String) + End Sub + Private Partial Sub OnCustomerIDChanged() + End Sub + Private Partial Sub OnEmployeeIDChanging(ByVal value As Global.System.Nullable(Of Integer)) + End Sub + Private Partial Sub OnEmployeeIDChanged() + End Sub + Private Partial Sub OnFormattedNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnFormattedNameChanged() + End Sub + Private Partial Sub OnFreightChanging(ByVal value As Global.System.Nullable(Of Decimal)) + End Sub + Private Partial Sub OnFreightChanged() + End Sub + Private Partial Sub OnOrderDateChanging(ByVal value As Global.System.Nullable(Of Date)) + End Sub + Private Partial Sub OnOrderDateChanged() + End Sub + Private Partial Sub OnOrderIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnOrderIDChanged() + End Sub + Private Partial Sub OnRequiredDateChanging(ByVal value As Global.System.Nullable(Of Date)) + End Sub + Private Partial Sub OnRequiredDateChanged() + End Sub + Private Partial Sub OnShipAddressChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipAddressChanged() + End Sub + Private Partial Sub OnShipCityChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipCityChanged() + End Sub + Private Partial Sub OnShipCountryChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipCountryChanged() + End Sub + Private Partial Sub OnShipNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipNameChanged() + End Sub + Private Partial Sub OnShippedDateChanging(ByVal value As Global.System.Nullable(Of Date)) + End Sub + Private Partial Sub OnShippedDateChanged() + End Sub + Private Partial Sub OnShipPostalCodeChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipPostalCodeChanged() + End Sub + Private Partial Sub OnShipRegionChanging(ByVal value As String) + End Sub + Private Partial Sub OnShipRegionChanged() + End Sub + Private Partial Sub OnShipViaChanging(ByVal value As Global.System.Nullable(Of Integer)) + End Sub + Private Partial Sub OnShipViaChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Customer() As Global.DbContextModels.Northwind.Customer + Get + If (Me._customer Is Nothing) Then + Me._customer = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Customer)(Me, "Customer", AddressOf Me.FilterCustomer) + End If + Return Me._customer.Entity + End Get + Set + Dim previous As Global.DbContextModels.Northwind.Customer = Me.Customer + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Customer", value) + If (Not (previous) Is Nothing) Then + Me._customer.Entity = Nothing + previous.Orders.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.CustomerID = value.CustomerID + Else + Me.CustomerID = CType(Nothing, String) + End If + Me._customer.Entity = value + If (Not (value) Is Nothing) Then + value.Orders.Add(Me) + End If + Me.RaisePropertyChanged("Customer") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CustomerID' value. + ''' + _ + Public Property CustomerID() As String + Get + Return Me._customerID + End Get + Set + If (String.Equals(Me._customerID, value) = false) Then + Me.OnCustomerIDChanging(value) + Me.RaiseDataMemberChanging("CustomerID") + Me.ValidateProperty("CustomerID", value) + Me._customerID = value + Me.RaiseDataMemberChanged("CustomerID") + Me.OnCustomerIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'EmployeeID' value. + ''' + _ + Public Property EmployeeID() As Global.System.Nullable(Of Integer) + Get + Return Me._employeeID + End Get + Set + If (Me._employeeID.Equals(value) = false) Then + Me.OnEmployeeIDChanging(value) + Me.RaiseDataMemberChanging("EmployeeID") + Me.ValidateProperty("EmployeeID", value) + Me._employeeID = value + Me.RaiseDataMemberChanged("EmployeeID") + Me.OnEmployeeIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'FormattedName' value. + ''' + _ + Public Property FormattedName() As String + Get + Return Me._formattedName + End Get + Set + If (String.Equals(Me._formattedName, value) = false) Then + Me.OnFormattedNameChanging(value) + Me.ValidateProperty("FormattedName", value) + Me._formattedName = value + Me.RaisePropertyChanged("FormattedName") + Me.OnFormattedNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Freight' value. + ''' + _ + Public Property Freight() As Global.System.Nullable(Of Decimal) + Get + Return Me._freight + End Get + Set + If (Me._freight.Equals(value) = false) Then + Me.OnFreightChanging(value) + Me.RaiseDataMemberChanging("Freight") + Me.ValidateProperty("Freight", value) + Me._freight = value + Me.RaiseDataMemberChanged("Freight") + Me.OnFreightChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + Get + If (Me._order_Details Is Nothing) Then + Me._order_Details = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + End If + Return Me._order_Details + End Get + End Property + + ''' + ''' Gets or sets the 'OrderDate' value. + ''' + _ + Public Property OrderDate() As Global.System.Nullable(Of Date) + Get + Return Me._orderDate + End Get + Set + If (Me._orderDate.Equals(value) = false) Then + Me.OnOrderDateChanging(value) + Me.RaiseDataMemberChanging("OrderDate") + Me.ValidateProperty("OrderDate", value) + Me._orderDate = value + Me.RaiseDataMemberChanged("OrderDate") + Me.OnOrderDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderID' value. + ''' + _ + Public Property OrderID() As Integer + Get + Return Me._orderID + End Get + Set + If ((Me._orderID = value) _ + = false) Then + Me.OnOrderIDChanging(value) + Me.ValidateProperty("OrderID", value) + Me._orderID = value + Me.RaisePropertyChanged("OrderID") + Me.OnOrderIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RequiredDate' value. + ''' + _ + Public Property RequiredDate() As Global.System.Nullable(Of Date) + Get + Return Me._requiredDate + End Get + Set + If (Me._requiredDate.Equals(value) = false) Then + Me.OnRequiredDateChanging(value) + Me.RaiseDataMemberChanging("RequiredDate") + Me.ValidateProperty("RequiredDate", value) + Me._requiredDate = value + Me.RaiseDataMemberChanged("RequiredDate") + Me.OnRequiredDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipAddress' value. + ''' + _ + Public Property ShipAddress() As String + Get + Return Me._shipAddress + End Get + Set + If (String.Equals(Me._shipAddress, value) = false) Then + Me.OnShipAddressChanging(value) + Me.RaiseDataMemberChanging("ShipAddress") + Me.ValidateProperty("ShipAddress", value) + Me._shipAddress = value + Me.RaiseDataMemberChanged("ShipAddress") + Me.OnShipAddressChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipCity' value. + ''' + _ + Public Property ShipCity() As String + Get + Return Me._shipCity + End Get + Set + If (String.Equals(Me._shipCity, value) = false) Then + Me.OnShipCityChanging(value) + Me.RaiseDataMemberChanging("ShipCity") + Me.ValidateProperty("ShipCity", value) + Me._shipCity = value + Me.RaiseDataMemberChanged("ShipCity") + Me.OnShipCityChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipCountry' value. + ''' + _ + Public Property ShipCountry() As String + Get + Return Me._shipCountry + End Get + Set + If (String.Equals(Me._shipCountry, value) = false) Then + Me.OnShipCountryChanging(value) + Me.RaiseDataMemberChanging("ShipCountry") + Me.ValidateProperty("ShipCountry", value) + Me._shipCountry = value + Me.RaiseDataMemberChanged("ShipCountry") + Me.OnShipCountryChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipName' value. + ''' + _ + Public Property ShipName() As String + Get + Return Me._shipName + End Get + Set + If (String.Equals(Me._shipName, value) = false) Then + Me.OnShipNameChanging(value) + Me.RaiseDataMemberChanging("ShipName") + Me.ValidateProperty("ShipName", value) + Me._shipName = value + Me.RaiseDataMemberChanged("ShipName") + Me.OnShipNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShippedDate' value. + ''' + _ + Public Property ShippedDate() As Global.System.Nullable(Of Date) + Get + Return Me._shippedDate + End Get + Set + If (Me._shippedDate.Equals(value) = false) Then + Me.OnShippedDateChanging(value) + Me.RaiseDataMemberChanging("ShippedDate") + Me.ValidateProperty("ShippedDate", value) + Me._shippedDate = value + Me.RaiseDataMemberChanged("ShippedDate") + Me.OnShippedDateChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipPostalCode' value. + ''' + _ + Public Property ShipPostalCode() As String + Get + Return Me._shipPostalCode + End Get + Set + If (String.Equals(Me._shipPostalCode, value) = false) Then + Me.OnShipPostalCodeChanging(value) + Me.RaiseDataMemberChanging("ShipPostalCode") + Me.ValidateProperty("ShipPostalCode", value) + Me._shipPostalCode = value + Me.RaiseDataMemberChanged("ShipPostalCode") + Me.OnShipPostalCodeChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipRegion' value. + ''' + _ + Public Property ShipRegion() As String + Get + Return Me._shipRegion + End Get + Set + If (String.Equals(Me._shipRegion, value) = false) Then + Me.OnShipRegionChanging(value) + Me.RaiseDataMemberChanging("ShipRegion") + Me.ValidateProperty("ShipRegion", value) + Me._shipRegion = value + Me.RaiseDataMemberChanged("ShipRegion") + Me.OnShipRegionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ShipVia' value. + ''' + _ + Public Property ShipVia() As Global.System.Nullable(Of Integer) + Get + Return Me._shipVia + End Get + Set + If (Me._shipVia.Equals(value) = false) Then + Me.OnShipViaChanging(value) + Me.RaiseDataMemberChanging("ShipVia") + Me.ValidateProperty("ShipVia", value) + Me._shipVia = value + Me.RaiseDataMemberChanged("ShipVia") + Me.OnShipViaChanged + End If + End Set + End Property + + Private Function FilterCustomer(ByVal entity As Global.DbContextModels.Northwind.Customer) As Boolean + Return Object.Equals(entity.CustomerID, Me.CustomerID) + End Function + + Private Sub AttachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + entity.Order = Me + End Sub + + Private Sub DetachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + entity.Order = Nothing + End Sub + + Private Function FilterOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) As Boolean + Return Object.Equals(entity.OrderID, Me.OrderID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._orderID + End Function + End Class + + ''' + ''' The 'Order_Detail' entity class. + ''' + _ + Partial Public NotInheritable Class Order_Detail + Inherits Global.OpenRiaServices.Client.Entity + + Private _discount As Single + + Private _order As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Order) + + Private _orderID As Integer + + Private _product As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Product) + + Private _productID As Integer + + Private _quantity As Short + + Private _unitPrice As Decimal + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnDiscountChanging(ByVal value As Single) + End Sub + Private Partial Sub OnDiscountChanged() + End Sub + Private Partial Sub OnOrderIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnOrderIDChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnQuantityChanging(ByVal value As Short) + End Sub + Private Partial Sub OnQuantityChanged() + End Sub + Private Partial Sub OnUnitPriceChanging(ByVal value As Decimal) + End Sub + Private Partial Sub OnUnitPriceChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'Discount' value. + ''' + _ + Public Property Discount() As Single + Get + Return Me._discount + End Get + Set + If ((Me._discount = value) _ + = false) Then + Me.OnDiscountChanging(value) + Me.RaiseDataMemberChanging("Discount") + Me.ValidateProperty("Discount", value) + Me._discount = value + Me.RaiseDataMemberChanged("Discount") + Me.OnDiscountChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Order() As Global.DbContextModels.Northwind.Order + Get + If (Me._order Is Nothing) Then + Me._order = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Order)(Me, "Order", AddressOf Me.FilterOrder) + End If + Return Me._order.Entity + End Get + Set + Dim previous As Global.DbContextModels.Northwind.Order = Me.Order + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Order", value) + If (Not (previous) Is Nothing) Then + Me._order.Entity = Nothing + previous.Order_Details.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.OrderID = value.OrderID + Else + Me.OrderID = CType(Nothing, Integer) + End If + Me._order.Entity = value + If (Not (value) Is Nothing) Then + value.Order_Details.Add(Me) + End If + Me.RaisePropertyChanged("Order") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'OrderID' value. + ''' + _ + Public Property OrderID() As Integer + Get + Return Me._orderID + End Get + Set + If ((Me._orderID = value) _ + = false) Then + Me.OnOrderIDChanging(value) + Me.RaiseDataMemberChanging("OrderID") + Me.ValidateProperty("OrderID", value) + Me._orderID = value + Me.RaiseDataMemberChanged("OrderID") + Me.OnOrderIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Product() As Global.DbContextModels.Northwind.Product + Get + If (Me._product Is Nothing) Then + Me._product = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Product)(Me, "Product", AddressOf Me.FilterProduct) + End If + Return Me._product.Entity + End Get + Set + Dim previous As Global.DbContextModels.Northwind.Product = Me.Product + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Product", value) + If (Not (previous) Is Nothing) Then + Me._product.Entity = Nothing + previous.Order_Details.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.ProductID = value.ProductID + Else + Me.ProductID = CType(Nothing, Integer) + End If + Me._product.Entity = value + If (Not (value) Is Nothing) Then + value.Order_Details.Add(Me) + End If + Me.RaisePropertyChanged("Product") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.RaiseDataMemberChanging("ProductID") + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaiseDataMemberChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Quantity' value. + ''' + _ + Public Property Quantity() As Short + Get + Return Me._quantity + End Get + Set + If ((Me._quantity = value) _ + = false) Then + Me.OnQuantityChanging(value) + Me.RaiseDataMemberChanging("Quantity") + Me.ValidateProperty("Quantity", value) + Me._quantity = value + Me.RaiseDataMemberChanged("Quantity") + Me.OnQuantityChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitPrice' value. + ''' + _ + Public Property UnitPrice() As Decimal + Get + Return Me._unitPrice + End Get + Set + If ((Me._unitPrice = value) _ + = false) Then + Me.OnUnitPriceChanging(value) + Me.RaiseDataMemberChanging("UnitPrice") + Me.ValidateProperty("UnitPrice", value) + Me._unitPrice = value + Me.RaiseDataMemberChanged("UnitPrice") + Me.OnUnitPriceChanged + End If + End Set + End Property + + Private Function FilterOrder(ByVal entity As Global.DbContextModels.Northwind.Order) As Boolean + Return Object.Equals(entity.OrderID, Me.OrderID) + End Function + + Private Function FilterProduct(ByVal entity As Global.DbContextModels.Northwind.Product) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Global.OpenRiaServices.Client.EntityKey.Create(Me._orderID, Me._productID) + End Function + End Class + + ''' + ''' The 'Product' entity class. + ''' + _ + Partial Public NotInheritable Class Product + Inherits Global.OpenRiaServices.Client.Entity + + Private _category As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Category) + + Private _categoryID As Global.System.Nullable(Of Integer) + + Private _categoryName As String + + Private _discontinued As Boolean + + Private _order_Details As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + + Private _productID As Integer + + Private _productName As String + + Private _quantityPerUnit As String + + Private _reorderLevel As Global.System.Nullable(Of Short) + + Private _resolveMethod As String + + Private _supplierID As Global.System.Nullable(Of Integer) + + Private _supplierName As String + + Private _unitPrice As Global.System.Nullable(Of Decimal) + + Private _unitsInStock As Global.System.Nullable(Of Short) + + Private _unitsOnOrder As Global.System.Nullable(Of Short) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCategoryIDChanging(ByVal value As Global.System.Nullable(Of Integer)) + End Sub + Private Partial Sub OnCategoryIDChanged() + End Sub + Private Partial Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCategoryNameChanged() + End Sub + Private Partial Sub OnDiscontinuedChanging(ByVal value As Boolean) + End Sub + Private Partial Sub OnDiscontinuedChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnProductNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnProductNameChanged() + End Sub + Private Partial Sub OnQuantityPerUnitChanging(ByVal value As String) + End Sub + Private Partial Sub OnQuantityPerUnitChanged() + End Sub + Private Partial Sub OnReorderLevelChanging(ByVal value As Global.System.Nullable(Of Short)) + End Sub + Private Partial Sub OnReorderLevelChanged() + End Sub + Private Partial Sub OnResolveMethodChanging(ByVal value As String) + End Sub + Private Partial Sub OnResolveMethodChanged() + End Sub + Private Partial Sub OnSupplierIDChanging(ByVal value As Global.System.Nullable(Of Integer)) + End Sub + Private Partial Sub OnSupplierIDChanged() + End Sub + Private Partial Sub OnSupplierNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnSupplierNameChanged() + End Sub + Private Partial Sub OnUnitPriceChanging(ByVal value As Global.System.Nullable(Of Decimal)) + End Sub + Private Partial Sub OnUnitPriceChanged() + End Sub + Private Partial Sub OnUnitsInStockChanging(ByVal value As Global.System.Nullable(Of Short)) + End Sub + Private Partial Sub OnUnitsInStockChanged() + End Sub + Private Partial Sub OnUnitsOnOrderChanging(ByVal value As Global.System.Nullable(Of Short)) + End Sub + Private Partial Sub OnUnitsOnOrderChanged() + End Sub + Private Partial Sub OnDiscontinueProductInvoking() + End Sub + Private Partial Sub OnDiscontinueProductInvoked() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Category() As Global.DbContextModels.Northwind.Category + Get + If (Me._category Is Nothing) Then + Me._category = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Category)(Me, "Category", AddressOf Me.FilterCategory) + End If + Return Me._category.Entity + End Get + Set + Dim previous As Global.DbContextModels.Northwind.Category = Me.Category + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Category", value) + If (Not (previous) Is Nothing) Then + Me._category.Entity = Nothing + previous.Products.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.CategoryID = value.CategoryID + Else + Me.CategoryID = CType(Nothing, Global.System.Nullable(Of Integer)) + End If + Me._category.Entity = value + If (Not (value) Is Nothing) Then + value.Products.Add(Me) + End If + Me.RaisePropertyChanged("Category") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryID' value. + ''' + _ + Public Property CategoryID() As Global.System.Nullable(Of Integer) + Get + Return Me._categoryID + End Get + Set + If (Me._categoryID.Equals(value) = false) Then + Me.OnCategoryIDChanging(value) + Me.RaiseDataMemberChanging("CategoryID") + Me.ValidateProperty("CategoryID", value) + Me._categoryID = value + Me.RaiseDataMemberChanged("CategoryID") + Me.OnCategoryIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + _ + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value + Me.RaisePropertyChanged("CategoryName") + Me.OnCategoryNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'Discontinued' value. + ''' + _ + Public Property Discontinued() As Boolean + Get + Return Me._discontinued + End Get + Set + If ((Me._discontinued = value) _ + = false) Then + Me.OnDiscontinuedChanging(value) + Me.RaiseDataMemberChanging("Discontinued") + Me.ValidateProperty("Discontinued", value) + Me._discontinued = value + Me.RaiseDataMemberChanged("Discontinued") + Me.OnDiscontinuedChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + Get + If (Me._order_Details Is Nothing) Then + Me._order_Details = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + End If + Return Me._order_Details + End Get + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaisePropertyChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductName' value. + ''' + _ + Public Property ProductName() As String + Get + Return Me._productName + End Get + Set + If (String.Equals(Me._productName, value) = false) Then + Me.OnProductNameChanging(value) + Me.RaiseDataMemberChanging("ProductName") + Me.ValidateProperty("ProductName", value) + Me._productName = value + Me.RaiseDataMemberChanged("ProductName") + Me.OnProductNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'QuantityPerUnit' value. + ''' + _ + Public Property QuantityPerUnit() As String + Get + Return Me._quantityPerUnit + End Get + Set + If (String.Equals(Me._quantityPerUnit, value) = false) Then + Me.OnQuantityPerUnitChanging(value) + Me.RaiseDataMemberChanging("QuantityPerUnit") + Me.ValidateProperty("QuantityPerUnit", value) + Me._quantityPerUnit = value + Me.RaiseDataMemberChanged("QuantityPerUnit") + Me.OnQuantityPerUnitChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ReorderLevel' value. + ''' + _ + Public Property ReorderLevel() As Global.System.Nullable(Of Short) + Get + Return Me._reorderLevel + End Get + Set + If (Me._reorderLevel.Equals(value) = false) Then + Me.OnReorderLevelChanging(value) + Me.RaiseDataMemberChanging("ReorderLevel") + Me.ValidateProperty("ReorderLevel", value) + Me._reorderLevel = value + Me.RaiseDataMemberChanged("ReorderLevel") + Me.OnReorderLevelChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ResolveMethod' value. + ''' + _ + Public Property ResolveMethod() As String + Get + Return Me._resolveMethod + End Get + Set + If (String.Equals(Me._resolveMethod, value) = false) Then + Me.OnResolveMethodChanging(value) + Me.RaiseDataMemberChanging("ResolveMethod") + Me.ValidateProperty("ResolveMethod", value) + Me._resolveMethod = value + Me.RaiseDataMemberChanged("ResolveMethod") + Me.OnResolveMethodChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierID' value. + ''' + _ + Public Property SupplierID() As Global.System.Nullable(Of Integer) + Get + Return Me._supplierID + End Get + Set + If (Me._supplierID.Equals(value) = false) Then + Me.OnSupplierIDChanging(value) + Me.RaiseDataMemberChanging("SupplierID") + Me.ValidateProperty("SupplierID", value) + Me._supplierID = value + Me.RaiseDataMemberChanged("SupplierID") + Me.OnSupplierIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierName' value. + ''' + _ + Public Property SupplierName() As String + Get + Return Me._supplierName + End Get + Set + If (String.Equals(Me._supplierName, value) = false) Then + Me.OnSupplierNameChanging(value) + Me.ValidateProperty("SupplierName", value) + Me._supplierName = value + Me.RaisePropertyChanged("SupplierName") + Me.OnSupplierNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitPrice' value. + ''' + _ + Public Property UnitPrice() As Global.System.Nullable(Of Decimal) + Get + Return Me._unitPrice + End Get + Set + If (Me._unitPrice.Equals(value) = false) Then + Me.OnUnitPriceChanging(value) + Me.RaiseDataMemberChanging("UnitPrice") + Me.ValidateProperty("UnitPrice", value) + Me._unitPrice = value + Me.RaiseDataMemberChanged("UnitPrice") + Me.OnUnitPriceChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitsInStock' value. + ''' + _ + Public Property UnitsInStock() As Global.System.Nullable(Of Short) + Get + Return Me._unitsInStock + End Get + Set + If (Me._unitsInStock.Equals(value) = false) Then + Me.OnUnitsInStockChanging(value) + Me.RaiseDataMemberChanging("UnitsInStock") + Me.ValidateProperty("UnitsInStock", value) + Me._unitsInStock = value + Me.RaiseDataMemberChanged("UnitsInStock") + Me.OnUnitsInStockChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'UnitsOnOrder' value. + ''' + _ + Public Property UnitsOnOrder() As Global.System.Nullable(Of Short) + Get + Return Me._unitsOnOrder + End Get + Set + If (Me._unitsOnOrder.Equals(value) = false) Then + Me.OnUnitsOnOrderChanging(value) + Me.RaiseDataMemberChanging("UnitsOnOrder") + Me.ValidateProperty("UnitsOnOrder", value) + Me._unitsOnOrder = value + Me.RaiseDataMemberChanged("UnitsOnOrder") + Me.OnUnitsOnOrderChanged + End If + End Set + End Property + + ''' + ''' Gets a value indicating whether the 'DiscontinueProduct' action has been invoked on this entity. + ''' + _ + Public ReadOnly Property IsDiscontinueProductInvoked() As Boolean + Get + Return MyBase.IsActionInvoked("DiscontinueProduct") + End Get + End Property + + ''' + ''' Gets a value indicating whether the 'DiscontinueProduct' method can be invoked on this entity. + ''' + _ + Public ReadOnly Property CanDiscontinueProduct() As Boolean + Get + Return MyBase.CanInvokeAction("DiscontinueProduct") + End Get + End Property + + Private Function FilterCategory(ByVal entity As Global.DbContextModels.Northwind.Category) As Boolean + Return Object.Equals(entity.CategoryID, Me.CategoryID) + End Function + + Private Sub AttachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + entity.Product = Me + End Sub + + Private Sub DetachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + entity.Product = Nothing + End Sub + + Private Function FilterOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) As Boolean + Return Object.Equals(entity.ProductID, Me.ProductID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._productID + End Function + + ''' + ''' Invokes the 'DiscontinueProduct' action on this entity. + ''' + _ + Public Sub DiscontinueProduct() + Me.OnDiscontinueProductInvoking + MyBase.InvokeAction("DiscontinueProduct") + Me.OnDiscontinueProductInvoked + End Sub + End Class + + ''' + ''' The 'ProductInfo' entity class. + ''' + _ + Partial Public NotInheritable Class ProductInfo + Inherits Global.OpenRiaServices.Client.Entity + + Private _categoryName As String + + Private _productID As Integer + + Private _productName As String + + Private _supplierName As String + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnCategoryNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnCategoryNameChanged() + End Sub + Private Partial Sub OnProductIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnProductIDChanged() + End Sub + Private Partial Sub OnProductNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnProductNameChanged() + End Sub + Private Partial Sub OnSupplierNameChanging(ByVal value As String) + End Sub + Private Partial Sub OnSupplierNameChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'CategoryName' value. + ''' + _ + Public Property CategoryName() As String + Get + Return Me._categoryName + End Get + Set + If (String.Equals(Me._categoryName, value) = false) Then + Me.OnCategoryNameChanging(value) + Me.ValidateProperty("CategoryName", value) + Me._categoryName = value + Me.RaisePropertyChanged("CategoryName") + Me.OnCategoryNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductID' value. + ''' + _ + Public Property ProductID() As Integer + Get + Return Me._productID + End Get + Set + If ((Me._productID = value) _ + = false) Then + Me.OnProductIDChanging(value) + Me.ValidateProperty("ProductID", value) + Me._productID = value + Me.RaisePropertyChanged("ProductID") + Me.OnProductIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'ProductName' value. + ''' + _ + Public Property ProductName() As String + Get + Return Me._productName + End Get + Set + If (String.Equals(Me._productName, value) = false) Then + Me.OnProductNameChanging(value) + Me.RaiseDataMemberChanging("ProductName") + Me.ValidateProperty("ProductName", value) + Me._productName = value + Me.RaiseDataMemberChanged("ProductName") + Me.OnProductNameChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'SupplierName' value. + ''' + _ + Public Property SupplierName() As String + Get + Return Me._supplierName + End Get + Set + If (String.Equals(Me._supplierName, value) = false) Then + Me.OnSupplierNameChanging(value) + Me.ValidateProperty("SupplierName", value) + Me._supplierName = value + Me.RaisePropertyChanged("SupplierName") + Me.OnSupplierNameChanged + End If + End Set + End Property + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._productID + End Function + End Class + + ''' + ''' The 'Region' entity class. + ''' + _ + Partial Public NotInheritable Class Region + Inherits Global.OpenRiaServices.Client.Entity + + Private _regionDescription As String + + Private _regionID As Integer + + Private _territories As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Territory) + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnRegionDescriptionChanging(ByVal value As String) + End Sub + Private Partial Sub OnRegionDescriptionChanged() + End Sub + Private Partial Sub OnRegionIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnRegionIDChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the 'RegionDescription' value. + ''' + _ + Public Property RegionDescription() As String + Get + Return Me._regionDescription + End Get + Set + If (String.Equals(Me._regionDescription, value) = false) Then + Me.OnRegionDescriptionChanging(value) + Me.RaiseDataMemberChanging("RegionDescription") + Me.ValidateProperty("RegionDescription", value) + Me._regionDescription = value + Me.RaiseDataMemberChanged("RegionDescription") + Me.OnRegionDescriptionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RegionID' value. + ''' + _ + Public Property RegionID() As Integer + Get + Return Me._regionID + End Get + Set + If ((Me._regionID = value) _ + = false) Then + Me.OnRegionIDChanging(value) + Me.ValidateProperty("RegionID", value) + Me._regionID = value + Me.RaisePropertyChanged("RegionID") + Me.OnRegionIDChanged + End If + End Set + End Property + + ''' + ''' Gets the collection of associated entity instances. + ''' + _ + Public ReadOnly Property Territories() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Territory) + Get + If (Me._territories Is Nothing) Then + Me._territories = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Territory)(Me, "Territories", AddressOf Me.FilterTerritories, AddressOf Me.AttachTerritories, AddressOf Me.DetachTerritories) + End If + Return Me._territories + End Get + End Property + + Private Sub AttachTerritories(ByVal entity As Global.DbContextModels.Northwind.Territory) + entity.Region = Me + End Sub + + Private Sub DetachTerritories(ByVal entity As Global.DbContextModels.Northwind.Territory) + entity.Region = Nothing + End Sub + + Private Function FilterTerritories(ByVal entity As Global.DbContextModels.Northwind.Territory) As Boolean + Return Object.Equals(entity.RegionID, Me.RegionID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._regionID + End Function + End Class + + ''' + ''' The 'Territory' entity class. + ''' + _ + Partial Public NotInheritable Class Territory + Inherits Global.OpenRiaServices.Client.Entity + + Private _region As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Region) + + Private _regionID As Integer + + Private _territoryDescription As String + + Private _territoryID As String + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + Private Partial Sub OnRegionIDChanging(ByVal value As Integer) + End Sub + Private Partial Sub OnRegionIDChanged() + End Sub + Private Partial Sub OnTerritoryDescriptionChanging(ByVal value As String) + End Sub + Private Partial Sub OnTerritoryDescriptionChanged() + End Sub + Private Partial Sub OnTerritoryIDChanging(ByVal value As String) + End Sub + Private Partial Sub OnTerritoryIDChanged() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + MyBase.New + Me.OnCreated + End Sub + + ''' + ''' Gets or sets the associated entity. + ''' + _ + Public Property Region() As Global.DbContextModels.Northwind.Region + Get + If (Me._region Is Nothing) Then + Me._region = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Region)(Me, "Region", AddressOf Me.FilterRegion) + End If + Return Me._region.Entity + End Get + Set + Dim previous As Global.DbContextModels.Northwind.Region = Me.Region + If (Object.Equals(previous, value) = false) Then + Me.ValidateProperty("Region", value) + If (Not (previous) Is Nothing) Then + Me._region.Entity = Nothing + previous.Territories.Remove(Me) + End If + If (Not (value) Is Nothing) Then + Me.RegionID = value.RegionID + Else + Me.RegionID = CType(Nothing, Integer) + End If + Me._region.Entity = value + If (Not (value) Is Nothing) Then + value.Territories.Add(Me) + End If + Me.RaisePropertyChanged("Region") + End If + End Set + End Property + + ''' + ''' Gets or sets the 'RegionID' value. + ''' + _ + Public Property RegionID() As Integer + Get + Return Me._regionID + End Get + Set + If ((Me._regionID = value) _ + = false) Then + Me.OnRegionIDChanging(value) + Me.RaiseDataMemberChanging("RegionID") + Me.ValidateProperty("RegionID", value) + Me._regionID = value + Me.RaiseDataMemberChanged("RegionID") + Me.OnRegionIDChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TerritoryDescription' value. + ''' + _ + Public Property TerritoryDescription() As String + Get + Return Me._territoryDescription + End Get + Set + If (String.Equals(Me._territoryDescription, value) = false) Then + Me.OnTerritoryDescriptionChanging(value) + Me.RaiseDataMemberChanging("TerritoryDescription") + Me.ValidateProperty("TerritoryDescription", value) + Me._territoryDescription = value + Me.RaiseDataMemberChanged("TerritoryDescription") + Me.OnTerritoryDescriptionChanged + End If + End Set + End Property + + ''' + ''' Gets or sets the 'TerritoryID' value. + ''' + _ + Public Property TerritoryID() As String + Get + Return Me._territoryID + End Get + Set + If (String.Equals(Me._territoryID, value) = false) Then + Me.OnTerritoryIDChanging(value) + Me.ValidateProperty("TerritoryID", value) + Me._territoryID = value + Me.RaisePropertyChanged("TerritoryID") + Me.OnTerritoryIDChanged + End If + End Set + End Property + + Private Function FilterRegion(ByVal entity As Global.DbContextModels.Northwind.Region) As Boolean + Return Object.Equals(entity.RegionID, Me.RegionID) + End Function + + ''' + ''' Computes a value from the key fields that uniquely identifies this entity instance. + ''' + ''' An object instance that uniquely identifies this entity instance. + Public Overrides Function GetIdentity() As Object + Return Me._territoryID + End Function + End Class +End Namespace + +Namespace TestDomainServices.DbCtx + + ''' + ''' The DomainContext corresponding to the 'Northwind' DomainService. + ''' + Partial Public NotInheritable Class Northwind + Inherits Global.OpenRiaServices.Client.DomainContext + + #Region "Extensibility Method Definitions" + + ''' + ''' This method is invoked from the constructor once initialization is complete and + ''' can be used for further object setup. + ''' + Private Partial Sub OnCreated() + End Sub + + #End Region + + + ''' + ''' Initializes a new instance of the class. + ''' + Public Sub New() + Me.New(New Global.System.Uri("TestDomainServices-DbCtx-Northwind.svc", Global.System.UriKind.Relative)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified service URI. + ''' + ''' The Northwind service URI. + Public Sub New(ByVal serviceUri As Global.System.Uri) + Me.New(Global.OpenRiaServices.Client.DomainContext.CreateDomainClient(GetType(Global.TestDomainServices.DbCtx.Northwind.INorthwindContract), serviceUri, false)) + End Sub + + ''' + ''' Initializes a new instance of the class with the specified . + ''' + ''' The DomainClient instance to use for this DomainContext. + Public Sub New(ByVal domainClient As Global.OpenRiaServices.Client.DomainClient) + MyBase.New(domainClient) + Me.OnCreated + End Sub + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Categories() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Category) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Category) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Customers() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Customer) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Customer) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Order_Detail) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Order_Detail) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Orders() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Order) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Order) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Products() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Product) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Product) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property ProductInfos() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.ProductInfo) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.ProductInfo) + End Get + End Property + + ''' + ''' Gets the set of entity instances that have been loaded into this instance. + ''' + Public ReadOnly Property Regions() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Region) + Get + Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Region) + End Get + End Property + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetCategoriesQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Category) + Me.ValidateMethod("GetCategoriesQuery", Nothing) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Category)("GetCategories", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetCustomersQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Customer) + Me.ValidateMethod("GetCustomersQuery", Nothing) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Customer)("GetCustomers", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetOrderDetailsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Order_Detail) + Me.ValidateMethod("GetOrderDetailsQuery", Nothing) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Order_Detail)("GetOrderDetails", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetOrdersQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Order) + Me.ValidateMethod("GetOrdersQuery", Nothing) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Order)("GetOrders", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductById' query. + ''' + ''' The value for the 'id' parameter of the query. + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductByIdQuery(ByVal id As Integer) As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Product) + Dim parameters As Global.System.Collections.Generic.Dictionary(Of String, Object) = New Global.System.Collections.Generic.Dictionary(Of String, Object)() + parameters.Add("id", id) + Me.ValidateMethod("GetProductByIdQuery", parameters) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Product)("GetProductById", parameters, false, false) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductInfosQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.ProductInfo) + Me.ValidateMethod("GetProductInfosQuery", Nothing) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.ProductInfo)("GetProductInfos", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetProductsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Product) + Me.ValidateMethod("GetProductsQuery", Nothing) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Product)("GetProducts", Nothing, false, true) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegionById' query. + ''' + ''' The value for the 'id' parameter of the query. + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetRegionByIdQuery(ByVal id As Integer) As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Region) + Dim parameters As Global.System.Collections.Generic.Dictionary(Of String, Object) = New Global.System.Collections.Generic.Dictionary(Of String, Object)() + parameters.Add("id", id) + Me.ValidateMethod("GetRegionByIdQuery", parameters) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Region)("GetRegionById", parameters, false, false) + End Function + + ''' + ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. + ''' + ''' An EntityQuery that can be loaded to retrieve entity instances. + Public Function GetRegionsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Region) + Me.ValidateMethod("GetRegionsQuery", Nothing) + Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Region)("GetRegions", Nothing, false, true) + End Function + + ''' + ''' Invokes the 'DiscontinueProduct' method of the specified entity. + ''' + ''' The entity instance. + Public Sub DiscontinueProduct(ByVal product As Global.DbContextModels.Northwind.Product) + product.DiscontinueProduct + End Sub + + ''' + ''' Creates a new EntityContainer for this DomainContext's EntitySets. + ''' + ''' A new container instance. + Protected Overrides Function CreateEntityContainer() As Global.OpenRiaServices.Client.EntityContainer + Return New Global.TestDomainServices.DbCtx.Northwind.NorthwindEntityContainer() + End Function + + ''' + ''' Service contract for the 'Northwind' DomainService. + ''' + _ + Public Interface INorthwindContract + + ''' + ''' Asynchronously invokes the 'GetCategories' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetCategories(ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetCategories'. + ''' + ''' The IAsyncResult returned from 'BeginGetCategories'. + ''' The 'QueryResult' returned from the 'GetCategories' operation. + Function EndGetCategories(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Category) + + ''' + ''' Asynchronously invokes the 'GetCustomers' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetCustomers(ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetCustomers'. + ''' + ''' The IAsyncResult returned from 'BeginGetCustomers'. + ''' The 'QueryResult' returned from the 'GetCustomers' operation. + Function EndGetCustomers(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Customer) + + ''' + ''' Asynchronously invokes the 'GetOrderDetails' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetOrderDetails(ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetOrderDetails'. + ''' + ''' The IAsyncResult returned from 'BeginGetOrderDetails'. + ''' The 'QueryResult' returned from the 'GetOrderDetails' operation. + Function EndGetOrderDetails(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Order_Detail) + + ''' + ''' Asynchronously invokes the 'GetOrders' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetOrders(ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetOrders'. + ''' + ''' The IAsyncResult returned from 'BeginGetOrders'. + ''' The 'QueryResult' returned from the 'GetOrders' operation. + Function EndGetOrders(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Order) + + ''' + ''' Asynchronously invokes the 'GetProductById' operation. + ''' + ''' The value for the 'id' parameter of this action. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProductById(ByVal id As Integer, ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductById'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductById'. + ''' The 'QueryResult' returned from the 'GetProductById' operation. + Function EndGetProductById(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Product) + + ''' + ''' Asynchronously invokes the 'GetProductInfos' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProductInfos(ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProductInfos'. + ''' + ''' The IAsyncResult returned from 'BeginGetProductInfos'. + ''' The 'QueryResult' returned from the 'GetProductInfos' operation. + Function EndGetProductInfos(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.ProductInfo) + + ''' + ''' Asynchronously invokes the 'GetProducts' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetProducts(ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetProducts'. + ''' + ''' The IAsyncResult returned from 'BeginGetProducts'. + ''' The 'QueryResult' returned from the 'GetProducts' operation. + Function EndGetProducts(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Product) + + ''' + ''' Asynchronously invokes the 'GetRegionById' operation. + ''' + ''' The value for the 'id' parameter of this action. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetRegionById(ByVal id As Integer, ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetRegionById'. + ''' + ''' The IAsyncResult returned from 'BeginGetRegionById'. + ''' The 'QueryResult' returned from the 'GetRegionById' operation. + Function EndGetRegionById(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Region) + + ''' + ''' Asynchronously invokes the 'GetRegions' operation. + ''' + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginGetRegions(ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginGetRegions'. + ''' + ''' The IAsyncResult returned from 'BeginGetRegions'. + ''' The 'QueryResult' returned from the 'GetRegions' operation. + Function EndGetRegions(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Region) + + ''' + ''' Asynchronously invokes the 'SubmitChanges' operation. + ''' + ''' The change-set to submit. + ''' Callback to invoke on completion. + ''' Optional state object. + ''' An IAsyncResult that can be used to monitor the request. + _ + Function BeginSubmitChanges(ByVal changeSet As Global.System.Collections.Generic.IEnumerable(Of Global.OpenRiaServices.Client.ChangeSetEntry), ByVal callback As Global.System.AsyncCallback, ByVal asyncState As Object) As Global.System.IAsyncResult + + ''' + ''' Completes the asynchronous operation begun by 'BeginSubmitChanges'. + ''' + ''' The IAsyncResult returned from 'BeginSubmitChanges'. + ''' The collection of change-set entry elements returned from 'SubmitChanges'. + Function EndSubmitChanges(ByVal result As Global.System.IAsyncResult) As Global.System.Collections.Generic.IEnumerable(Of Global.OpenRiaServices.Client.ChangeSetEntry) + End Interface + + Friend NotInheritable Class NorthwindEntityContainer + Inherits Global.OpenRiaServices.Client.EntityContainer + + Public Sub New() + MyBase.New + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Category)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Customer)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Order)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Order_Detail)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Product)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.ProductInfo)(Global.OpenRiaServices.Client.EntitySetOperations.Edit) + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Region)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Territory)(Global.OpenRiaServices.Client.EntitySetOperations.All) + End Sub + End Class + End Class +End Namespace diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs index 1325ffd40..461097a67 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFDbContextScenarios.g.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -15,7 +15,7 @@ namespace DbContextModels.Northwind /// /// The 'Category' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Category : global::OpenRiaServices.Client.Entity { @@ -59,6 +59,7 @@ public Category() /// /// Gets or sets the 'CategoryID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] @@ -159,7 +160,7 @@ public byte[] Picture /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Category_Product", "CategoryID", "CategoryID")] public global::OpenRiaServices.Client.EntityCollection Products { get @@ -200,7 +201,7 @@ public override object GetIdentity() /// /// The 'Customer' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Customer : global::OpenRiaServices.Client.Entity { @@ -272,6 +273,8 @@ public Customer() /// /// Gets or sets the 'Address' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Address @@ -297,6 +300,8 @@ public string Address /// /// Gets or sets the 'City' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string City @@ -322,7 +327,9 @@ public string City /// /// Gets or sets the 'CompanyName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string CompanyName @@ -348,6 +355,8 @@ public string CompanyName /// /// Gets or sets the 'ContactName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ContactName @@ -373,6 +382,8 @@ public string ContactName /// /// Gets or sets the 'ContactTitle' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ContactTitle @@ -398,6 +409,8 @@ public string ContactTitle /// /// Gets or sets the 'Country' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Country @@ -423,6 +436,7 @@ public string Country /// /// Gets or sets the 'CustomerID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] @@ -451,6 +465,8 @@ public string CustomerID /// /// Gets or sets the 'Fax' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Fax @@ -476,7 +492,7 @@ public string Fax /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Customer_Order", "CustomerID", "CustomerID")] public global::OpenRiaServices.Client.EntityCollection Orders { get @@ -492,6 +508,8 @@ public string Fax /// /// Gets or sets the 'Phone' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Phone @@ -517,6 +535,8 @@ public string Phone /// /// Gets or sets the 'PostalCode' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string PostalCode @@ -542,6 +562,8 @@ public string PostalCode /// /// Gets or sets the 'Region' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Region @@ -592,7 +614,7 @@ public override object GetIdentity() /// /// The 'Order' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Order : global::OpenRiaServices.Client.Entity { @@ -682,7 +704,7 @@ public Order() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)] public global::DbContextModels.Northwind.Customer Customer { get @@ -725,6 +747,7 @@ public Order() /// /// Gets or sets the 'CustomerID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(5)] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -751,6 +774,7 @@ public string CustomerID /// /// Gets or sets the 'EmployeeID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable EmployeeID @@ -801,6 +825,8 @@ public string FormattedName /// /// Gets or sets the 'Freight' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable Freight { @@ -825,7 +851,7 @@ public string FormattedName /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Order_Order_Detail", "OrderID", "OrderID")] public global::OpenRiaServices.Client.EntityCollection Order_Details { get @@ -841,6 +867,8 @@ public string FormattedName /// /// Gets or sets the 'OrderDate' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable OrderDate { @@ -865,6 +893,7 @@ public string FormattedName /// /// Gets or sets the 'OrderID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] @@ -891,6 +920,8 @@ public int OrderID /// /// Gets or sets the 'RequiredDate' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable RequiredDate { @@ -915,6 +946,8 @@ public int OrderID /// /// Gets or sets the 'ShipAddress' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipAddress @@ -940,6 +973,8 @@ public string ShipAddress /// /// Gets or sets the 'ShipCity' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipCity @@ -965,6 +1000,8 @@ public string ShipCity /// /// Gets or sets the 'ShipCountry' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipCountry @@ -990,6 +1027,8 @@ public string ShipCountry /// /// Gets or sets the 'ShipName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipName @@ -1015,6 +1054,8 @@ public string ShipName /// /// Gets or sets the 'ShippedDate' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ShippedDate { @@ -1039,6 +1080,8 @@ public string ShipName /// /// Gets or sets the 'ShipPostalCode' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipPostalCode @@ -1064,6 +1107,8 @@ public string ShipPostalCode /// /// Gets or sets the 'ShipRegion' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipRegion @@ -1089,6 +1134,7 @@ public string ShipRegion /// /// Gets or sets the 'ShipVia' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ShipVia @@ -1144,7 +1190,7 @@ public override object GetIdentity() /// /// The 'Order_Detail' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Order_Detail : global::OpenRiaServices.Client.Entity { @@ -1194,6 +1240,8 @@ public Order_Detail() /// /// Gets or sets the 'Discount' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public float Discount { @@ -1218,7 +1266,7 @@ public float Discount /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)] public global::DbContextModels.Northwind.Order Order { get @@ -1261,7 +1309,7 @@ public float Discount /// /// Gets or sets the 'OrderID' value. /// - [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -1276,9 +1324,10 @@ public int OrderID if ((this._orderID != value)) { this.OnOrderIDChanging(value); + this.RaiseDataMemberChanging("OrderID"); this.ValidateProperty("OrderID", value); this._orderID = value; - this.RaisePropertyChanged("OrderID"); + this.RaiseDataMemberChanged("OrderID"); this.OnOrderIDChanged(); } } @@ -1287,7 +1336,7 @@ public int OrderID /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)] public global::DbContextModels.Northwind.Product Product { get @@ -1330,7 +1379,7 @@ public int OrderID /// /// Gets or sets the 'ProductID' value. /// - [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -1345,9 +1394,10 @@ public int ProductID if ((this._productID != value)) { this.OnProductIDChanging(value); + this.RaiseDataMemberChanging("ProductID"); this.ValidateProperty("ProductID", value); this._productID = value; - this.RaisePropertyChanged("ProductID"); + this.RaiseDataMemberChanged("ProductID"); this.OnProductIDChanged(); } } @@ -1356,6 +1406,8 @@ public int ProductID /// /// Gets or sets the 'Quantity' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public short Quantity { @@ -1380,6 +1432,8 @@ public short Quantity /// /// Gets or sets the 'UnitPrice' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public decimal UnitPrice { @@ -1424,7 +1478,7 @@ public override object GetIdentity() /// /// The 'Product' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Product : global::OpenRiaServices.Client.Entity { @@ -1508,7 +1562,7 @@ public Product() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)] public global::DbContextModels.Northwind.Category Category { get @@ -1551,6 +1605,7 @@ public Product() /// /// Gets or sets the 'CategoryID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable CategoryID @@ -1601,6 +1656,8 @@ public string CategoryName /// /// Gets or sets the 'Discontinued' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public bool Discontinued { @@ -1625,7 +1682,7 @@ public bool Discontinued /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Product_Order_Detail", "ProductID", "ProductID")] public global::OpenRiaServices.Client.EntityCollection Order_Details { get @@ -1667,7 +1724,9 @@ public int ProductID /// /// Gets or sets the 'ProductName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ProductName @@ -1693,6 +1752,8 @@ public string ProductName /// /// Gets or sets the 'QuantityPerUnit' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(20)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string QuantityPerUnit @@ -1718,6 +1779,8 @@ public string QuantityPerUnit /// /// Gets or sets the 'ReorderLevel' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ReorderLevel { @@ -1766,6 +1829,7 @@ public string ResolveMethod /// /// Gets or sets the 'SupplierID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable SupplierID @@ -1815,6 +1879,8 @@ public string SupplierName /// /// Gets or sets the 'UnitPrice' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitPrice { @@ -1839,6 +1905,8 @@ public string SupplierName /// /// Gets or sets the 'UnitsInStock' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitsInStock { @@ -1863,6 +1931,8 @@ public string SupplierName /// /// Gets or sets the 'UnitsOnOrder' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitsOnOrder { @@ -1952,7 +2022,7 @@ public void DiscontinueProduct() /// /// The 'ProductInfo' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class ProductInfo : global::OpenRiaServices.Client.Entity { @@ -2102,7 +2172,7 @@ public override object GetIdentity() /// /// The 'Region' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Region : global::OpenRiaServices.Client.Entity { @@ -2190,7 +2260,7 @@ public int RegionID /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Region_Territory", "RegionID", "RegionID")] [global::System.ComponentModel.DataAnnotations.CompositionAttribute()] public global::OpenRiaServices.Client.EntityCollection Territories { @@ -2232,7 +2302,7 @@ public override object GetIdentity() /// /// The 'Territory' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Territory : global::OpenRiaServices.Client.Entity { @@ -2272,7 +2342,7 @@ public Territory() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID", IsForeignKey=true)] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)] public global::DbContextModels.Northwind.Region Region { get @@ -2406,7 +2476,7 @@ public override object GetIdentity() } } } -namespace TestDomainServices.EFCore +namespace TestDomainServices.DbCtx { @@ -2431,7 +2501,7 @@ public sealed partial class Northwind : global::OpenRiaServices.Client.DomainCon /// Initializes a new instance of the class. /// public Northwind() : - this(new global::System.Uri("TestDomainServices-EFCore-Northwind.svc", global::System.UriKind.Relative)) + this(new global::System.Uri("TestDomainServices-DbCtx-Northwind.svc", global::System.UriKind.Relative)) { } @@ -2440,7 +2510,7 @@ public Northwind() : /// /// The Northwind service URI. public Northwind(global::System.Uri serviceUri) : - this(global::OpenRiaServices.Client.DomainContext.CreateDomainClient(typeof(global::TestDomainServices.EFCore.Northwind.INorthwindContract), serviceUri, false)) + this(global::OpenRiaServices.Client.DomainContext.CreateDomainClient(typeof(global::TestDomainServices.DbCtx.Northwind.INorthwindContract), serviceUri, false)) { } @@ -2642,7 +2712,7 @@ public void DiscontinueProduct(global::DbContextModels.Northwind.Product product /// A new container instance. protected override global::OpenRiaServices.Client.EntityContainer CreateEntityContainer() { - return new global::TestDomainServices.EFCore.Northwind.NorthwindEntityContainer(); + return new global::TestDomainServices.DbCtx.Northwind.NorthwindEntityContainer(); } /// diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index a674751ce..a17dd0503 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -62,6 +62,12 @@ Always + + Always + + + Always + Always From 92a4f681d99688be66e5a208c8fcae4ee3ee14d7 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Tue, 26 Apr 2022 08:35:42 +0200 Subject: [PATCH 73/99] Updated tests --- .../Northwind/EFCoreDbCtxNorthwindEntities.cs | 5 +- .../Default/EF/Northwind_EFCore.g.cs | 25 +- .../Default/EF/Northwind_EFCore.g.vb | 31 +- .../Scenarios/EFCoreDbContextScenarios.g.cs | 328 +++++++++++------- .../Scenarios/EFCoreDbContextScenarios.g.vb | 224 ++++++------ 5 files changed, 344 insertions(+), 269 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs index 0ecf079de..9a4b5b7f3 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/EFCoreDbCtxNorthwindEntities.cs @@ -144,7 +144,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.CompanyName) .HasMaxLength(40) - .IsConcurrencyToken(); + .IsConcurrencyToken() + .IsRequired(); entity.Property(e => e.ContactName).HasMaxLength(30).IsConcurrencyToken(); @@ -427,6 +428,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.RegionDescription) .HasMaxLength(50) + .IsRequired() .IsFixedLength(); }); @@ -492,6 +494,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) entity.Property(e => e.TerritoryDescription) .HasMaxLength(50) + .IsRequired() .IsFixedLength(); entity.HasOne(d => d.Region) diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs index 4233a963d..1696448d3 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.cs @@ -69,6 +69,7 @@ public Category() /// /// Gets or sets the 'CategoryID' value. /// + [ConcurrencyCheck()] [DataMember()] [Editable(false, AllowInitialValue=true)] [Key()] @@ -169,7 +170,7 @@ public byte[] Picture /// /// Gets the collection of associated entity instances. /// - [Association("FK_Products_Categories", "CategoryID", "CategoryID")] + [Association("Category_Product", "CategoryID", "CategoryID")] public EntityCollection Products { get @@ -451,7 +452,7 @@ public string Country [Key()] [Required()] [RoundtripOriginal()] - [StringLength(5)] + [StringLength(15)] public string CustomerID { get @@ -501,7 +502,7 @@ public string Fax /// /// Gets the collection of associated entity instances. /// - [Association("FK_Orders_Customers", "CustomerID", "CustomerID")] + [Association("Customer_Order", "CustomerID", "CustomerID")] public EntityCollection Orders { get @@ -713,7 +714,7 @@ public Order() /// /// Gets or sets the associated entity. /// - [Association("FK_Orders_Customers", "CustomerID", "CustomerID", IsForeignKey=true)] + [Association("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)] public Customer Customer { get @@ -860,7 +861,7 @@ public Nullable Freight /// /// Gets the collection of associated entity instances. /// - [Association("FK_Order_Details_Orders", "OrderID", "OrderID")] + [Association("Order_Order_Detail", "OrderID", "OrderID")] public EntityCollection Order_Details { get @@ -1143,6 +1144,7 @@ public string ShipRegion /// /// Gets or sets the 'ShipVia' value. /// + [ConcurrencyCheck()] [DataMember()] [RoundtripOriginal()] public Nullable ShipVia @@ -1274,7 +1276,7 @@ public float Discount /// /// Gets or sets the associated entity. /// - [Association("FK_Order_Details_Orders", "OrderID", "OrderID", IsForeignKey=true)] + [Association("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)] public Order Order { get @@ -1344,7 +1346,7 @@ public int OrderID /// /// Gets or sets the associated entity. /// - [Association("FK_Order_Details_Products", "ProductID", "ProductID", IsForeignKey=true)] + [Association("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)] public Product Product { get @@ -1570,7 +1572,7 @@ public Product() /// /// Gets or sets the associated entity. /// - [Association("FK_Products_Categories", "CategoryID", "CategoryID", IsForeignKey=true)] + [Association("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)] public Category Category { get @@ -1690,7 +1692,7 @@ public bool Discontinued /// /// Gets the collection of associated entity instances. /// - [Association("FK_Order_Details_Products", "ProductID", "ProductID")] + [Association("Product_Order_Detail", "ProductID", "ProductID")] public EntityCollection Order_Details { get @@ -1706,7 +1708,6 @@ public EntityCollection Order_Details /// /// Gets or sets the 'ProductID' value. /// - [ConcurrencyCheck()] [DataMember()] [Editable(false, AllowInitialValue=true)] [Key()] @@ -2269,7 +2270,7 @@ public int RegionID /// /// Gets the collection of associated entity instances. /// - [Association("FK_Territories_Region", "RegionID", "RegionID")] + [Association("Region_Territory", "RegionID", "RegionID")] [Composition()] public EntityCollection Territories { @@ -2351,7 +2352,7 @@ public Territory() /// /// Gets or sets the associated entity. /// - [Association("FK_Territories_Region", "RegionID", "RegionID", IsForeignKey=true)] + [Association("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)] public Region Region { get diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb index a8ff9dbe3..5251ad2cb 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Northwind_EFCore.g.vb @@ -84,7 +84,8 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the 'CategoryID' value. ''' - _ @@ -169,7 +170,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets the collection of associated entity instances. ''' - _ + _ Public ReadOnly Property Products() As EntityCollection(Of Product) Get If (Me._products Is Nothing) Then @@ -443,7 +444,7 @@ Namespace EFCoreModels.Northwind Key(), _ Required(), _ RoundtripOriginal(), _ - StringLength(5)> _ + StringLength(15)> _ Public Property CustomerID() As String Get Return Me._customerID @@ -485,7 +486,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets the collection of associated entity instances. ''' - _ + _ Public ReadOnly Property Orders() As EntityCollection(Of Order) Get If (Me._orders Is Nothing) Then @@ -709,7 +710,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property Customer() As Customer Get If (Me._customer Is Nothing) Then @@ -830,7 +831,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets the collection of associated entity instances. ''' - _ + _ Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) Get If (Me._order_Details Is Nothing) Then @@ -1071,7 +1072,8 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the 'ShipVia' value. ''' - _ Public Property ShipVia() As Nullable(Of Integer) Get @@ -1201,7 +1203,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property Order() As Order Get If (Me._order Is Nothing) Then @@ -1258,7 +1260,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property Product() As Product Get If (Me._product Is Nothing) Then @@ -1491,7 +1493,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property Category() As Category Get If (Me._category Is Nothing) Then @@ -1590,7 +1592,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets the collection of associated entity instances. ''' - _ + _ Public ReadOnly Property Order_Details() As EntityCollection(Of Order_Detail) Get If (Me._order_Details Is Nothing) Then @@ -1603,8 +1605,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the 'ProductID' value. ''' - _ @@ -2108,7 +2109,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets the collection of associated entity instances. ''' - _ Public ReadOnly Property Territories() As EntityCollection(Of Territory) Get @@ -2190,7 +2191,7 @@ Namespace EFCoreModels.Northwind ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property Region() As Region Get If (Me._region Is Nothing) Then diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs index 1325ffd40..9221ebf88 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.cs @@ -8,14 +8,14 @@ // //------------------------------------------------------------------------------ -namespace DbContextModels.Northwind +namespace EFCoreModels.Northwind { /// /// The 'Category' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Category : global::OpenRiaServices.Client.Entity { @@ -27,7 +27,7 @@ public sealed partial class Category : global::OpenRiaServices.Client.Entity private byte[] _picture; - private global::OpenRiaServices.Client.EntityCollection _products; + private global::OpenRiaServices.Client.EntityCollection _products; #region Extensibility Method Definitions @@ -59,6 +59,7 @@ public Category() /// /// Gets or sets the 'CategoryID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] @@ -159,30 +160,30 @@ public byte[] Picture /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID")] - public global::OpenRiaServices.Client.EntityCollection Products + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Category_Product", "CategoryID", "CategoryID")] + public global::OpenRiaServices.Client.EntityCollection Products { get { if ((this._products == null)) { - this._products = new global::OpenRiaServices.Client.EntityCollection(this, "Products", this.FilterProducts, this.AttachProducts, this.DetachProducts); + this._products = new global::OpenRiaServices.Client.EntityCollection(this, "Products", this.FilterProducts, this.AttachProducts, this.DetachProducts); } return this._products; } } - private void AttachProducts(global::DbContextModels.Northwind.Product entity) + private void AttachProducts(global::EFCoreModels.Northwind.Product entity) { entity.Category = this; } - private void DetachProducts(global::DbContextModels.Northwind.Product entity) + private void DetachProducts(global::EFCoreModels.Northwind.Product entity) { entity.Category = null; } - private bool FilterProducts(global::DbContextModels.Northwind.Product entity) + private bool FilterProducts(global::EFCoreModels.Northwind.Product entity) { return (entity.CategoryID == this.CategoryID); } @@ -200,7 +201,7 @@ public override object GetIdentity() /// /// The 'Customer' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Customer : global::OpenRiaServices.Client.Entity { @@ -220,7 +221,7 @@ public sealed partial class Customer : global::OpenRiaServices.Client.Entity private string _fax; - private global::OpenRiaServices.Client.EntityCollection _orders; + private global::OpenRiaServices.Client.EntityCollection _orders; private string _phone; @@ -272,6 +273,8 @@ public Customer() /// /// Gets or sets the 'Address' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Address @@ -297,6 +300,8 @@ public string Address /// /// Gets or sets the 'City' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string City @@ -322,7 +327,9 @@ public string City /// /// Gets or sets the 'CompanyName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string CompanyName @@ -348,6 +355,8 @@ public string CompanyName /// /// Gets or sets the 'ContactName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ContactName @@ -373,6 +382,8 @@ public string ContactName /// /// Gets or sets the 'ContactTitle' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(30)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ContactTitle @@ -398,6 +409,8 @@ public string ContactTitle /// /// Gets or sets the 'Country' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Country @@ -423,11 +436,12 @@ public string Country /// /// Gets or sets the 'CustomerID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] - [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(5)] + [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string CustomerID { @@ -451,6 +465,8 @@ public string CustomerID /// /// Gets or sets the 'Fax' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Fax @@ -476,14 +492,14 @@ public string Fax /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID")] - public global::OpenRiaServices.Client.EntityCollection Orders + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Customer_Order", "CustomerID", "CustomerID")] + public global::OpenRiaServices.Client.EntityCollection Orders { get { if ((this._orders == null)) { - this._orders = new global::OpenRiaServices.Client.EntityCollection(this, "Orders", this.FilterOrders, this.AttachOrders, this.DetachOrders); + this._orders = new global::OpenRiaServices.Client.EntityCollection(this, "Orders", this.FilterOrders, this.AttachOrders, this.DetachOrders); } return this._orders; } @@ -492,6 +508,8 @@ public string Fax /// /// Gets or sets the 'Phone' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(24)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Phone @@ -517,6 +535,8 @@ public string Phone /// /// Gets or sets the 'PostalCode' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string PostalCode @@ -542,6 +562,8 @@ public string PostalCode /// /// Gets or sets the 'Region' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string Region @@ -564,17 +586,17 @@ public string Region } } - private void AttachOrders(global::DbContextModels.Northwind.Order entity) + private void AttachOrders(global::EFCoreModels.Northwind.Order entity) { entity.Customer = this; } - private void DetachOrders(global::DbContextModels.Northwind.Order entity) + private void DetachOrders(global::EFCoreModels.Northwind.Order entity) { entity.Customer = null; } - private bool FilterOrders(global::DbContextModels.Northwind.Order entity) + private bool FilterOrders(global::EFCoreModels.Northwind.Order entity) { return (entity.CustomerID == this.CustomerID); } @@ -592,11 +614,11 @@ public override object GetIdentity() /// /// The 'Order' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Order : global::OpenRiaServices.Client.Entity { - private global::OpenRiaServices.Client.EntityRef _customer; + private global::OpenRiaServices.Client.EntityRef _customer; private string _customerID; @@ -606,7 +628,7 @@ public sealed partial class Order : global::OpenRiaServices.Client.Entity private global::System.Nullable _freight; - private global::OpenRiaServices.Client.EntityCollection _order_Details; + private global::OpenRiaServices.Client.EntityCollection _order_Details; private global::System.Nullable _orderDate; @@ -682,20 +704,20 @@ public Order() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Orders_Customers", "CustomerID", "CustomerID", IsForeignKey=true)] - public global::DbContextModels.Northwind.Customer Customer + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Customer_Order", "CustomerID", "CustomerID", IsForeignKey=true)] + public global::EFCoreModels.Northwind.Customer Customer { get { if ((this._customer == null)) { - this._customer = new global::OpenRiaServices.Client.EntityRef(this, "Customer", this.FilterCustomer); + this._customer = new global::OpenRiaServices.Client.EntityRef(this, "Customer", this.FilterCustomer); } return this._customer.Entity; } set { - global::DbContextModels.Northwind.Customer previous = this.Customer; + global::EFCoreModels.Northwind.Customer previous = this.Customer; if ((previous != value)) { this.ValidateProperty("Customer", value); @@ -725,6 +747,7 @@ public Order() /// /// Gets or sets the 'CustomerID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(5)] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -751,6 +774,7 @@ public string CustomerID /// /// Gets or sets the 'EmployeeID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable EmployeeID @@ -801,6 +825,8 @@ public string FormattedName /// /// Gets or sets the 'Freight' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable Freight { @@ -825,14 +851,14 @@ public string FormattedName /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID")] - public global::OpenRiaServices.Client.EntityCollection Order_Details + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Order_Order_Detail", "OrderID", "OrderID")] + public global::OpenRiaServices.Client.EntityCollection Order_Details { get { if ((this._order_Details == null)) { - this._order_Details = new global::OpenRiaServices.Client.EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + this._order_Details = new global::OpenRiaServices.Client.EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); } return this._order_Details; } @@ -841,6 +867,8 @@ public string FormattedName /// /// Gets or sets the 'OrderDate' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable OrderDate { @@ -865,6 +893,7 @@ public string FormattedName /// /// Gets or sets the 'OrderID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] @@ -891,6 +920,8 @@ public int OrderID /// /// Gets or sets the 'RequiredDate' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable RequiredDate { @@ -915,6 +946,8 @@ public int OrderID /// /// Gets or sets the 'ShipAddress' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(60)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipAddress @@ -940,6 +973,8 @@ public string ShipAddress /// /// Gets or sets the 'ShipCity' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipCity @@ -965,6 +1000,8 @@ public string ShipCity /// /// Gets or sets the 'ShipCountry' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipCountry @@ -990,6 +1027,8 @@ public string ShipCountry /// /// Gets or sets the 'ShipName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipName @@ -1015,6 +1054,8 @@ public string ShipName /// /// Gets or sets the 'ShippedDate' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ShippedDate { @@ -1039,6 +1080,8 @@ public string ShipName /// /// Gets or sets the 'ShipPostalCode' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(10)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipPostalCode @@ -1064,6 +1107,8 @@ public string ShipPostalCode /// /// Gets or sets the 'ShipRegion' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(15)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ShipRegion @@ -1089,6 +1134,7 @@ public string ShipRegion /// /// Gets or sets the 'ShipVia' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ShipVia @@ -1111,22 +1157,22 @@ public string ShipRegion } } - private bool FilterCustomer(global::DbContextModels.Northwind.Customer entity) + private bool FilterCustomer(global::EFCoreModels.Northwind.Customer entity) { return (entity.CustomerID == this.CustomerID); } - private void AttachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + private void AttachOrder_Details(global::EFCoreModels.Northwind.Order_Detail entity) { entity.Order = this; } - private void DetachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + private void DetachOrder_Details(global::EFCoreModels.Northwind.Order_Detail entity) { entity.Order = null; } - private bool FilterOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + private bool FilterOrder_Details(global::EFCoreModels.Northwind.Order_Detail entity) { return (entity.OrderID == this.OrderID); } @@ -1144,17 +1190,17 @@ public override object GetIdentity() /// /// The 'Order_Detail' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Order_Detail : global::OpenRiaServices.Client.Entity { private float _discount; - private global::OpenRiaServices.Client.EntityRef _order; + private global::OpenRiaServices.Client.EntityRef _order; private int _orderID; - private global::OpenRiaServices.Client.EntityRef _product; + private global::OpenRiaServices.Client.EntityRef _product; private int _productID; @@ -1194,6 +1240,8 @@ public Order_Detail() /// /// Gets or sets the 'Discount' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public float Discount { @@ -1218,20 +1266,20 @@ public float Discount /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Orders", "OrderID", "OrderID", IsForeignKey=true)] - public global::DbContextModels.Northwind.Order Order + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Order_Order_Detail", "OrderID", "OrderID", IsForeignKey=true)] + public global::EFCoreModels.Northwind.Order Order { get { if ((this._order == null)) { - this._order = new global::OpenRiaServices.Client.EntityRef(this, "Order", this.FilterOrder); + this._order = new global::OpenRiaServices.Client.EntityRef(this, "Order", this.FilterOrder); } return this._order.Entity; } set { - global::DbContextModels.Northwind.Order previous = this.Order; + global::EFCoreModels.Northwind.Order previous = this.Order; if ((previous != value)) { this.ValidateProperty("Order", value); @@ -1261,7 +1309,7 @@ public float Discount /// /// Gets or sets the 'OrderID' value. /// - [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -1276,9 +1324,10 @@ public int OrderID if ((this._orderID != value)) { this.OnOrderIDChanging(value); + this.RaiseDataMemberChanging("OrderID"); this.ValidateProperty("OrderID", value); this._orderID = value; - this.RaisePropertyChanged("OrderID"); + this.RaiseDataMemberChanged("OrderID"); this.OnOrderIDChanged(); } } @@ -1287,20 +1336,20 @@ public int OrderID /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID", IsForeignKey=true)] - public global::DbContextModels.Northwind.Product Product + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Product_Order_Detail", "ProductID", "ProductID", IsForeignKey=true)] + public global::EFCoreModels.Northwind.Product Product { get { if ((this._product == null)) { - this._product = new global::OpenRiaServices.Client.EntityRef(this, "Product", this.FilterProduct); + this._product = new global::OpenRiaServices.Client.EntityRef(this, "Product", this.FilterProduct); } return this._product.Entity; } set { - global::DbContextModels.Northwind.Product previous = this.Product; + global::EFCoreModels.Northwind.Product previous = this.Product; if ((previous != value)) { this.ValidateProperty("Product", value); @@ -1330,7 +1379,7 @@ public int OrderID /// /// Gets or sets the 'ProductID' value. /// - [global::System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)] + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.KeyAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] @@ -1345,9 +1394,10 @@ public int ProductID if ((this._productID != value)) { this.OnProductIDChanging(value); + this.RaiseDataMemberChanging("ProductID"); this.ValidateProperty("ProductID", value); this._productID = value; - this.RaisePropertyChanged("ProductID"); + this.RaiseDataMemberChanged("ProductID"); this.OnProductIDChanged(); } } @@ -1356,6 +1406,8 @@ public int ProductID /// /// Gets or sets the 'Quantity' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public short Quantity { @@ -1380,6 +1432,8 @@ public short Quantity /// /// Gets or sets the 'UnitPrice' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public decimal UnitPrice { @@ -1401,12 +1455,12 @@ public decimal UnitPrice } } - private bool FilterOrder(global::DbContextModels.Northwind.Order entity) + private bool FilterOrder(global::EFCoreModels.Northwind.Order entity) { return (entity.OrderID == this.OrderID); } - private bool FilterProduct(global::DbContextModels.Northwind.Product entity) + private bool FilterProduct(global::EFCoreModels.Northwind.Product entity) { return (entity.ProductID == this.ProductID); } @@ -1424,11 +1478,11 @@ public override object GetIdentity() /// /// The 'Product' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Product : global::OpenRiaServices.Client.Entity { - private global::OpenRiaServices.Client.EntityRef _category; + private global::OpenRiaServices.Client.EntityRef _category; private global::System.Nullable _categoryID; @@ -1436,7 +1490,7 @@ public sealed partial class Product : global::OpenRiaServices.Client.Entity private bool _discontinued; - private global::OpenRiaServices.Client.EntityCollection _order_Details; + private global::OpenRiaServices.Client.EntityCollection _order_Details; private int _productID; @@ -1508,20 +1562,20 @@ public Product() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Products_Categories", "CategoryID", "CategoryID", IsForeignKey=true)] - public global::DbContextModels.Northwind.Category Category + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Category_Product", "CategoryID", "CategoryID", IsForeignKey=true)] + public global::EFCoreModels.Northwind.Category Category { get { if ((this._category == null)) { - this._category = new global::OpenRiaServices.Client.EntityRef(this, "Category", this.FilterCategory); + this._category = new global::OpenRiaServices.Client.EntityRef(this, "Category", this.FilterCategory); } return this._category.Entity; } set { - global::DbContextModels.Northwind.Category previous = this.Category; + global::EFCoreModels.Northwind.Category previous = this.Category; if ((previous != value)) { this.ValidateProperty("Category", value); @@ -1551,6 +1605,7 @@ public Product() /// /// Gets or sets the 'CategoryID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable CategoryID @@ -1601,6 +1656,8 @@ public string CategoryName /// /// Gets or sets the 'Discontinued' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public bool Discontinued { @@ -1625,14 +1682,14 @@ public bool Discontinued /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Order_Details_Products", "ProductID", "ProductID")] - public global::OpenRiaServices.Client.EntityCollection Order_Details + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Product_Order_Detail", "ProductID", "ProductID")] + public global::OpenRiaServices.Client.EntityCollection Order_Details { get { if ((this._order_Details == null)) { - this._order_Details = new global::OpenRiaServices.Client.EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); + this._order_Details = new global::OpenRiaServices.Client.EntityCollection(this, "Order_Details", this.FilterOrder_Details, this.AttachOrder_Details, this.DetachOrder_Details); } return this._order_Details; } @@ -1667,7 +1724,9 @@ public int ProductID /// /// Gets or sets the 'ProductName' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RequiredAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(40)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string ProductName @@ -1693,6 +1752,8 @@ public string ProductName /// /// Gets or sets the 'QuantityPerUnit' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.ComponentModel.DataAnnotations.StringLengthAttribute(20)] [global::System.Runtime.Serialization.DataMemberAttribute()] public string QuantityPerUnit @@ -1718,6 +1779,8 @@ public string QuantityPerUnit /// /// Gets or sets the 'ReorderLevel' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable ReorderLevel { @@ -1766,6 +1829,7 @@ public string ResolveMethod /// /// Gets or sets the 'SupplierID' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable SupplierID @@ -1815,6 +1879,8 @@ public string SupplierName /// /// Gets or sets the 'UnitPrice' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitPrice { @@ -1839,6 +1905,8 @@ public string SupplierName /// /// Gets or sets the 'UnitsInStock' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitsInStock { @@ -1863,6 +1931,8 @@ public string SupplierName /// /// Gets or sets the 'UnitsOnOrder' value. /// + [global::System.ComponentModel.DataAnnotations.ConcurrencyCheckAttribute()] + [global::System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()] [global::System.Runtime.Serialization.DataMemberAttribute()] public global::System.Nullable UnitsOnOrder { @@ -1908,22 +1978,22 @@ public bool CanDiscontinueProduct } } - private bool FilterCategory(global::DbContextModels.Northwind.Category entity) + private bool FilterCategory(global::EFCoreModels.Northwind.Category entity) { return (entity.CategoryID == this.CategoryID); } - private void AttachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + private void AttachOrder_Details(global::EFCoreModels.Northwind.Order_Detail entity) { entity.Product = this; } - private void DetachOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + private void DetachOrder_Details(global::EFCoreModels.Northwind.Order_Detail entity) { entity.Product = null; } - private bool FilterOrder_Details(global::DbContextModels.Northwind.Order_Detail entity) + private bool FilterOrder_Details(global::EFCoreModels.Northwind.Order_Detail entity) { return (entity.ProductID == this.ProductID); } @@ -1952,7 +2022,7 @@ public void DiscontinueProduct() /// /// The 'ProductInfo' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class ProductInfo : global::OpenRiaServices.Client.Entity { @@ -2102,7 +2172,7 @@ public override object GetIdentity() /// /// The 'Region' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Region : global::OpenRiaServices.Client.Entity { @@ -2110,7 +2180,7 @@ public sealed partial class Region : global::OpenRiaServices.Client.Entity private int _regionID; - private global::OpenRiaServices.Client.EntityCollection _territories; + private global::OpenRiaServices.Client.EntityCollection _territories; #region Extensibility Method Definitions @@ -2190,31 +2260,31 @@ public int RegionID /// /// Gets the collection of associated entity instances. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID")] + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Region_Territory", "RegionID", "RegionID")] [global::System.ComponentModel.DataAnnotations.CompositionAttribute()] - public global::OpenRiaServices.Client.EntityCollection Territories + public global::OpenRiaServices.Client.EntityCollection Territories { get { if ((this._territories == null)) { - this._territories = new global::OpenRiaServices.Client.EntityCollection(this, "Territories", this.FilterTerritories, this.AttachTerritories, this.DetachTerritories); + this._territories = new global::OpenRiaServices.Client.EntityCollection(this, "Territories", this.FilterTerritories, this.AttachTerritories, this.DetachTerritories); } return this._territories; } } - private void AttachTerritories(global::DbContextModels.Northwind.Territory entity) + private void AttachTerritories(global::EFCoreModels.Northwind.Territory entity) { entity.Region = this; } - private void DetachTerritories(global::DbContextModels.Northwind.Territory entity) + private void DetachTerritories(global::EFCoreModels.Northwind.Territory entity) { entity.Region = null; } - private bool FilterTerritories(global::DbContextModels.Northwind.Territory entity) + private bool FilterTerritories(global::EFCoreModels.Northwind.Territory entity) { return (entity.RegionID == this.RegionID); } @@ -2232,11 +2302,11 @@ public override object GetIdentity() /// /// The 'Territory' entity class. /// - [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DbContextModels.Northwind")] + [global::System.Runtime.Serialization.DataContractAttribute(Namespace="http://schemas.datacontract.org/2004/07/DataTests.Northwind")] public sealed partial class Territory : global::OpenRiaServices.Client.Entity { - private global::OpenRiaServices.Client.EntityRef _region; + private global::OpenRiaServices.Client.EntityRef _region; private int _regionID; @@ -2272,20 +2342,20 @@ public Territory() /// /// Gets or sets the associated entity. /// - [global::System.ComponentModel.DataAnnotations.AssociationAttribute("FK_Territories_Region", "RegionID", "RegionID", IsForeignKey=true)] - public global::DbContextModels.Northwind.Region Region + [global::System.ComponentModel.DataAnnotations.AssociationAttribute("Region_Territory", "RegionID", "RegionID", IsForeignKey=true)] + public global::EFCoreModels.Northwind.Region Region { get { if ((this._region == null)) { - this._region = new global::OpenRiaServices.Client.EntityRef(this, "Region", this.FilterRegion); + this._region = new global::OpenRiaServices.Client.EntityRef(this, "Region", this.FilterRegion); } return this._region.Entity; } set { - global::DbContextModels.Northwind.Region previous = this.Region; + global::EFCoreModels.Northwind.Region previous = this.Region; if ((previous != value)) { this.ValidateProperty("Region", value); @@ -2391,7 +2461,7 @@ public string TerritoryID } } - private bool FilterRegion(global::DbContextModels.Northwind.Region entity) + private bool FilterRegion(global::EFCoreModels.Northwind.Region entity) { return (entity.RegionID == this.RegionID); } @@ -2457,77 +2527,77 @@ public Northwind(global::OpenRiaServices.Client.DomainClient domainClient) : /// /// Gets the set of entity instances that have been loaded into this instance. /// - public global::OpenRiaServices.Client.EntitySet Categories + public global::OpenRiaServices.Client.EntitySet Categories { get { - return base.EntityContainer.GetEntitySet(); + return base.EntityContainer.GetEntitySet(); } } /// /// Gets the set of entity instances that have been loaded into this instance. /// - public global::OpenRiaServices.Client.EntitySet Customers + public global::OpenRiaServices.Client.EntitySet Customers { get { - return base.EntityContainer.GetEntitySet(); + return base.EntityContainer.GetEntitySet(); } } /// /// Gets the set of entity instances that have been loaded into this instance. /// - public global::OpenRiaServices.Client.EntitySet Order_Details + public global::OpenRiaServices.Client.EntitySet Order_Details { get { - return base.EntityContainer.GetEntitySet(); + return base.EntityContainer.GetEntitySet(); } } /// /// Gets the set of entity instances that have been loaded into this instance. /// - public global::OpenRiaServices.Client.EntitySet Orders + public global::OpenRiaServices.Client.EntitySet Orders { get { - return base.EntityContainer.GetEntitySet(); + return base.EntityContainer.GetEntitySet(); } } /// /// Gets the set of entity instances that have been loaded into this instance. /// - public global::OpenRiaServices.Client.EntitySet Products + public global::OpenRiaServices.Client.EntitySet Products { get { - return base.EntityContainer.GetEntitySet(); + return base.EntityContainer.GetEntitySet(); } } /// /// Gets the set of entity instances that have been loaded into this instance. /// - public global::OpenRiaServices.Client.EntitySet ProductInfos + public global::OpenRiaServices.Client.EntitySet ProductInfos { get { - return base.EntityContainer.GetEntitySet(); + return base.EntityContainer.GetEntitySet(); } } /// /// Gets the set of entity instances that have been loaded into this instance. /// - public global::OpenRiaServices.Client.EntitySet Regions + public global::OpenRiaServices.Client.EntitySet Regions { get { - return base.EntityContainer.GetEntitySet(); + return base.EntityContainer.GetEntitySet(); } } @@ -2535,40 +2605,40 @@ public Northwind(global::OpenRiaServices.Client.DomainClient domainClient) : /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. /// /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetCategoriesQuery() + public global::OpenRiaServices.Client.EntityQuery GetCategoriesQuery() { this.ValidateMethod("GetCategoriesQuery", null); - return base.CreateQuery("GetCategories", null, false, true); + return base.CreateQuery("GetCategories", null, false, true); } /// /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. /// /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetCustomersQuery() + public global::OpenRiaServices.Client.EntityQuery GetCustomersQuery() { this.ValidateMethod("GetCustomersQuery", null); - return base.CreateQuery("GetCustomers", null, false, true); + return base.CreateQuery("GetCustomers", null, false, true); } /// /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. /// /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetOrderDetailsQuery() + public global::OpenRiaServices.Client.EntityQuery GetOrderDetailsQuery() { this.ValidateMethod("GetOrderDetailsQuery", null); - return base.CreateQuery("GetOrderDetails", null, false, true); + return base.CreateQuery("GetOrderDetails", null, false, true); } /// /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. /// /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetOrdersQuery() + public global::OpenRiaServices.Client.EntityQuery GetOrdersQuery() { this.ValidateMethod("GetOrdersQuery", null); - return base.CreateQuery("GetOrders", null, false, true); + return base.CreateQuery("GetOrders", null, false, true); } /// @@ -2576,32 +2646,32 @@ public Northwind(global::OpenRiaServices.Client.DomainClient domainClient) : /// /// The value for the 'id' parameter of the query. /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetProductByIdQuery(int id) + public global::OpenRiaServices.Client.EntityQuery GetProductByIdQuery(int id) { global::System.Collections.Generic.Dictionary parameters = new global::System.Collections.Generic.Dictionary(); parameters.Add("id", id); this.ValidateMethod("GetProductByIdQuery", parameters); - return base.CreateQuery("GetProductById", parameters, false, false); + return base.CreateQuery("GetProductById", parameters, false, false); } /// /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. /// /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetProductInfosQuery() + public global::OpenRiaServices.Client.EntityQuery GetProductInfosQuery() { this.ValidateMethod("GetProductInfosQuery", null); - return base.CreateQuery("GetProductInfos", null, false, true); + return base.CreateQuery("GetProductInfos", null, false, true); } /// /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. /// /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetProductsQuery() + public global::OpenRiaServices.Client.EntityQuery GetProductsQuery() { this.ValidateMethod("GetProductsQuery", null); - return base.CreateQuery("GetProducts", null, false, true); + return base.CreateQuery("GetProducts", null, false, true); } /// @@ -2609,29 +2679,29 @@ public Northwind(global::OpenRiaServices.Client.DomainClient domainClient) : /// /// The value for the 'id' parameter of the query. /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetRegionByIdQuery(int id) + public global::OpenRiaServices.Client.EntityQuery GetRegionByIdQuery(int id) { global::System.Collections.Generic.Dictionary parameters = new global::System.Collections.Generic.Dictionary(); parameters.Add("id", id); this.ValidateMethod("GetRegionByIdQuery", parameters); - return base.CreateQuery("GetRegionById", parameters, false, false); + return base.CreateQuery("GetRegionById", parameters, false, false); } /// /// Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. /// /// An EntityQuery that can be loaded to retrieve entity instances. - public global::OpenRiaServices.Client.EntityQuery GetRegionsQuery() + public global::OpenRiaServices.Client.EntityQuery GetRegionsQuery() { this.ValidateMethod("GetRegionsQuery", null); - return base.CreateQuery("GetRegions", null, false, true); + return base.CreateQuery("GetRegions", null, false, true); } /// /// Invokes the 'DiscontinueProduct' method of the specified entity. /// /// The entity instance. - public void DiscontinueProduct(global::DbContextModels.Northwind.Product product) + public void DiscontinueProduct(global::EFCoreModels.Northwind.Product product) { product.DiscontinueProduct(); } @@ -2667,7 +2737,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetCategories'. /// The 'QueryResult' returned from the 'GetCategories' operation. - global::OpenRiaServices.Client.QueryResult EndGetCategories(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetCategories(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetCustomers' operation. @@ -2684,7 +2754,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetCustomers'. /// The 'QueryResult' returned from the 'GetCustomers' operation. - global::OpenRiaServices.Client.QueryResult EndGetCustomers(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetCustomers(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetOrderDetails' operation. @@ -2701,7 +2771,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetOrderDetails'. /// The 'QueryResult' returned from the 'GetOrderDetails' operation. - global::OpenRiaServices.Client.QueryResult EndGetOrderDetails(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetOrderDetails(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetOrders' operation. @@ -2718,7 +2788,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetOrders'. /// The 'QueryResult' returned from the 'GetOrders' operation. - global::OpenRiaServices.Client.QueryResult EndGetOrders(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetOrders(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetProductById' operation. @@ -2736,7 +2806,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetProductById'. /// The 'QueryResult' returned from the 'GetProductById' operation. - global::OpenRiaServices.Client.QueryResult EndGetProductById(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetProductById(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetProductInfos' operation. @@ -2753,7 +2823,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetProductInfos'. /// The 'QueryResult' returned from the 'GetProductInfos' operation. - global::OpenRiaServices.Client.QueryResult EndGetProductInfos(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetProductInfos(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetProducts' operation. @@ -2770,7 +2840,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetProducts'. /// The 'QueryResult' returned from the 'GetProducts' operation. - global::OpenRiaServices.Client.QueryResult EndGetProducts(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetProducts(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetRegionById' operation. @@ -2788,7 +2858,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetRegionById'. /// The 'QueryResult' returned from the 'GetRegionById' operation. - global::OpenRiaServices.Client.QueryResult EndGetRegionById(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetRegionById(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'GetRegions' operation. @@ -2805,7 +2875,7 @@ public interface INorthwindContract /// /// The IAsyncResult returned from 'BeginGetRegions'. /// The 'QueryResult' returned from the 'GetRegions' operation. - global::OpenRiaServices.Client.QueryResult EndGetRegions(global::System.IAsyncResult result); + global::OpenRiaServices.Client.QueryResult EndGetRegions(global::System.IAsyncResult result); /// /// Asynchronously invokes the 'SubmitChanges' operation. @@ -2830,14 +2900,14 @@ internal sealed class NorthwindEntityContainer : global::OpenRiaServices.Client. public NorthwindEntityContainer() { - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.Edit); - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); - this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.Edit); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); + this.CreateEntitySet(global::OpenRiaServices.Client.EntitySetOperations.All); } } } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb index b078bce73..b82a1a9fb 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/FullTypeNames/Scenarios/EFCoreDbContextScenarios.g.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -14,7 +14,7 @@ Option Strict On Option Explicit On -Namespace DbContextModels.Northwind +Namespace EFCoreModels.Northwind ''' ''' The 'Category' entity class. @@ -31,7 +31,7 @@ Namespace DbContextModels.Northwind Private _picture() As Byte - Private _products As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Product) + Private _products As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Product) #Region "Extensibility Method Definitions" @@ -159,24 +159,24 @@ Namespace DbContextModels.Northwind ''' Gets the collection of associated entity instances. ''' _ - Public ReadOnly Property Products() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Product) + Public ReadOnly Property Products() As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Product) Get If (Me._products Is Nothing) Then - Me._products = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Product)(Me, "Products", AddressOf Me.FilterProducts, AddressOf Me.AttachProducts, AddressOf Me.DetachProducts) + Me._products = New Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Product)(Me, "Products", AddressOf Me.FilterProducts, AddressOf Me.AttachProducts, AddressOf Me.DetachProducts) End If Return Me._products End Get End Property - Private Sub AttachProducts(ByVal entity As Global.DbContextModels.Northwind.Product) + Private Sub AttachProducts(ByVal entity As Global.EFCoreModels.Northwind.Product) entity.Category = Me End Sub - Private Sub DetachProducts(ByVal entity As Global.DbContextModels.Northwind.Product) + Private Sub DetachProducts(ByVal entity As Global.EFCoreModels.Northwind.Product) entity.Category = Nothing End Sub - Private Function FilterProducts(ByVal entity As Global.DbContextModels.Northwind.Product) As Boolean + Private Function FilterProducts(ByVal entity As Global.EFCoreModels.Northwind.Product) As Boolean Return Object.Equals(entity.CategoryID, Me.CategoryID) End Function @@ -212,7 +212,7 @@ Namespace DbContextModels.Northwind Private _fax As String - Private _orders As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order) + Private _orders As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order) Private _phone As String @@ -431,7 +431,7 @@ Namespace DbContextModels.Northwind Global.System.ComponentModel.DataAnnotations.KeyAttribute(), _ Global.System.ComponentModel.DataAnnotations.RequiredAttribute(), _ Global.System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute(), _ - Global.System.ComponentModel.DataAnnotations.StringLengthAttribute(5), _ + Global.System.ComponentModel.DataAnnotations.StringLengthAttribute(15), _ Global.System.Runtime.Serialization.DataMemberAttribute()> _ Public Property CustomerID() As String Get @@ -475,10 +475,10 @@ Namespace DbContextModels.Northwind ''' Gets the collection of associated entity instances. ''' _ - Public ReadOnly Property Orders() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order) + Public ReadOnly Property Orders() As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order) Get If (Me._orders Is Nothing) Then - Me._orders = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order)(Me, "Orders", AddressOf Me.FilterOrders, AddressOf Me.AttachOrders, AddressOf Me.DetachOrders) + Me._orders = New Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order)(Me, "Orders", AddressOf Me.FilterOrders, AddressOf Me.AttachOrders, AddressOf Me.DetachOrders) End If Return Me._orders End Get @@ -553,15 +553,15 @@ Namespace DbContextModels.Northwind End Set End Property - Private Sub AttachOrders(ByVal entity As Global.DbContextModels.Northwind.Order) + Private Sub AttachOrders(ByVal entity As Global.EFCoreModels.Northwind.Order) entity.Customer = Me End Sub - Private Sub DetachOrders(ByVal entity As Global.DbContextModels.Northwind.Order) + Private Sub DetachOrders(ByVal entity As Global.EFCoreModels.Northwind.Order) entity.Customer = Nothing End Sub - Private Function FilterOrders(ByVal entity As Global.DbContextModels.Northwind.Order) As Boolean + Private Function FilterOrders(ByVal entity As Global.EFCoreModels.Northwind.Order) As Boolean Return Object.Equals(entity.CustomerID, Me.CustomerID) End Function @@ -581,7 +581,7 @@ Namespace DbContextModels.Northwind Partial Public NotInheritable Class Order Inherits Global.OpenRiaServices.Client.Entity - Private _customer As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Customer) + Private _customer As Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Customer) Private _customerID As String @@ -591,7 +591,7 @@ Namespace DbContextModels.Northwind Private _freight As Global.System.Nullable(Of Decimal) - Private _order_Details As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + Private _order_Details As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order_Detail) Private _orderDate As Global.System.Nullable(Of Date) @@ -699,15 +699,15 @@ Namespace DbContextModels.Northwind ''' Gets or sets the associated entity. '''
_ - Public Property Customer() As Global.DbContextModels.Northwind.Customer + Public Property Customer() As Global.EFCoreModels.Northwind.Customer Get If (Me._customer Is Nothing) Then - Me._customer = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Customer)(Me, "Customer", AddressOf Me.FilterCustomer) + Me._customer = New Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Customer)(Me, "Customer", AddressOf Me.FilterCustomer) End If Return Me._customer.Entity End Get Set - Dim previous As Global.DbContextModels.Northwind.Customer = Me.Customer + Dim previous As Global.EFCoreModels.Northwind.Customer = Me.Customer If (Object.Equals(previous, value) = false) Then Me.ValidateProperty("Customer", value) If (Not (previous) Is Nothing) Then @@ -820,10 +820,10 @@ Namespace DbContextModels.Northwind ''' Gets the collection of associated entity instances. '''
_ - Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order_Detail) Get If (Me._order_Details Is Nothing) Then - Me._order_Details = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + Me._order_Details = New Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) End If Return Me._order_Details End Get @@ -1079,19 +1079,19 @@ Namespace DbContextModels.Northwind End Set End Property - Private Function FilterCustomer(ByVal entity As Global.DbContextModels.Northwind.Customer) As Boolean + Private Function FilterCustomer(ByVal entity As Global.EFCoreModels.Northwind.Customer) As Boolean Return Object.Equals(entity.CustomerID, Me.CustomerID) End Function - Private Sub AttachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + Private Sub AttachOrder_Details(ByVal entity As Global.EFCoreModels.Northwind.Order_Detail) entity.Order = Me End Sub - Private Sub DetachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + Private Sub DetachOrder_Details(ByVal entity As Global.EFCoreModels.Northwind.Order_Detail) entity.Order = Nothing End Sub - Private Function FilterOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) As Boolean + Private Function FilterOrder_Details(ByVal entity As Global.EFCoreModels.Northwind.Order_Detail) As Boolean Return Object.Equals(entity.OrderID, Me.OrderID) End Function @@ -1113,11 +1113,11 @@ Namespace DbContextModels.Northwind Private _discount As Single - Private _order As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Order) + Private _order As Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Order) Private _orderID As Integer - Private _product As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Product) + Private _product As Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Product) Private _productID As Integer @@ -1192,15 +1192,15 @@ Namespace DbContextModels.Northwind ''' Gets or sets the associated entity. '''
_ - Public Property Order() As Global.DbContextModels.Northwind.Order + Public Property Order() As Global.EFCoreModels.Northwind.Order Get If (Me._order Is Nothing) Then - Me._order = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Order)(Me, "Order", AddressOf Me.FilterOrder) + Me._order = New Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Order)(Me, "Order", AddressOf Me.FilterOrder) End If Return Me._order.Entity End Get Set - Dim previous As Global.DbContextModels.Northwind.Order = Me.Order + Dim previous As Global.EFCoreModels.Northwind.Order = Me.Order If (Object.Equals(previous, value) = false) Then Me.ValidateProperty("Order", value) If (Not (previous) Is Nothing) Then @@ -1249,15 +1249,15 @@ Namespace DbContextModels.Northwind ''' Gets or sets the associated entity. '''
_ - Public Property Product() As Global.DbContextModels.Northwind.Product + Public Property Product() As Global.EFCoreModels.Northwind.Product Get If (Me._product Is Nothing) Then - Me._product = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Product)(Me, "Product", AddressOf Me.FilterProduct) + Me._product = New Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Product)(Me, "Product", AddressOf Me.FilterProduct) End If Return Me._product.Entity End Get Set - Dim previous As Global.DbContextModels.Northwind.Product = Me.Product + Dim previous As Global.EFCoreModels.Northwind.Product = Me.Product If (Object.Equals(previous, value) = false) Then Me.ValidateProperty("Product", value) If (Not (previous) Is Nothing) Then @@ -1348,11 +1348,11 @@ Namespace DbContextModels.Northwind End Set End Property - Private Function FilterOrder(ByVal entity As Global.DbContextModels.Northwind.Order) As Boolean + Private Function FilterOrder(ByVal entity As Global.EFCoreModels.Northwind.Order) As Boolean Return Object.Equals(entity.OrderID, Me.OrderID) End Function - Private Function FilterProduct(ByVal entity As Global.DbContextModels.Northwind.Product) As Boolean + Private Function FilterProduct(ByVal entity As Global.EFCoreModels.Northwind.Product) As Boolean Return Object.Equals(entity.ProductID, Me.ProductID) End Function @@ -1372,7 +1372,7 @@ Namespace DbContextModels.Northwind Partial Public NotInheritable Class Product Inherits Global.OpenRiaServices.Client.Entity - Private _category As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Category) + Private _category As Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Category) Private _categoryID As Global.System.Nullable(Of Integer) @@ -1380,7 +1380,7 @@ Namespace DbContextModels.Northwind Private _discontinued As Boolean - Private _order_Details As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + Private _order_Details As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order_Detail) Private _productID As Integer @@ -1482,15 +1482,15 @@ Namespace DbContextModels.Northwind ''' Gets or sets the associated entity. '''
_ - Public Property Category() As Global.DbContextModels.Northwind.Category + Public Property Category() As Global.EFCoreModels.Northwind.Category Get If (Me._category Is Nothing) Then - Me._category = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Category)(Me, "Category", AddressOf Me.FilterCategory) + Me._category = New Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Category)(Me, "Category", AddressOf Me.FilterCategory) End If Return Me._category.Entity End Get Set - Dim previous As Global.DbContextModels.Northwind.Category = Me.Category + Dim previous As Global.EFCoreModels.Northwind.Category = Me.Category If (Object.Equals(previous, value) = false) Then Me.ValidateProperty("Category", value) If (Not (previous) Is Nothing) Then @@ -1581,10 +1581,10 @@ Namespace DbContextModels.Northwind ''' Gets the collection of associated entity instances. ''' _ - Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail) + Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order_Detail) Get If (Me._order_Details Is Nothing) Then - Me._order_Details = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) + Me._order_Details = New Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Order_Detail)(Me, "Order_Details", AddressOf Me.FilterOrder_Details, AddressOf Me.AttachOrder_Details, AddressOf Me.DetachOrder_Details) End If Return Me._order_Details End Get @@ -1830,19 +1830,19 @@ Namespace DbContextModels.Northwind End Get End Property - Private Function FilterCategory(ByVal entity As Global.DbContextModels.Northwind.Category) As Boolean + Private Function FilterCategory(ByVal entity As Global.EFCoreModels.Northwind.Category) As Boolean Return Object.Equals(entity.CategoryID, Me.CategoryID) End Function - Private Sub AttachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + Private Sub AttachOrder_Details(ByVal entity As Global.EFCoreModels.Northwind.Order_Detail) entity.Product = Me End Sub - Private Sub DetachOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) + Private Sub DetachOrder_Details(ByVal entity As Global.EFCoreModels.Northwind.Order_Detail) entity.Product = Nothing End Sub - Private Function FilterOrder_Details(ByVal entity As Global.DbContextModels.Northwind.Order_Detail) As Boolean + Private Function FilterOrder_Details(ByVal entity As Global.EFCoreModels.Northwind.Order_Detail) As Boolean Return Object.Equals(entity.ProductID, Me.ProductID) End Function @@ -2019,7 +2019,7 @@ Namespace DbContextModels.Northwind Private _regionID As Integer - Private _territories As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Territory) + Private _territories As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Territory) #Region "Extensibility Method Definitions" @@ -2099,24 +2099,24 @@ Namespace DbContextModels.Northwind ''' _ - Public ReadOnly Property Territories() As Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Territory) + Public ReadOnly Property Territories() As Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Territory) Get If (Me._territories Is Nothing) Then - Me._territories = New Global.OpenRiaServices.Client.EntityCollection(Of Global.DbContextModels.Northwind.Territory)(Me, "Territories", AddressOf Me.FilterTerritories, AddressOf Me.AttachTerritories, AddressOf Me.DetachTerritories) + Me._territories = New Global.OpenRiaServices.Client.EntityCollection(Of Global.EFCoreModels.Northwind.Territory)(Me, "Territories", AddressOf Me.FilterTerritories, AddressOf Me.AttachTerritories, AddressOf Me.DetachTerritories) End If Return Me._territories End Get End Property - Private Sub AttachTerritories(ByVal entity As Global.DbContextModels.Northwind.Territory) + Private Sub AttachTerritories(ByVal entity As Global.EFCoreModels.Northwind.Territory) entity.Region = Me End Sub - Private Sub DetachTerritories(ByVal entity As Global.DbContextModels.Northwind.Territory) + Private Sub DetachTerritories(ByVal entity As Global.EFCoreModels.Northwind.Territory) entity.Region = Nothing End Sub - Private Function FilterTerritories(ByVal entity As Global.DbContextModels.Northwind.Territory) As Boolean + Private Function FilterTerritories(ByVal entity As Global.EFCoreModels.Northwind.Territory) As Boolean Return Object.Equals(entity.RegionID, Me.RegionID) End Function @@ -2136,7 +2136,7 @@ Namespace DbContextModels.Northwind Partial Public NotInheritable Class Territory Inherits Global.OpenRiaServices.Client.Entity - Private _region As Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Region) + Private _region As Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Region) Private _regionID As Integer @@ -2180,15 +2180,15 @@ Namespace DbContextModels.Northwind ''' Gets or sets the associated entity. ''' _ - Public Property Region() As Global.DbContextModels.Northwind.Region + Public Property Region() As Global.EFCoreModels.Northwind.Region Get If (Me._region Is Nothing) Then - Me._region = New Global.OpenRiaServices.Client.EntityRef(Of Global.DbContextModels.Northwind.Region)(Me, "Region", AddressOf Me.FilterRegion) + Me._region = New Global.OpenRiaServices.Client.EntityRef(Of Global.EFCoreModels.Northwind.Region)(Me, "Region", AddressOf Me.FilterRegion) End If Return Me._region.Entity End Get Set - Dim previous As Global.DbContextModels.Northwind.Region = Me.Region + Dim previous As Global.EFCoreModels.Northwind.Region = Me.Region If (Object.Equals(previous, value) = false) Then Me.ValidateProperty("Region", value) If (Not (previous) Is Nothing) Then @@ -2277,7 +2277,7 @@ Namespace DbContextModels.Northwind End Set End Property - Private Function FilterRegion(ByVal entity As Global.DbContextModels.Northwind.Region) As Boolean + Private Function FilterRegion(ByVal entity As Global.EFCoreModels.Northwind.Region) As Boolean Return Object.Equals(entity.RegionID, Me.RegionID) End Function @@ -2291,7 +2291,7 @@ Namespace DbContextModels.Northwind End Class End Namespace -Namespace TestDomainServices.DbCtx +Namespace TestDomainServices.EFCore ''' ''' The DomainContext corresponding to the 'Northwind' DomainService. @@ -2315,7 +2315,7 @@ Namespace TestDomainServices.DbCtx ''' Initializes a new instance of the class. ''' Public Sub New() - Me.New(New Global.System.Uri("TestDomainServices-DbCtx-Northwind.svc", Global.System.UriKind.Relative)) + Me.New(New Global.System.Uri("TestDomainServices-EFCore-Northwind.svc", Global.System.UriKind.Relative)) End Sub ''' @@ -2323,7 +2323,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The Northwind service URI. Public Sub New(ByVal serviceUri As Global.System.Uri) - Me.New(Global.OpenRiaServices.Client.DomainContext.CreateDomainClient(GetType(Global.TestDomainServices.DbCtx.Northwind.INorthwindContract), serviceUri, false)) + Me.New(Global.OpenRiaServices.Client.DomainContext.CreateDomainClient(GetType(Global.TestDomainServices.EFCore.Northwind.INorthwindContract), serviceUri, false)) End Sub ''' @@ -2338,63 +2338,63 @@ Namespace TestDomainServices.DbCtx ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' - Public ReadOnly Property Categories() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Category) + Public ReadOnly Property Categories() As Global.OpenRiaServices.Client.EntitySet(Of Global.EFCoreModels.Northwind.Category) Get - Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Category) + Return MyBase.EntityContainer.GetEntitySet(Of Global.EFCoreModels.Northwind.Category) End Get End Property ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' - Public ReadOnly Property Customers() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Customer) + Public ReadOnly Property Customers() As Global.OpenRiaServices.Client.EntitySet(Of Global.EFCoreModels.Northwind.Customer) Get - Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Customer) + Return MyBase.EntityContainer.GetEntitySet(Of Global.EFCoreModels.Northwind.Customer) End Get End Property ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' - Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Order_Detail) + Public ReadOnly Property Order_Details() As Global.OpenRiaServices.Client.EntitySet(Of Global.EFCoreModels.Northwind.Order_Detail) Get - Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Order_Detail) + Return MyBase.EntityContainer.GetEntitySet(Of Global.EFCoreModels.Northwind.Order_Detail) End Get End Property ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' - Public ReadOnly Property Orders() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Order) + Public ReadOnly Property Orders() As Global.OpenRiaServices.Client.EntitySet(Of Global.EFCoreModels.Northwind.Order) Get - Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Order) + Return MyBase.EntityContainer.GetEntitySet(Of Global.EFCoreModels.Northwind.Order) End Get End Property ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' - Public ReadOnly Property Products() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Product) + Public ReadOnly Property Products() As Global.OpenRiaServices.Client.EntitySet(Of Global.EFCoreModels.Northwind.Product) Get - Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Product) + Return MyBase.EntityContainer.GetEntitySet(Of Global.EFCoreModels.Northwind.Product) End Get End Property ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' - Public ReadOnly Property ProductInfos() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.ProductInfo) + Public ReadOnly Property ProductInfos() As Global.OpenRiaServices.Client.EntitySet(Of Global.EFCoreModels.Northwind.ProductInfo) Get - Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.ProductInfo) + Return MyBase.EntityContainer.GetEntitySet(Of Global.EFCoreModels.Northwind.ProductInfo) End Get End Property ''' ''' Gets the set of entity instances that have been loaded into this instance. ''' - Public ReadOnly Property Regions() As Global.OpenRiaServices.Client.EntitySet(Of Global.DbContextModels.Northwind.Region) + Public ReadOnly Property Regions() As Global.OpenRiaServices.Client.EntitySet(Of Global.EFCoreModels.Northwind.Region) Get - Return MyBase.EntityContainer.GetEntitySet(Of Global.DbContextModels.Northwind.Region) + Return MyBase.EntityContainer.GetEntitySet(Of Global.EFCoreModels.Northwind.Region) End Get End Property @@ -2402,36 +2402,36 @@ Namespace TestDomainServices.DbCtx ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCategories' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetCategoriesQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Category) + Public Function GetCategoriesQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Category) Me.ValidateMethod("GetCategoriesQuery", Nothing) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Category)("GetCategories", Nothing, false, true) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Category)("GetCategories", Nothing, false, true) End Function ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetCustomers' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetCustomersQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Customer) + Public Function GetCustomersQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Customer) Me.ValidateMethod("GetCustomersQuery", Nothing) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Customer)("GetCustomers", Nothing, false, true) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Customer)("GetCustomers", Nothing, false, true) End Function ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrderDetails' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetOrderDetailsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Order_Detail) + Public Function GetOrderDetailsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Order_Detail) Me.ValidateMethod("GetOrderDetailsQuery", Nothing) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Order_Detail)("GetOrderDetails", Nothing, false, true) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Order_Detail)("GetOrderDetails", Nothing, false, true) End Function ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetOrders' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetOrdersQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Order) + Public Function GetOrdersQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Order) Me.ValidateMethod("GetOrdersQuery", Nothing) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Order)("GetOrders", Nothing, false, true) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Order)("GetOrders", Nothing, false, true) End Function ''' @@ -2439,29 +2439,29 @@ Namespace TestDomainServices.DbCtx ''' ''' The value for the 'id' parameter of the query. ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetProductByIdQuery(ByVal id As Integer) As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Product) + Public Function GetProductByIdQuery(ByVal id As Integer) As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Product) Dim parameters As Global.System.Collections.Generic.Dictionary(Of String, Object) = New Global.System.Collections.Generic.Dictionary(Of String, Object)() parameters.Add("id", id) Me.ValidateMethod("GetProductByIdQuery", parameters) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Product)("GetProductById", parameters, false, false) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Product)("GetProductById", parameters, false, false) End Function ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProductInfos' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetProductInfosQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.ProductInfo) + Public Function GetProductInfosQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.ProductInfo) Me.ValidateMethod("GetProductInfosQuery", Nothing) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.ProductInfo)("GetProductInfos", Nothing, false, true) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.ProductInfo)("GetProductInfos", Nothing, false, true) End Function ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetProducts' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetProductsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Product) + Public Function GetProductsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Product) Me.ValidateMethod("GetProductsQuery", Nothing) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Product)("GetProducts", Nothing, false, true) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Product)("GetProducts", Nothing, false, true) End Function ''' @@ -2469,27 +2469,27 @@ Namespace TestDomainServices.DbCtx ''' ''' The value for the 'id' parameter of the query. ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetRegionByIdQuery(ByVal id As Integer) As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Region) + Public Function GetRegionByIdQuery(ByVal id As Integer) As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Region) Dim parameters As Global.System.Collections.Generic.Dictionary(Of String, Object) = New Global.System.Collections.Generic.Dictionary(Of String, Object)() parameters.Add("id", id) Me.ValidateMethod("GetRegionByIdQuery", parameters) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Region)("GetRegionById", parameters, false, false) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Region)("GetRegionById", parameters, false, false) End Function ''' ''' Gets an EntityQuery instance that can be used to load entity instances using the 'GetRegions' query. ''' ''' An EntityQuery that can be loaded to retrieve entity instances. - Public Function GetRegionsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.DbContextModels.Northwind.Region) + Public Function GetRegionsQuery() As Global.OpenRiaServices.Client.EntityQuery(Of Global.EFCoreModels.Northwind.Region) Me.ValidateMethod("GetRegionsQuery", Nothing) - Return MyBase.CreateQuery(Of Global.DbContextModels.Northwind.Region)("GetRegions", Nothing, false, true) + Return MyBase.CreateQuery(Of Global.EFCoreModels.Northwind.Region)("GetRegions", Nothing, false, true) End Function ''' ''' Invokes the 'DiscontinueProduct' method of the specified entity. ''' ''' The entity instance. - Public Sub DiscontinueProduct(ByVal product As Global.DbContextModels.Northwind.Product) + Public Sub DiscontinueProduct(ByVal product As Global.EFCoreModels.Northwind.Product) product.DiscontinueProduct End Sub @@ -2498,7 +2498,7 @@ Namespace TestDomainServices.DbCtx ''' ''' A new container instance. Protected Overrides Function CreateEntityContainer() As Global.OpenRiaServices.Client.EntityContainer - Return New Global.TestDomainServices.DbCtx.Northwind.NorthwindEntityContainer() + Return New Global.TestDomainServices.EFCore.Northwind.NorthwindEntityContainer() End Function ''' @@ -2522,7 +2522,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetCategories'. ''' The 'QueryResult' returned from the 'GetCategories' operation. - Function EndGetCategories(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Category) + Function EndGetCategories(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Category) ''' ''' Asynchronously invokes the 'GetCustomers' operation. @@ -2539,7 +2539,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetCustomers'. ''' The 'QueryResult' returned from the 'GetCustomers' operation. - Function EndGetCustomers(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Customer) + Function EndGetCustomers(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Customer) ''' ''' Asynchronously invokes the 'GetOrderDetails' operation. @@ -2556,7 +2556,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetOrderDetails'. ''' The 'QueryResult' returned from the 'GetOrderDetails' operation. - Function EndGetOrderDetails(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Order_Detail) + Function EndGetOrderDetails(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Order_Detail) ''' ''' Asynchronously invokes the 'GetOrders' operation. @@ -2573,7 +2573,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetOrders'. ''' The 'QueryResult' returned from the 'GetOrders' operation. - Function EndGetOrders(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Order) + Function EndGetOrders(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Order) ''' ''' Asynchronously invokes the 'GetProductById' operation. @@ -2591,7 +2591,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetProductById'. ''' The 'QueryResult' returned from the 'GetProductById' operation. - Function EndGetProductById(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Product) + Function EndGetProductById(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Product) ''' ''' Asynchronously invokes the 'GetProductInfos' operation. @@ -2608,7 +2608,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetProductInfos'. ''' The 'QueryResult' returned from the 'GetProductInfos' operation. - Function EndGetProductInfos(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.ProductInfo) + Function EndGetProductInfos(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.ProductInfo) ''' ''' Asynchronously invokes the 'GetProducts' operation. @@ -2625,7 +2625,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetProducts'. ''' The 'QueryResult' returned from the 'GetProducts' operation. - Function EndGetProducts(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Product) + Function EndGetProducts(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Product) ''' ''' Asynchronously invokes the 'GetRegionById' operation. @@ -2643,7 +2643,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetRegionById'. ''' The 'QueryResult' returned from the 'GetRegionById' operation. - Function EndGetRegionById(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Region) + Function EndGetRegionById(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Region) ''' ''' Asynchronously invokes the 'GetRegions' operation. @@ -2660,7 +2660,7 @@ Namespace TestDomainServices.DbCtx ''' ''' The IAsyncResult returned from 'BeginGetRegions'. ''' The 'QueryResult' returned from the 'GetRegions' operation. - Function EndGetRegions(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.DbContextModels.Northwind.Region) + Function EndGetRegions(ByVal result As Global.System.IAsyncResult) As Global.OpenRiaServices.Client.QueryResult(Of Global.EFCoreModels.Northwind.Region) ''' ''' Asynchronously invokes the 'SubmitChanges' operation. @@ -2685,14 +2685,14 @@ Namespace TestDomainServices.DbCtx Public Sub New() MyBase.New - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Category)(Global.OpenRiaServices.Client.EntitySetOperations.All) - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Customer)(Global.OpenRiaServices.Client.EntitySetOperations.All) - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Order)(Global.OpenRiaServices.Client.EntitySetOperations.All) - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Order_Detail)(Global.OpenRiaServices.Client.EntitySetOperations.All) - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Product)(Global.OpenRiaServices.Client.EntitySetOperations.All) - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.ProductInfo)(Global.OpenRiaServices.Client.EntitySetOperations.Edit) - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Region)(Global.OpenRiaServices.Client.EntitySetOperations.All) - Me.CreateEntitySet(Of Global.DbContextModels.Northwind.Territory)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.Category)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.Customer)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.Order)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.Order_Detail)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.Product)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.ProductInfo)(Global.OpenRiaServices.Client.EntitySetOperations.Edit) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.Region)(Global.OpenRiaServices.Client.EntitySetOperations.All) + Me.CreateEntitySet(Of Global.EFCoreModels.Northwind.Territory)(Global.OpenRiaServices.Client.EntitySetOperations.All) End Sub End Class End Class From fd11c6347f3484ee921098219c55ca03af1848e8 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Tue, 26 Apr 2022 08:37:51 +0200 Subject: [PATCH 74/99] Fix test. --- .../Baselines/Default/EF/Catalog_EFCore.g.cs | 151 ++---------------- .../Baselines/Default/EF/Catalog_EFCore.g.vb | 134 ++-------------- 2 files changed, 24 insertions(+), 261 deletions(-) diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs index 557a6b84c..627ff4311 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.cs @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace DbContextModels.AdventureWorks +namespace EFCoreModels.AdventureWorks { using System; using System.Collections.Generic; @@ -53,10 +53,6 @@ public sealed partial class Employee : Entity private string _nationalIDNumber; - private EntityCollection _purchaseOrders; - - private EntityCollection _reports; - private Guid _rowguid; private bool _salariedFlag; @@ -296,7 +292,7 @@ public string LoginID /// /// Gets or sets the associated entity. /// - [Association("Employee_Employee", "ManagerID", "EmployeeID", IsForeignKey=true)] + [Association("FK_Employee_Employee_ManagerID", "ManagerID", "EmployeeID", IsForeignKey=true)] public Employee Manager { get @@ -313,11 +309,6 @@ public Employee Manager if ((previous != value)) { this.ValidateProperty("Manager", value); - if ((previous != null)) - { - this._manager.Entity = null; - previous.Reports.Remove(this); - } if ((value != null)) { this.ManagerID = value.EmployeeID; @@ -327,10 +318,6 @@ public Employee Manager this.ManagerID = default(Nullable); } this._manager.Entity = value; - if ((value != null)) - { - value.Reports.Add(this); - } this.RaisePropertyChanged("Manager"); } } @@ -437,38 +424,6 @@ public string NationalIDNumber } } - /// - /// Gets the collection of associated entity instances. - /// - [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID")] - public EntityCollection PurchaseOrders - { - get - { - if ((this._purchaseOrders == null)) - { - this._purchaseOrders = new EntityCollection(this, "PurchaseOrders", this.FilterPurchaseOrders, this.AttachPurchaseOrders, this.DetachPurchaseOrders); - } - return this._purchaseOrders; - } - } - - /// - /// Gets the collection of associated entity instances. - /// - [Association("Employee_Employee", "EmployeeID", "ManagerID")] - public EntityCollection Reports - { - get - { - if ((this._reports == null)) - { - this._reports = new EntityCollection(this, "Reports", this.FilterReports, this.AttachReports, this.DetachReports); - } - return this._reports; - } - } - /// /// Gets or sets the 'rowguid' value. /// @@ -596,36 +551,6 @@ private bool FilterManager(Employee entity) return (entity.EmployeeID == this.ManagerID); } - private void AttachPurchaseOrders(PurchaseOrder entity) - { - entity.Employee = this; - } - - private void DetachPurchaseOrders(PurchaseOrder entity) - { - entity.Employee = null; - } - - private bool FilterPurchaseOrders(PurchaseOrder entity) - { - return (entity.EmployeeID == this.EmployeeID); - } - - private void AttachReports(Employee entity) - { - entity.Manager = this; - } - - private void DetachReports(Employee entity) - { - entity.Manager = null; - } - - private bool FilterReports(Employee entity) - { - return (entity.ManagerID == this.EmployeeID); - } - /// /// Computes a value from the key fields that uniquely identifies this entity instance. /// @@ -1185,7 +1110,6 @@ public string ProductLine /// Gets or sets the 'ProductModelID' value. /// [DataMember()] - [RoundtripOriginal()] public Nullable ProductModelID { get @@ -1260,7 +1184,7 @@ public Nullable ProductSubcategoryID /// /// Gets the collection of associated entity instances. /// - [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID")] + [Association("FK_PurchaseOrderDetail_Product_ProductID", "ProductID", "ProductID")] public EntityCollection PurchaseOrderDetails { get @@ -1398,7 +1322,6 @@ public string Size /// Gets or sets the 'SizeUnitMeasureCode' value. /// [DataMember()] - [RoundtripOriginal()] [StringLength(3)] public string SizeUnitMeasureCode { @@ -1498,7 +1421,6 @@ public Nullable Weight /// Gets or sets the 'WeightUnitMeasureCode' value. /// [DataMember()] - [RoundtripOriginal()] [StringLength(3)] public string WeightUnitMeasureCode { @@ -1552,8 +1474,6 @@ public override object GetIdentity() public sealed partial class PurchaseOrder : Entity { - private EntityRef _employee; - private int _employeeID; private decimal _freight; @@ -1627,54 +1547,10 @@ public PurchaseOrder() this.OnCreated(); } - /// - /// Gets or sets the associated entity. - /// - [Association("Employee_PurchaseOrder", "EmployeeID", "EmployeeID", IsForeignKey=true)] - public Employee Employee - { - get - { - if ((this._employee == null)) - { - this._employee = new EntityRef(this, "Employee", this.FilterEmployee); - } - return this._employee.Entity; - } - set - { - Employee previous = this.Employee; - if ((previous != value)) - { - this.ValidateProperty("Employee", value); - if ((previous != null)) - { - this._employee.Entity = null; - previous.PurchaseOrders.Remove(this); - } - if ((value != null)) - { - this.EmployeeID = value.EmployeeID; - } - else - { - this.EmployeeID = default(int); - } - this._employee.Entity = value; - if ((value != null)) - { - value.PurchaseOrders.Add(this); - } - this.RaisePropertyChanged("Employee"); - } - } - } - /// /// Gets or sets the 'EmployeeID' value. /// [DataMember()] - [RoundtripOriginal()] public int EmployeeID { get @@ -1770,7 +1646,7 @@ public DateTime OrderDate /// /// Gets the collection of associated entity instances. /// - [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID")] + [Association("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderID", "PurchaseOrderID")] public EntityCollection PurchaseOrderDetails { get @@ -1861,7 +1737,6 @@ public Nullable ShipDate /// Gets or sets the 'ShipMethodID' value. /// [DataMember()] - [RoundtripOriginal()] public int ShipMethodID { get @@ -1982,7 +1857,6 @@ public decimal TotalDue /// Gets or sets the 'VendorID' value. /// [DataMember()] - [RoundtripOriginal()] public int VendorID { get @@ -2003,11 +1877,6 @@ public int VendorID } } - private bool FilterEmployee(Employee entity) - { - return (entity.EmployeeID == this.EmployeeID); - } - private void AttachPurchaseOrderDetails(PurchaseOrderDetail entity) { entity.PurchaseOrder = this; @@ -2206,7 +2075,7 @@ public short OrderQty /// /// Gets or sets the associated entity. /// - [Association("Product_PurchaseOrderDetail", "ProductID", "ProductID", IsForeignKey=true)] + [Association("FK_PurchaseOrderDetail_Product_ProductID", "ProductID", "ProductID", IsForeignKey=true)] public Product Product { get @@ -2274,7 +2143,7 @@ public int ProductID /// /// Gets or sets the associated entity. /// - [Association("PurchaseOrder_PurchaseOrderDetail", "PurchaseOrderID", "PurchaseOrderID", IsForeignKey=true)] + [Association("FK_PurchaseOrderDetail_PurchaseOrderHeader_PurchaseOrderID", "PurchaseOrderID", "PurchaseOrderID", IsForeignKey=true)] public PurchaseOrder PurchaseOrder { get @@ -2482,7 +2351,7 @@ public override object GetIdentity() } } } -namespace TestDomainServices.DbCtx +namespace TestDomainServices.EFCore { using System; using System.Collections.Generic; @@ -2491,7 +2360,7 @@ namespace TestDomainServices.DbCtx using System.Linq; using System.ServiceModel; using System.Threading.Tasks; - using DbContextModels.AdventureWorks; + using EFCoreModels.AdventureWorks; using OpenRiaServices; using OpenRiaServices.Client; using OpenRiaServices.Client.Authentication; @@ -2518,7 +2387,7 @@ public sealed partial class Catalog : DomainContext /// Initializes a new instance of the class. /// public Catalog() : - this(new Uri("TestDomainServices-DbCtx-Catalog.svc", UriKind.Relative)) + this(new Uri("TestDomainServices-EFCore-Catalog.svc", UriKind.Relative)) { } diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb index 732334525..ca5a9c6e6 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/EF/Catalog_EFCore.g.vb @@ -1,7 +1,7 @@ '------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.34209 +' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. @@ -13,7 +13,7 @@ Option Infer On Option Strict On Option Explicit On -Imports DbContextModels.AdventureWorks +Imports EFCoreModels.AdventureWorks Imports OpenRiaServices Imports OpenRiaServices.Client Imports OpenRiaServices.Client.Authentication @@ -26,7 +26,7 @@ Imports System.Runtime.Serialization Imports System.ServiceModel Imports System.Threading.Tasks -Namespace DbContextModels.AdventureWorks +Namespace EFCoreModels.AdventureWorks ''' ''' The 'Employee' entity class. @@ -59,10 +59,6 @@ Namespace DbContextModels.AdventureWorks Private _nationalIDNumber As String - Private _purchaseOrders As EntityCollection(Of PurchaseOrder) - - Private _reports As EntityCollection(Of Employee) - Private _rowguid As Guid Private _salariedFlag As Boolean @@ -312,7 +308,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property Manager() As Employee Get If (Me._manager Is Nothing) Then @@ -324,19 +320,12 @@ Namespace DbContextModels.AdventureWorks Dim previous As Employee = Me.Manager If (Object.Equals(previous, value) = false) Then Me.ValidateProperty("Manager", value) - If (Not (previous) Is Nothing) Then - Me._manager.Entity = Nothing - previous.Reports.Remove(Me) - End If If (Not (value) Is Nothing) Then Me.ManagerID = value.EmployeeID Else Me.ManagerID = CType(Nothing, Nullable(Of Integer)) End If Me._manager.Entity = value - If (Not (value) Is Nothing) Then - value.Reports.Add(Me) - End If Me.RaisePropertyChanged("Manager") End If End Set @@ -428,32 +417,6 @@ Namespace DbContextModels.AdventureWorks End Set End Property - ''' - ''' Gets the collection of associated entity instances. - ''' - _ - Public ReadOnly Property PurchaseOrders() As EntityCollection(Of PurchaseOrder) - Get - If (Me._purchaseOrders Is Nothing) Then - Me._purchaseOrders = New EntityCollection(Of PurchaseOrder)(Me, "PurchaseOrders", AddressOf Me.FilterPurchaseOrders, AddressOf Me.AttachPurchaseOrders, AddressOf Me.DetachPurchaseOrders) - End If - Return Me._purchaseOrders - End Get - End Property - - ''' - ''' Gets the collection of associated entity instances. - ''' - _ - Public ReadOnly Property Reports() As EntityCollection(Of Employee) - Get - If (Me._reports Is Nothing) Then - Me._reports = New EntityCollection(Of Employee)(Me, "Reports", AddressOf Me.FilterReports, AddressOf Me.AttachReports, AddressOf Me.DetachReports) - End If - Return Me._reports - End Get - End Property - ''' ''' Gets or sets the 'rowguid' value. ''' @@ -564,30 +527,6 @@ Namespace DbContextModels.AdventureWorks Return Object.Equals(entity.EmployeeID, Me.ManagerID) End Function - Private Sub AttachPurchaseOrders(ByVal entity As PurchaseOrder) - entity.Employee = Me - End Sub - - Private Sub DetachPurchaseOrders(ByVal entity As PurchaseOrder) - entity.Employee = Nothing - End Sub - - Private Function FilterPurchaseOrders(ByVal entity As PurchaseOrder) As Boolean - Return Object.Equals(entity.EmployeeID, Me.EmployeeID) - End Function - - Private Sub AttachReports(ByVal entity As Employee) - entity.Manager = Me - End Sub - - Private Sub DetachReports(ByVal entity As Employee) - entity.Manager = Nothing - End Sub - - Private Function FilterReports(ByVal entity As Employee) As Boolean - Return Object.Equals(entity.ManagerID, Me.EmployeeID) - End Function - ''' ''' Computes a value from the key fields that uniquely identifies this entity instance. ''' @@ -1150,8 +1089,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets or sets the 'ProductModelID' value. ''' - _ + _ Public Property ProductModelID() As Nullable(Of Integer) Get Return Me._productModelID @@ -1214,7 +1152,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets the collection of associated entity instances. ''' - _ + _ Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail) Get If (Me._purchaseOrderDetails Is Nothing) Then @@ -1332,7 +1270,6 @@ Namespace DbContextModels.AdventureWorks ''' Gets or sets the 'SizeUnitMeasureCode' value. ''' _ Public Property SizeUnitMeasureCode() As String Get @@ -1417,7 +1354,6 @@ Namespace DbContextModels.AdventureWorks ''' Gets or sets the 'WeightUnitMeasureCode' value. ''' _ Public Property WeightUnitMeasureCode() As String Get @@ -1463,8 +1399,6 @@ Namespace DbContextModels.AdventureWorks Partial Public NotInheritable Class PurchaseOrder Inherits Entity - Private _employee As EntityRef(Of Employee) - Private _employeeID As Integer Private _freight As Decimal @@ -1565,44 +1499,10 @@ Namespace DbContextModels.AdventureWorks Me.OnCreated End Sub - ''' - ''' Gets or sets the associated entity. - ''' - _ - Public Property Employee() As Employee - Get - If (Me._employee Is Nothing) Then - Me._employee = New EntityRef(Of Employee)(Me, "Employee", AddressOf Me.FilterEmployee) - End If - Return Me._employee.Entity - End Get - Set - Dim previous As Employee = Me.Employee - If (Object.Equals(previous, value) = false) Then - Me.ValidateProperty("Employee", value) - If (Not (previous) Is Nothing) Then - Me._employee.Entity = Nothing - previous.PurchaseOrders.Remove(Me) - End If - If (Not (value) Is Nothing) Then - Me.EmployeeID = value.EmployeeID - Else - Me.EmployeeID = CType(Nothing, Integer) - End If - Me._employee.Entity = value - If (Not (value) Is Nothing) Then - value.PurchaseOrders.Add(Me) - End If - Me.RaisePropertyChanged("Employee") - End If - End Set - End Property - ''' ''' Gets or sets the 'EmployeeID' value. ''' - _ + _ Public Property EmployeeID() As Integer Get Return Me._employeeID @@ -1686,7 +1586,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets the collection of associated entity instances. ''' - _ + _ Public ReadOnly Property PurchaseOrderDetails() As EntityCollection(Of PurchaseOrderDetail) Get If (Me._purchaseOrderDetails Is Nothing) Then @@ -1763,8 +1663,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets or sets the 'ShipMethodID' value. ''' - _ + _ Public Property ShipMethodID() As Integer Get Return Me._shipMethodID @@ -1869,8 +1768,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets or sets the 'VendorID' value. ''' - _ + _ Public Property VendorID() As Integer Get Return Me._vendorID @@ -1888,10 +1786,6 @@ Namespace DbContextModels.AdventureWorks End Set End Property - Private Function FilterEmployee(ByVal entity As Employee) As Boolean - Return Object.Equals(entity.EmployeeID, Me.EmployeeID) - End Function - Private Sub AttachPurchaseOrderDetails(ByVal entity As PurchaseOrderDetail) entity.PurchaseOrder = Me End Sub @@ -2097,7 +1991,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property Product() As Product Get If (Me._product Is Nothing) Then @@ -2152,7 +2046,7 @@ Namespace DbContextModels.AdventureWorks ''' ''' Gets or sets the associated entity. ''' - _ + _ Public Property PurchaseOrder() As PurchaseOrder Get If (Me._purchaseOrder Is Nothing) Then @@ -2330,7 +2224,7 @@ Namespace DbContextModels.AdventureWorks End Class End Namespace -Namespace TestDomainServices.DbCtx +Namespace TestDomainServices.EFCore ''' ''' The DomainContext corresponding to the 'Catalog' DomainService. @@ -2354,7 +2248,7 @@ Namespace TestDomainServices.DbCtx ''' Initializes a new instance of the class. ''' Public Sub New() - Me.New(New Uri("TestDomainServices-DbCtx-Catalog.svc", UriKind.Relative)) + Me.New(New Uri("TestDomainServices-EFCore-Catalog.svc", UriKind.Relative)) End Sub ''' From bc19afed6111342798dfa5cc59ba4b8aa1e47e05 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 27 Apr 2022 10:08:12 +0200 Subject: [PATCH 75/99] Remove TODO --- src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs index bb649329b..40a936475 100644 --- a/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs +++ b/src/OpenRiaServices.Client/Test/Client.Test/Data/UpdateTests.cs @@ -16,7 +16,6 @@ namespace OpenRiaServices.Client.Test using Resource = SSmDsClient::OpenRiaServices.Client.Resource; /// - /// TODO: Make it work with EF Core. Maybe copy whole file and work with DBContext for EFCore /// End to end update scenario tests. These tests do a one time TestClass level test database /// initialization, creating the isolation database that will be used for all the tests. After /// all tests have run, and assembly level clean-up method disposes the test database. From 8baecfba117de104ef6bbf04168e407067aa090f Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 27 Apr 2022 10:08:40 +0200 Subject: [PATCH 76/99] Fix tests --- .../Scenarios/EFCoreContextScenarios.g.cs | 3 + .../Scenarios/EFCoreContextScenarios.g.vb | 3 + .../LinqToEntitiesEFCoreDbContext.cs | 114 ------------------ 3 files changed, 6 insertions(+), 114 deletions(-) delete mode 100644 src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs index 63552bbbd..1696448d3 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.cs @@ -339,6 +339,7 @@ public string City /// [ConcurrencyCheck()] [DataMember()] + [Required()] [RoundtripOriginal()] [StringLength(40)] public string CompanyName @@ -2218,6 +2219,7 @@ public Region() /// Gets or sets the 'RegionDescription' value. /// [DataMember()] + [Required()] [StringLength(50)] public string RegionDescription { @@ -2419,6 +2421,7 @@ public int RegionID /// Gets or sets the 'TerritoryDescription' value. /// [DataMember()] + [Required()] [StringLength(50)] public string TerritoryDescription { diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb index 18f4a8356..5251ad2cb 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Baselines/Default/Scenarios/EFCoreContextScenarios.g.vb @@ -347,6 +347,7 @@ Namespace EFCoreModels.Northwind ''' _ Public Property CompanyName() As String @@ -2064,6 +2065,7 @@ Namespace EFCoreModels.Northwind ''' Gets or sets the 'RegionDescription' value. ''' _ Public Property RegionDescription() As String Get @@ -2245,6 +2247,7 @@ Namespace EFCoreModels.Northwind ''' Gets or sets the 'TerritoryDescription' value. ''' _ Public Property TerritoryDescription() As String Get diff --git a/src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs b/src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs deleted file mode 100644 index 0a9b6a22b..000000000 --- a/src/VisualStudio/Tools/Framework/DomainServiceWizard/LinqToEntitiesEFCoreDbContext.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.CodeDom; -using System.Collections.Generic; -using System.Globalization; -using System.Reflection; -using OpenRiaServices.Tools; - -namespace OpenRiaServices.VisualStudio.DomainServices.Tools -{ - /// - /// Handles the LinqToEntities type of domain services based on EF Core DbContext - /// - public class LinqToEntitiesEFCoreDbContext : BusinessLogicContext - { - private bool? _isCodeFirstModel = null; - private readonly HashSet _visitedComplexTypes = new HashSet(); - - /// - /// Creates a new instance - /// - /// The CLR type of the - public LinqToEntitiesEFCoreDbContext(Type contextType) - : base(contextType, contextType.Name) - { - - } - - /// - /// Gets the name of the DAL technology of this context - /// - public override string DataAccessLayerName - { - get - { - return "EF Core"; - } - } - - - /// - /// Invoked to create the entities known to this context - /// - /// The list of entities - protected override IEnumerable CreateEntities() - { - List entities = new List(); - - return entities; - } - - - /// - /// Determines whether a property of the given type should be generated - /// in the associated metadata class. - /// - /// - /// This logic is meant to strip out DAL-level properties that will not appear - /// on the client. - /// - /// The type to test - /// true if it is legal to generate this property type in the business logic class. - protected override bool CanGeneratePropertyOfType(Type type) - { - if (base.CanGeneratePropertyOfType(type)) - { - return true; - } - return false; - } - - - /// - /// Generates the business logic class type. We override this to control the base class and imports - /// - /// The context to use to generate code. - /// The namespace into which to generate code. - /// The name to use for the class. - /// The new type - protected override CodeTypeDeclaration CreateBusinessLogicClass(CodeGenContext codeGenContext, CodeNamespace codeNamespace, string className) - { - // Add an import for our domain service - foreach (string import in BusinessLogicClassConstants.LinqToEntitiesDbImports) - { - codeNamespace.Imports.Add(new CodeNamespaceImport(import)); - } - - // Add an import for the namespace of the DomainContext - if (this.ContextType.Namespace != codeNamespace.Name) - { - codeNamespace.Imports.Add(new CodeNamespaceImport(BusinessLogicClassConstants.DbContextNamespace)); - codeNamespace.Imports.Add(new CodeNamespaceImport(this.ContextType.Namespace)); - } - - // Add to the set of known references - // codeGenContext.AddReference(typeof(EntityState).Assembly.FullName); - - // We used to add OpenRiaServices.EntityFramework, but due to - // vstfdevdiv/DevDiv2 Bug 442272 - Domain Service Wizard failing when an EF DbContext is selected, - // we need to avoid doing that. - - if (DbContextUtilities.DbContextTypeReference != null) - { - codeGenContext.AddReference(DbContextUtilities.DbContextTypeReference.Assembly.FullName); - } - - CodeTypeDeclaration businessLogicClass = CodeGenUtilities.CreateTypeDeclaration(className, codeNamespace.Name); - CodeTypeReference baseClass = new CodeTypeReference(BusinessLogicClassConstants.DbDomainServiceTypeName, new CodeTypeReference(this.ContextType.Name)); - businessLogicClass.BaseTypes.Add(baseClass); - return businessLogicClass; - } - - - } -} From e284beb2896aeb258fd2a7e5f915aaaa86b22608 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 27 Apr 2022 10:13:20 +0200 Subject: [PATCH 77/99] Fix todo --- .../Framework/DbDomainService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs index 8e547731d..309409a0f 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs @@ -287,7 +287,7 @@ private async Task SetChangeSetConflictsAsync(Dictionary Date: Wed, 27 Apr 2022 10:32:16 +0200 Subject: [PATCH 78/99] Comment out --- .../BusinessLogicClassContextTests.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs b/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs index a9636da26..66ca1d74c 100644 --- a/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs +++ b/src/VisualStudio/Tools/Test/DomainServiceWizard/BusinessLogicClassContextTests.cs @@ -117,17 +117,17 @@ public void BusinessLogicClass_Context_EFDbContextTest() Assert.IsTrue(dbContext.NeedToGenerateMetadataClasses); } - [TestMethod] - [Description("Tests if LinqToEntitiesDbContext works properly for EFCore entities")] - public void BusinessLogicClass_Context_EFCoreDbContextTest() - { - // TODO: This won't work since LinqToEntitiesDbContext uses EF6 metadata model - // Something similar to LinqToEntitiesDbContext but using EF Core's IModel must be built - //LinqToEntitiesDbContext dbContext = new LinqToEntitiesDbContext(typeof(EFCoreModels.Northwind.EFCoreDbCtxNorthwindEntities)); - //Assert.AreEqual(11, dbContext.Entities.Count()); - //Assert.IsTrue(dbContext.NeedToGenerateMetadataClasses); - throw new NotImplementedException(); - } + //[TestMethod] + //[Description("Tests if LinqToEntitiesDbContext works properly for EFCore entities")] + //public void BusinessLogicClass_Context_EFCoreDbContextTest() + //{ + // // TODO: This won't work since LinqToEntitiesDbContext uses EF6 metadata model + // // Something similar to LinqToEntitiesDbContext but using EF Core's IModel must be built + // //LinqToEntitiesDbContext dbContext = new LinqToEntitiesDbContext(typeof(EFCoreModels.Northwind.EFCoreDbCtxNorthwindEntities)); + // //Assert.AreEqual(11, dbContext.Entities.Count()); + // //Assert.IsTrue(dbContext.NeedToGenerateMetadataClasses); + // throw new NotImplementedException(); + //} [TestMethod] [Description("Tests if LinqToEntitiesDbContext works properly for EF CodeFirst entities")] From fca95b05ad9f4e63a28936abdfad2b927a08cb8a Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 27 Apr 2022 16:04:57 +0200 Subject: [PATCH 79/99] Use git diff. --- src/OpenRiaServices.Tools/Test/TestHelper.cs | 4 ++-- src/VisualStudio/Tools/Test/TestUtilities/TestHelper.cs | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/OpenRiaServices.Tools/Test/TestHelper.cs b/src/OpenRiaServices.Tools/Test/TestHelper.cs index 0006a2ea8..b6f174792 100644 --- a/src/OpenRiaServices.Tools/Test/TestHelper.cs +++ b/src/OpenRiaServices.Tools/Test/TestHelper.cs @@ -95,7 +95,7 @@ public static bool FilesMatch(string relativeTestDir, string relativeDeployDir, // Generate CMD strings to diff and to copy string tfDiffCommand = "tf diff \"" + referenceFileName + "\" \"" + generatedFileName + "\"\r\n"; - string codeDiffCommand = "code --diff \"" + referenceFileName + "\" \"" + generatedFileName + "\"\r\n"; + string codeDiffCommand = "git diff \"" + referenceFileName + "\" \"" + generatedFileName + "\"\r\n"; string tfEditCommand = "tf edit \"" + realFileInProject + "\"\r\n"; string copyCommand = "copy \"" + generatedFileName + "\" \"" + realFileInProject + "\""; @@ -115,7 +115,7 @@ public static bool FilesMatch(string relativeTestDir, string relativeDeployDir, " Newly generated file: " + generatedFileName + "\r\n" + "\r\n ------------------- To diff these files, execute this ------------------\r\n\r\n " + tfDiffCommand + - "\r\n or using vscode \r\n\r\n " + + "\r\n or using git diff \r\n\r\n " + codeDiffCommand + "\r\n ---------------- To make this the new reference file, execute this ------------------\r\n\r\n " + tfEditCommand + " " + diff --git a/src/VisualStudio/Tools/Test/TestUtilities/TestHelper.cs b/src/VisualStudio/Tools/Test/TestUtilities/TestHelper.cs index 347a404bd..e8abf6011 100644 --- a/src/VisualStudio/Tools/Test/TestUtilities/TestHelper.cs +++ b/src/VisualStudio/Tools/Test/TestUtilities/TestHelper.cs @@ -57,6 +57,7 @@ public static void ValidateFilesEqual(string generatedFileName, string reference // Generate CMD strings to diff and to copy string tfDiffCommand = "tf diff \"" + referenceFileName + "\" \"" + generatedFileName + "\"\r\n"; + string codeDiffCommand = "git diff \"" + referenceFileName + "\" \"" + generatedFileName + "\"\r\n"; string tfEditCommand = "tf edit \"" + referenceFileName + "\"\r\n"; string copyCommand = "copy \"" + generatedFileName + "\" \"" + referenceFileName + "\""; Assert.Fail( @@ -65,6 +66,8 @@ public static void ValidateFilesEqual(string generatedFileName, string reference " Newly generated file: " + generatedFileName + "\r\n" + "\r\n------------------- To diff these files, execute this ------------------\r\n\r\n " + tfDiffCommand + + "\r\n or using git diff \r\n\r\n " + + codeDiffCommand + "\r\n---------------- To make this the new reference file, execute this ------------------\r\n\r\n " + tfEditCommand + " " + copyCommand + "\r\n\r\n-------------------------" From 22992e7a66fe67c72a71ece54e4f3bdf93fb9d50 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Wed, 27 Apr 2022 16:25:49 +0200 Subject: [PATCH 80/99] Fix merge --- .../OpenRiaServices.Common.DomainServices.Test.csproj | 1 + src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index 7774d2582..71a77456d 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -612,6 +612,7 @@
+ diff --git a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj index 42ea37eff..3f5b53f2b 100644 --- a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj +++ b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj @@ -145,6 +145,7 @@ 3.1.20 + 6.0.0 From 005d5b02ab90cb5d5d5429cb9275101e0cf70216 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 29 Apr 2022 08:17:28 +0200 Subject: [PATCH 81/99] Add end project tag --- src/RiaServices.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RiaServices.sln b/src/RiaServices.sln index 3d39892e2..eb5a34cf4 100644 --- a/src/RiaServices.sln +++ b/src/RiaServices.sln @@ -145,6 +145,7 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Server.EntityFrameworkCore", "OpenRiaServices.Server.EntityFrameworkCore\Framework\OpenRiaServices.Server.EntityFrameworkCore.csproj", "{B8D39090-3B76-41BB-A139-956E42619E91}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EFCoreModels", "OpenRiaServices.Server.EntityFrameworkCore\Test\DbContextModel\EFCoreModels.csproj", "{6F468ADB-5799-4C24-93C5-765120AAAA4E}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenRiaServices.Hosting.AspNetCore", "OpenRiaServices.Hosting.AspNetCore\Framework\OpenRiaServices.Hosting.AspNetCore.csproj", "{5A3B6E67-822E-44EA-8B68-A043555CC86F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCoreWebsite", "Test\AspNetCoreWebsite\AspNetCoreWebsite.csproj", "{7F378F98-E1B2-411A-809E-B1894E768936}" From 91e2f11ec99da60233a320bdd7c4a761fa394424 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 29 Apr 2022 08:19:03 +0200 Subject: [PATCH 82/99] Move EFCore model to Test folder --- src/RiaServices.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/src/RiaServices.sln b/src/RiaServices.sln index eb5a34cf4..b3a6df133 100644 --- a/src/RiaServices.sln +++ b/src/RiaServices.sln @@ -430,6 +430,7 @@ Global {7026BE35-4A31-4C10-B9C8-98BA36D333C5} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} {92A7B751-DF5E-40AA-8846-C9ABAD8DA6AA} = {5612B0C3-4314-4795-ACA9-DDC5F25AE04D} {B8D39090-3B76-41BB-A139-956E42619E91} = {2095B11C-903C-47FF-B812-82DFA7A068AC} + {6F468ADB-5799-4C24-93C5-765120AAAA4E} = {E8CAC11B-50B6-4243-A12A-D831EBB064CB} {5A3B6E67-822E-44EA-8B68-A043555CC86F} = {2095B11C-903C-47FF-B812-82DFA7A068AC} {7F378F98-E1B2-411A-809E-B1894E768936} = {BB0E26DD-14D3-4CD5-8F2B-B5C1CA281719} EndGlobalSection From 324e60e1ea550e42ac41fcd2b2bd2ea7489a7613 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 29 Apr 2022 08:38:39 +0200 Subject: [PATCH 83/99] Fix merge error in web.config --- src/Test/WebsiteFullTrust/Web.config | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Test/WebsiteFullTrust/Web.config b/src/Test/WebsiteFullTrust/Web.config index 9e5ea73c5..c6a71d0d7 100644 --- a/src/Test/WebsiteFullTrust/Web.config +++ b/src/Test/WebsiteFullTrust/Web.config @@ -74,10 +74,6 @@ - - - - @@ -113,6 +109,8 @@ + + From de73c04859d09880791d21c6b92e09ba1667789e Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 29 Apr 2022 08:57:19 +0200 Subject: [PATCH 84/99] Revert to internal --- .../Framework/Resource.Designer.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs b/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs index 0fcd31f76..59c36df61 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/Resource.Designer.cs @@ -19,10 +19,10 @@ namespace OpenRiaServices.EntityFramework { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public class Resource { + internal class Resource { private static global::System.Resources.ResourceManager resourceMan; @@ -36,7 +36,7 @@ internal Resource() { /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { + internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenRiaServices.EntityFramework.Resource", typeof(Resource).Assembly); @@ -51,7 +51,7 @@ internal Resource() { /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { + internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } @@ -63,7 +63,7 @@ internal Resource() { /// /// Looks up a localized string similar to DatabaseGeneratedOption value '{0}' is not defined.. /// - public static string DatabaseGeneratedOptionNotDefined { + internal static string DatabaseGeneratedOptionNotDefined { get { return ResourceManager.GetString("DatabaseGeneratedOptionNotDefined", resourceCulture); } @@ -72,7 +72,7 @@ public static string DatabaseGeneratedOptionNotDefined { /// /// Looks up a localized string similar to Type '{0}' is not a valid LinqToEntitiesDomainServiceDescriptionProviderAttribute parameter because it does not derive from ObjectContext.. /// - public static string InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification { + internal static string InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification { get { return ResourceManager.GetString("InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecification", resourceCulture); } @@ -81,7 +81,7 @@ public static string InvalidLinqToEntitiesDomainServiceDescriptionProviderSpecif /// /// Looks up a localized string similar to '{0}' cannot be applied to DomainService Type '{1}' because '{1}' does not derive from '{2}'.. /// - public static string InvalidMetadataProviderSpecification { + internal static string InvalidMetadataProviderSpecification { get { return ResourceManager.GetString("InvalidMetadataProviderSpecification", resourceCulture); } @@ -90,7 +90,7 @@ public static string InvalidMetadataProviderSpecification { /// /// Looks up a localized string similar to Unable to retrieve association information for association '{0}'. Only models that include foreign key information are supported. See Entity Framework documentation for details on creating models that include foreign key information.. /// - public static string LinqToEntitiesProvider_UnableToRetrieveAssociationInfo { + internal static string LinqToEntitiesProvider_UnableToRetrieveAssociationInfo { get { return ResourceManager.GetString("LinqToEntitiesProvider_UnableToRetrieveAssociationInfo", resourceCulture); } From a928fb5f9f4ab96f9ab0e181174a312e0664d970 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 29 Apr 2022 13:02:30 +0200 Subject: [PATCH 85/99] Remove todo --- src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs index 2eae7d46b..924533b71 100644 --- a/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs +++ b/src/OpenRiaServices.Tools/Test/CodeGenDomainServices.cs @@ -560,10 +560,6 @@ public void TestNorthwindEFCoreClientProxies() [Description("Create client proxies for Linq to Entities domain service and compare to known good copy")] public void TestCatalogEFClientProxies() { - // TODO: Test codegeneration (kodgenereringstester) (kopera denna mapp med filer ?) - // Om samma databasmodell => kopiera genererade file (.g.cs) och skriv tester - // Validera både för vb och c# - // Default TestHelper.ValidateCodeGen(new TestHelper.CodeGenValidationOptions(@"Default\EF", "CG_CATEF", "Catalog_EF.g", typeof(TestDomainServices.EF.Catalog), Array.Empty(), false)); } From 98252a075c69dbbd4c65196a9e2770d946867a3d Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 29 Apr 2022 15:02:36 +0200 Subject: [PATCH 86/99] Fx merge --- .../Framework/OpenRiaServices.EntityFramework.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj index 784dac42d..8d18b7f28 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj +++ b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj @@ -1,7 +1,7 @@  net472;net6.0 - $(DefineConstants);SERVERFX;DBCONTEXT; + $(DefineConstants);SERVERFX;DBCONTEXT;net472; From 664413d1c4df0f476fe34fadf45a7dc89d423fb7 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 2 May 2022 13:03:14 +0200 Subject: [PATCH 87/99] Fix binding redirects. --- src/Test/WebsiteFullTrust/Web.config | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Test/WebsiteFullTrust/Web.config b/src/Test/WebsiteFullTrust/Web.config index c6a71d0d7..dba1d932d 100644 --- a/src/Test/WebsiteFullTrust/Web.config +++ b/src/Test/WebsiteFullTrust/Web.config @@ -50,7 +50,7 @@ - + @@ -71,8 +71,8 @@ - - + + @@ -96,11 +96,11 @@ - + - + @@ -109,11 +109,12 @@ - - - + + + + From adbf5723211e8b662c4fde3f03f355658abf412a Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 4 May 2022 15:18:17 +0200 Subject: [PATCH 88/99] - Always refer to latest EF core - make efcore library netstandard --- ...Services.Server.EntityFrameworkCore.csproj | 5 +-- .../Test/DbContextModel/EFCoreModels.csproj | 11 +++-- .../Northwind/NorthwindPartialClasses.cs | 41 ------------------- .../Test/DbContextModel/Northwind/Order.cs | 3 ++ .../DbContextModel/Northwind/Order_Detail.cs | 3 ++ .../Test/DbContextModel/Northwind/Product.cs | 3 ++ .../Test/DbContextModel/Northwind/Region.cs | 4 ++ .../Test/TestWap/TestWap.csproj | 2 +- 8 files changed, 21 insertions(+), 51 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 5215084e6..4dbccbfbf 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -4,11 +4,10 @@ $(DefineConstants);SERVERFX;EFCORE True true - ..\..\..\NuGet\bin\ - - + + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj index fefa131ec..7df4a995e 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj @@ -1,15 +1,14 @@  618 - - net472 + netstandard2.0 1.0.0.0 - - - - + + + + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs index 266ca91ca..d4cee6c6f 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/NorthwindPartialClasses.cs @@ -9,19 +9,6 @@ namespace EFCoreModels.Northwind { - // TODO: Remove MetaDataType attributes and move attributes directly to classe so project can be netstandard2 - [MetadataType(typeof(RegionMetadata))] - public partial class Region - { - } - - public static class RegionMetadata - { - [Composition] - [Include] - public static object Territories; - } - /// /// Non DAL projection type used to verify that such types can be returned /// from the provider @@ -66,7 +53,6 @@ public string SupplierName } } - [MetadataType(typeof(OrderMetadata))] public partial class Order { // Calculated property. Used to test that user-defined properties work properly. @@ -80,24 +66,6 @@ public string FormattedName } } - [MetadataType(typeof(OrderDetailMetadata))] - public partial class Order_Detail - { - } - - public static class OrderMetadata - { - [Include] - public static object Order_Details; - } - - public static class OrderDetailMetadata - { - [Include] - public static object Product; - } - - [MetadataType(typeof(ProductMetadata))] public partial class Product { private string _resolveMethod = String.Empty; @@ -116,13 +84,4 @@ public string ResolveMethod } } } - - public static class ProductMetadata - { - [Include("CategoryName", "CategoryName")] - public static object Category; - - [Include("CompanyName", "SupplierName")] - public static object Supplier; - } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs index de2a2277e..c61c6c502 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using OpenRiaServices.Server; // Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. // If you have enabled NRTs for your project, then un-comment the following line: @@ -32,6 +33,8 @@ public Order() public virtual Customer Customer { get; set; } public virtual Employees Employee { get; set; } public virtual Shipper Shipper { get; set; } + + [Include] public virtual ICollection Order_Details { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs index 576e5ca09..0dc826570 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Order_Detail.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using OpenRiaServices.Server; // Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. // If you have enabled NRTs for your project, then un-comment the following line: @@ -16,6 +17,8 @@ public partial class Order_Detail public float Discount { get; set; } public virtual Order Order { get; set; } + + [Include] public virtual Product Product { get; set; } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs index 2802a1bae..8f5bd5dbb 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Product.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using OpenRiaServices.Server; // Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. // If you have enabled NRTs for your project, then un-comment the following line: @@ -25,7 +26,9 @@ public Product() public short? ReorderLevel { get; set; } public bool Discontinued { get; set; } + [Include("CategoryName", "CategoryName")] public virtual Category Category { get; set; } + [Include("CompanyName", "SupplierName")] public virtual Supplier Supplier { get; set; } public virtual ICollection Order_Details { get; set; } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs index 9e808a3bc..bc8b2469b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/Northwind/Region.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using OpenRiaServices.Server; // Code scaffolded by EF Core assumes nullable reference types (NRTs) are not used or disabled. // If you have enabled NRTs for your project, then un-comment the following line: @@ -17,6 +19,8 @@ public Region() public int RegionID { get; set; } public string RegionDescription { get; set; } + [Composition] + [Include] public virtual ICollection Territories { get; set; } } } diff --git a/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj b/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj index 926474e35..7e74401a2 100644 --- a/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj +++ b/src/OpenRiaServices.Tools/Test/TestWap/TestWap.csproj @@ -108,7 +108,7 @@ - 4.5.3 + 4.5.4 From 7946d9f148f4af6e35ac70687d030e92caea35c7 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 4 May 2022 15:32:22 +0200 Subject: [PATCH 89/99] remove some unneeded references --- .../Test/OpenRiaServices.Server.Test.csproj | 1 - .../OpenRiaServices.Common.DomainServices.Test.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj index 8851f41d1..c8be1ba43 100644 --- a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj +++ b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj @@ -9,7 +9,6 @@ - diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj index 71a77456d..e85af90bc 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/OpenRiaServices.Common.DomainServices.Test.csproj @@ -31,7 +31,6 @@ - From 8ae297ff1bdcbf287e28307e464724d4150caec3 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Wed, 4 May 2022 15:33:25 +0200 Subject: [PATCH 90/99] remove "OldAssert" --- .../UnitTestBase.cs | 297 ------------------ 1 file changed, 297 deletions(-) diff --git a/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs b/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs index 8868d5143..9b4fa14e3 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.Test/UnitTestBase.cs @@ -33,303 +33,6 @@ protected UnitTestBase() { } - #region Assert nested class - - /// - /// This nested Assert class is a entry point to - /// the normal MSTest class. It is required because the MSTest version is SecurityCritical - /// and cannot be used from partial trust unit tests - /// - [SecuritySafeCritical] - [DebuggerStepThrough] - private static class OldAssert - { - // --- IsTrue --- - public static void IsTrue(bool condition) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsTrue(condition); - } - public static void IsTrue(bool condition, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsTrue(condition, message); - } - public static void IsTrue(bool condition, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsTrue(condition, message, parameters); - } - - // --- IsFalse --- - public static void IsFalse(bool condition, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsFalse(condition, message); - } - public static void IsFalse(bool condition) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsFalse(condition); - } - public static void IsFalse(bool condition, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsFalse(condition, message, parameters); - } - - // --- Inconclusive --- - public static void Inconclusive() - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Inconclusive(); - } - public static void Inconclusive(string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Inconclusive(message); - } - public static void Inconclusive(string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Inconclusive(message, parameters); - } - - // --- Fail --- - public static void Fail() - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Fail(); - } - public static void Fail(string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Fail(message); - } - public static void Fail(string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Fail(message, parameters); - } - - // --- IsInstanceOfType --- - public static void IsInstanceOfType(object instance, Type type) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsInstanceOfType(instance, type); - } - public static void IsInstanceOfType(object instance, Type type, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsInstanceOfType(instance, type, message); - } - public static void IsInstanceOfType(object instance, Type type, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsInstanceOfType(instance, type, message, parameters); - } - - // --- IsNotInstanceOfType --- - public static void IsNotInstanceOfType(object instance, Type type) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotInstanceOfType(instance, type); - } - public static void IsNotInstanceOfType(object instance, Type type, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotInstanceOfType(instance, type, message); - } - public static void IsNotInstanceOfType(object instance, Type type, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotInstanceOfType(instance, type, message, parameters); - } - - // --- IsNull --- - public static void IsNull(object instance) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNull(instance); - } - public static void IsNull(object instance, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNull(instance, message); - } - public static void IsNull(object instance, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNull(instance, message, parameters); - } - - // --- IsNotNull --- - public static void IsNotNull(object instance) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotNull(instance); - } - public static void IsNotNull(object instance, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotNull(instance, message); - } - public static void IsNotNull(object instance, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotNull(instance, message, parameters); - } - - // --- AreEqual --- - public static void AreEqual(object expected, object actual) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual); - } - public static void AreEqual(T expected, T actual) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual); - } - public static void AreEqual(T expected, T actual, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, message, parameters); - } - public static void AreEqual(double expected, double actual, double delta) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, delta); - } - public static void AreEqual(double expected, double actual, double delta, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, delta, message, parameters); - } - public static void AreEqual(float expected, float actual, float delta) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, delta); - } - public static void AreEqual(float expected, float actual, float delta, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, delta, message, parameters); - } - public static void AreEqual(object expected, object actual, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, message); - } - public static void AreEqual(string expected, string actual, bool ignoreCase) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, ignoreCase); - } - public static void AreEqual(string expected, string actual, bool ignoreCase, CultureInfo cultureInfo) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, ignoreCase, cultureInfo); - } - public static void AreEqual(string expected, string actual, bool ignoreCase, CultureInfo cultureInfo, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, ignoreCase, cultureInfo, message, parameters); - } - public static void AreEqual(string expected, string actual, bool ignoreCase, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, ignoreCase, message); - } - public static void AreEqual(T expected, T actual, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, message); - } - public static void AreEqual(double expected, double actual, double delta, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, delta, message); - } - public static void AreEqual(float expected, float actual, float delta, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, delta, message); - } - public static void AreEqual(object expected, object actual, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreEqual(expected, actual, message, parameters); - } - - // --- AreNotEqual --- - public static void AreNotEqual(object expected, object actual) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual); - } - public static void AreNotEqual(T expected, T actual) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual); - } - public static void AreNotEqual(T expected, T actual, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, message, parameters); - } - public static void AreNotEqual(double expected, double actual, double delta) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, delta); - } - public static void AreNotEqual(double expected, double actual, double delta, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, delta, message, parameters); - } - public static void AreNotEqual(float expected, float actual, float delta) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, delta); - } - public static void AreNotEqual(float expected, float actual, float delta, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, delta, message, parameters); - } - public static void AreNotEqual(object expected, object actual, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, message); - } - public static void AreNotEqual(string expected, string actual, bool ignoreCase) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, ignoreCase); - } - public static void AreNotEqual(string expected, string actual, bool ignoreCase, CultureInfo cultureInfo) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, ignoreCase, cultureInfo); - } - public static void AreNotEqual(string expected, string actual, bool ignoreCase, CultureInfo cultureInfo, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, ignoreCase, cultureInfo, message, parameters); - } - public static void AreNotEqual(string expected, string actual, bool ignoreCase, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, ignoreCase, message); - } - public static void AreNotEqual(T expected, T actual, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, message); - } - public static void AreNotEqual(double expected, double actual, double delta, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, delta, message); - } - public static void AreNotEqual(float expected, float actual, float delta, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, delta, message); - } - public static void AreNotEqual(object expected, object actual, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotEqual(expected, actual, message, parameters); - } - - // --- AreSame --- - public static void AreSame(object expected, object actual) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreSame(expected, actual); - } - public static void AreSame(object expected, object actual, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreSame(expected, actual, message); - } - public static void AreSame(object expected, object actual, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreSame(expected, actual, message, parameters); - } - - // --- AreNotSame --- - public static void AreNotSame(object expected, object actual) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotSame(expected, actual); - } - public static void AreNotSame(object expected, object actual, string message) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotSame(expected, actual, message); - } - public static void AreNotSame(object expected, object actual, string message, object[] parameters) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.AreNotSame(expected, actual, message, parameters); - } - - // --- Equals --- - public static new void Equals(object expected, object actual) - { - Microsoft.VisualStudio.TestTools.UnitTesting.Assert.Equals(expected, actual); - } - - // --- ReplaceNullChars --- - public static string ReplaceNullChars(string value) - { - return Microsoft.VisualStudio.TestTools.UnitTesting.Assert.ReplaceNullChars(value); - } - } - #endregion // Assert nested class - private Queue AsyncQueue { get From 255126c42e458266ac168fe56a8b628c50c90b39 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 5 May 2022 11:28:12 +0200 Subject: [PATCH 91/99] Fix some TODO and commented out code, checks IsOwned now in a number of places --- .../Framework/EFCoreDescriptionProvider.cs | 12 ++++------ .../Framework/EFCoreTypeDescriptor.cs | 23 +++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs index b0ee8d349..af5ca7747 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreDescriptionProvider.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; namespace OpenRiaServices.Server.EntityFrameworkCore @@ -35,18 +36,14 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom { // No need to deal with concurrency... Worst case scenario we have multiple // instances of this thing. - ICustomTypeDescriptor td = null; - if (!_descriptors.TryGetValue(objectType, out td)) + if (!_descriptors.TryGetValue(objectType, out ICustomTypeDescriptor td)) { // call into base so the TDs are chained parent = base.GetTypeDescriptor(objectType, parent); - // TODO: Check if ef model var model = _typeDescriptionContext.Model; if (model != null && model.FindEntityType(objectType.FullName) is IEntityType entityType) { - // TODO: ... - // only add an LTE TypeDescriptor if the type is an EF Entity or ComplexType td = new EFCoreTypeDescriptor(_typeDescriptionContext, entityType, parent); } else @@ -62,8 +59,9 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, ICustom public override bool LookupIsEntityType(Type type) { - // TODO: Check if ef model, need to double check it fails for non- entity types - return _typeDescriptionContext.GetEntityType(type) != null; + // EF6 excludes "complex objects" here so we exclude owned entities + return _typeDescriptionContext.GetEntityType(type) is IEntityType entityType + && !entityType.IsOwned(); } } } diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs index 2a39e2bac..34c606417 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs @@ -6,6 +6,7 @@ using Microsoft.EntityFrameworkCore; using System.Linq; using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; namespace OpenRiaServices.Server.EntityFrameworkCore { @@ -32,7 +33,9 @@ public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, _timestampProperty = timestampMembers[0]; } - // if (edmType.BuiltInTypeKind == BuiltInTypeKind.EntityType) + // TODO: determine if we should exclude owned entities just as EF6 excludes "complex objects" here + // Needs to add owned typ scenarios + if (!entityType.IsOwned()) { // if any FK member of any association is also part of the primary key, then the key cannot be marked // Editable(false) @@ -40,7 +43,6 @@ public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, .Where(n => n.IsDependentToPrincipal()) .SelectMany(n => n.ForeignKey.Properties) .ToDictionary(x => x.Name); - //this._foreignKeyMembers foreach (var key in entityType.GetKeys()) { @@ -64,10 +66,7 @@ public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, /// private static bool IsConcurrencyTimestamp(IProperty p) { - //IsConcurrencyTimestamp return p.IsConcurrencyToken - // && p.GetMaxLength() == 8 - // && p.IsFixedLength && p.ValueGenerated == ValueGenerated.OnAddOrUpdate; } @@ -97,10 +96,12 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor bool hasKeyAttribute = pd.Attributes[typeof(KeyAttribute)] != null; var property = _entityType.FindProperty(pd.Name); + // TODO: Review all usage of isEntity to validate if we should really copy logic from EF6 + bool isEntity = !_entityType.IsOwned(); if (property != null) { - if (property.IsPrimaryKey()) + if (isEntity && property.IsPrimaryKey() && !hasKeyAttribute) { attributes.Add(new KeyAttribute()); hasKeyAttribute = true; @@ -210,7 +211,8 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor } // Add AssociationAttribute if required for the specified property - if (_entityType.FindNavigation(pd.Name) is INavigation navigation) + if (isEntity + && _entityType.FindNavigation(pd.Name) is INavigation navigation) { bool isManyToMany = navigation.IsCollection() && navigation.FindInverse()?.IsCollection() == true; if (!isManyToMany) @@ -236,15 +238,12 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor /// True if the property should be excluded, false otherwise. internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) { - //TODO: remove this, EntityState is not part of entities - - // exclude EntityState members - if (pd.PropertyType == typeof(EntityState)) // TODO: Maybe also check pd.Component type + // exclude IChangeDetector.EntityState members + if (pd.PropertyType == typeof(EntityState) && typeof(IChangeDetector).IsAssignableFrom(pd.ComponentType)) { return true; } - return false; } } From 39acd06bc703262a893b64d5d29e8cf8e6ad1e48 Mon Sep 17 00:00:00 2001 From: Daniel Svensson Date: Thu, 5 May 2022 11:28:44 +0200 Subject: [PATCH 92/99] Use EfCore 3.1.24 --- .../OpenRiaServices.Server.EntityFrameworkCore.csproj | 4 ++-- .../Test/DbContextModel/EFCoreModels.csproj | 6 +++--- src/Test/WebsiteFullTrust/Web.config | 10 +++++----- src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj index 4dbccbfbf..a9f3dea2b 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/OpenRiaServices.Server.EntityFrameworkCore.csproj @@ -6,8 +6,8 @@ true - - + + diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj index 7df4a995e..222e18033 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Test/DbContextModel/EFCoreModels.csproj @@ -5,9 +5,9 @@ 1.0.0.0 - - - + + + diff --git a/src/Test/WebsiteFullTrust/Web.config b/src/Test/WebsiteFullTrust/Web.config index dba1d932d..06b90d78c 100644 --- a/src/Test/WebsiteFullTrust/Web.config +++ b/src/Test/WebsiteFullTrust/Web.config @@ -84,15 +84,15 @@ - + - + - + @@ -104,11 +104,11 @@ - + - + diff --git a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj index 3f5b53f2b..c3dada674 100644 --- a/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj +++ b/src/Test/WebsiteFullTrust/WebsiteFullTrust.csproj @@ -144,7 +144,7 @@ 6.4.4 - 3.1.20 + 3.1.24 6.0.0 From b671750d72c8ab65dfcf4d806a0687ca799239d7 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 9 May 2022 07:42:39 +0200 Subject: [PATCH 93/99] Remove pubilc update of resx --- .../Framework/OpenRiaServices.EntityFramework.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj index 8d18b7f28..fe68559a0 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj +++ b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj @@ -43,9 +43,5 @@ MetadataResource.Designer.cs System.Data.Mapping - - PublicResXFileCodeGenerator - Resource.Designer.cs - \ No newline at end of file From 6bc903543a7591cf0d99017a1f99eaa050e57976 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 9 May 2022 07:49:32 +0200 Subject: [PATCH 94/99] Remove net 472 --- .../Test/OpenRiaServices.Server.Test.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj index c8be1ba43..9c8746824 100644 --- a/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj +++ b/src/OpenRiaServices.Server/Test/OpenRiaServices.Server.Test.csproj @@ -4,9 +4,6 @@ $(DefineConstants);SERVERFX net472 - - True - From e01b3b20701a6cbb369243a923eb91b9678dd037 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 9 May 2022 08:30:23 +0200 Subject: [PATCH 95/99] Some sonarqube fixes --- .../Framework/DbDomainService.cs | 4 ++-- .../Data/DataContractSurrogateGeneratorTest.cs | 6 +++--- .../Framework/EFCoreTypeDescriptionContext.cs | 5 +++-- .../Data/DomainTypeDescriptionProvider.cs | 16 ++++++++-------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs index 309409a0f..0644aeab4 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs +++ b/src/OpenRiaServices.EntityFramework/Framework/DbDomainService.cs @@ -214,7 +214,7 @@ private async Task InvokeSaveChangesAsync(bool retryOnConflict, Cancellati operationConflictMap.Add(conflict, entry); } - await this.SetChangeSetConflictsAsync(operationConflictMap, cancellationToken); + await SetChangeSetConflictsAsync(operationConflictMap, cancellationToken); // Call out to any user resolve code and resubmit if all conflicts // were resolved @@ -252,7 +252,7 @@ private async Task InvokeSaveChangesAsync(bool retryOnConflict, Cancellati /// /// Map of conflicts to their corresponding operations entries. /// - private async Task SetChangeSetConflictsAsync(Dictionary operationConflictMap, CancellationToken cancellationToken) + private static async Task SetChangeSetConflictsAsync(Dictionary operationConflictMap, CancellationToken cancellationToken) { foreach (var conflictEntry in operationConflictMap) { diff --git a/src/OpenRiaServices.Hosting.Wcf/Test/Data/DataContractSurrogateGeneratorTest.cs b/src/OpenRiaServices.Hosting.Wcf/Test/Data/DataContractSurrogateGeneratorTest.cs index 0a6d8bde9..cb67a4fe3 100644 --- a/src/OpenRiaServices.Hosting.Wcf/Test/Data/DataContractSurrogateGeneratorTest.cs +++ b/src/OpenRiaServices.Hosting.Wcf/Test/Data/DataContractSurrogateGeneratorTest.cs @@ -591,10 +591,10 @@ public MockTypeDescriptionProvider(Func createProperty, ICus this._parent = parent; } - public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) + public override ICustomTypeDescriptor GetTypeDescriptor(Type type, object instance) { - ICustomTypeDescriptor parent = this._parent ?? base.GetTypeDescriptor(objectType, instance); - return new MockTypeDescriptor(objectType, parent, this._createProperty); + ICustomTypeDescriptor parent = this._parent ?? base.GetTypeDescriptor(type, instance); + return new MockTypeDescriptor(type, parent, this._createProperty); } private class MockTypeDescriptor : CustomTypeDescriptor diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs index a1febea41..2bd0a4753 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs @@ -14,7 +14,6 @@ namespace OpenRiaServices.Server.EntityFrameworkCore /// internal class EFCoreTypeDescriptionContext { - // private readonly Dictionary _associationMap = new Dictionary(); private readonly Type _contextType; private IModel _model; @@ -72,10 +71,12 @@ internal AssociationAttribute CreateAssociationAttribute(INavigation navigationP } var assocAttrib = new AssociationAttribute(fk.GetConstraintName(), thisKey, otherKey); - assocAttrib.IsForeignKey = navigationProperty.IsDependentToPrincipal(); // TODO: isForeignKey; + assocAttrib.IsForeignKey = IsForeignKey(navigationProperty); return assocAttrib; } + private static bool IsForeignKey(INavigation navigationProperty) => navigationProperty.IsDependentToPrincipal(); + /// /// Comma delimits the specified member name collection /// diff --git a/src/OpenRiaServices.Server/Framework/Data/DomainTypeDescriptionProvider.cs b/src/OpenRiaServices.Server/Framework/Data/DomainTypeDescriptionProvider.cs index a7c1ef169..f961b3c80 100644 --- a/src/OpenRiaServices.Server/Framework/Data/DomainTypeDescriptionProvider.cs +++ b/src/OpenRiaServices.Server/Framework/Data/DomainTypeDescriptionProvider.cs @@ -27,27 +27,27 @@ public DomainTypeDescriptionProvider(Type type, DomainServiceDescriptionProvider this._descriptionProvider = descriptionProvider; } - public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) + public override ICustomTypeDescriptor GetTypeDescriptor(Type type, object instance) { - if (objectType == null && instance != null) + if (type == null && instance != null) { - objectType = instance.GetType(); + type = instance.GetType(); } - if (this._type != objectType) + if (this._type != type) { // In inheritance scenarios, we might be called to provide a descriptor // for a derived Type. In that case, we just return base. - return base.GetTypeDescriptor(objectType, instance); + return base.GetTypeDescriptor(type, instance); } if (this._customTypeDescriptor == null) { // CLR, buddy class type descriptors - this._customTypeDescriptor = base.GetTypeDescriptor(objectType, instance); + this._customTypeDescriptor = base.GetTypeDescriptor(type, instance); // EF, any other custom type descriptors provided through DomainServiceDescriptionProviders. - this._customTypeDescriptor = this._descriptionProvider.GetTypeDescriptor(objectType, this._customTypeDescriptor); + this._customTypeDescriptor = this._descriptionProvider.GetTypeDescriptor(type, this._customTypeDescriptor); // initialize FK members AFTER our type descriptors have chained HashSet foreignKeyMembers = this.GetForeignKeyMembers(); @@ -68,7 +68,7 @@ public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object if (DomainTypeDescriptor.ShouldRegister(this._customTypeDescriptor, keyIsEditable, foreignKeyMembers)) { // Extend the chain with one more descriptor. - this._customTypeDescriptor = new DomainTypeDescriptor(objectType, this._customTypeDescriptor, keyIsEditable, foreignKeyMembers); + this._customTypeDescriptor = new DomainTypeDescriptor(type, this._customTypeDescriptor, keyIsEditable, foreignKeyMembers); } } From 2764ec6d450ea06160fce7406173cc3e29d51c71 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 9 May 2022 08:38:20 +0200 Subject: [PATCH 96/99] More sonarqube --- .../Framework/EFCoreTypeDescriptor.cs | 8 +++----- .../Northwind/EFCore_Northwind.cs | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs index 34c606417..63b8a0b6c 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs @@ -162,12 +162,10 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor bool isStringType = pd.PropertyType == typeof(string) || pd.PropertyType == typeof(char[]); if (isStringType && - pd.Attributes[typeof(StringLengthAttribute)] == null) + pd.Attributes[typeof(StringLengthAttribute)] == null && + property.GetMaxLength() is int maxLength) { - if (property.GetMaxLength() is int maxLength) - { - attributes.Add(new StringLengthAttribute(maxLength)); - } + attributes.Add(new StringLengthAttribute(maxLength)); } bool hasTimestampAttribute = pd.Attributes[typeof(TimestampAttribute)] != null; diff --git a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs index 678d1e8fd..0d4ac39e5 100644 --- a/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs +++ b/src/Test/Desktop/OpenRiaServices.Common.DomainServices.Test/Northwind/EFCore_Northwind.cs @@ -118,7 +118,7 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) case "ThrowDomainServiceEx": throw new DomainException("testing"); case "MergeIntoCurrent": - return this.ResolveProductWithMerge(entryInConflict); + return ResolveProductWithMerge(entryInConflict); case "KeepCurrent": // Client Wins RefreshClientWins(entryInConflict); @@ -148,7 +148,7 @@ private bool ResolveProductConflict(EntityEntry entryInConflict) } // Reset all properties to database values, except modified values which are keept - private void RefreshClientWins(EntityEntry entry) + private static void RefreshClientWins(EntityEntry entry) { PropertyValues dbValues = entry.GetDatabaseValues(); if (dbValues == null) @@ -166,7 +166,7 @@ private void RefreshClientWins(EntityEntry entry) } } - private bool ResolveProductWithMerge(EntityEntry entry) + private static bool ResolveProductWithMerge(EntityEntry entry) { // Keep a collection of all modified properties and their values. PropertyValues currentValues = entry.CurrentValues; From 4725e829f6397a94fc10ecd9d9ebeb8b32b1369f Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 6 May 2022 16:01:17 +0200 Subject: [PATCH 97/99] Better todo --- .../Framework/EFCoreTypeDescriptionContext.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs index 2bd0a4753..c0a7fe304 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptionContext.cs @@ -36,7 +36,7 @@ public IModel Model { if (_model == null) { - // TODO: Is there a smarter way ?? + // TODO: Investigate to use compiled models in future (compiled models are only availible in latest versions of ef core) var dbContext = (DbContext)Activator.CreateInstance(_contextType); _model = dbContext.Model; } From ef54e1a2ccc8bf1aeea8edd0ce7c60da73c3fca3 Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Fri, 6 May 2022 16:09:38 +0200 Subject: [PATCH 98/99] Fix todo --- .../Framework/EFCoreTypeDescriptor.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs index 63b8a0b6c..0255ce903 100644 --- a/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs +++ b/src/OpenRiaServices.Server.EntityFrameworkCore/Framework/EFCoreTypeDescriptor.cs @@ -19,7 +19,7 @@ internal class EFCoreTypeDescriptor : TypeDescriptorBase private readonly IEntityType _entityType; private readonly IProperty _timestampProperty; private readonly bool _keyIsEditable; - private Dictionary _foreignKeyMembers; // TODO: change to List / HashSet + private HashSet _foreignKeyMembers; public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, IEntityType entityType, ICustomTypeDescriptor parent) : base(parent) @@ -39,16 +39,16 @@ public EFCoreTypeDescriptor(EFCoreTypeDescriptionContext typeDescriptionContext, { // if any FK member of any association is also part of the primary key, then the key cannot be marked // Editable(false) - _foreignKeyMembers = entityType.GetNavigations() - .Where(n => n.IsDependentToPrincipal()) - .SelectMany(n => n.ForeignKey.Properties) - .ToDictionary(x => x.Name); + _foreignKeyMembers = new HashSet(entityType.GetNavigations() + .Where(n => n.IsDependentToPrincipal()) + .SelectMany(n => n.ForeignKey.Properties) + .Select(x => x.Name)); foreach (var key in entityType.GetKeys()) { foreach (var keyMember in key.Properties) { - if (_foreignKeyMembers.ContainsKey(keyMember.Name)) + if (IsForeignKeyMember(keyMember.Name)) { _keyIsEditable = true; break; @@ -190,9 +190,8 @@ protected override IEnumerable GetMemberAttributes(PropertyDescriptor // Add RTO to this member if required. If this type has a timestamp // member that member should be the ONLY member we apply RTO to. // Dont apply RTO if it is an association member. - bool isForeignKeyMember = _foreignKeyMembers != null && _foreignKeyMembers.ContainsKey(property.Name); if ((_timestampProperty == null || _timestampProperty == property) && - (inferRoundtripOriginalAttribute || isForeignKeyMember) && + (inferRoundtripOriginalAttribute || IsForeignKeyMember(property.Name)) && pd.Attributes[typeof(AssociationAttribute)] == null) { if (pd.Attributes[typeof(RoundtripOriginalAttribute)] == null) @@ -244,5 +243,7 @@ internal static bool ShouldExcludeEntityMember(PropertyDescriptor pd) return false; } + + private bool IsForeignKeyMember(string name) => _foreignKeyMembers != null && _foreignKeyMembers.Contains(name); } } From 9660204b0a72f0aff10faa63299c754dbbf44f7f Mon Sep 17 00:00:00 2001 From: Hugo Lindell Date: Mon, 9 May 2022 10:33:24 +0200 Subject: [PATCH 99/99] Remove debug constant --- .../Framework/OpenRiaServices.EntityFramework.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj index fe68559a0..b39a09ce6 100644 --- a/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj +++ b/src/OpenRiaServices.EntityFramework/Framework/OpenRiaServices.EntityFramework.csproj @@ -1,7 +1,7 @@  net472;net6.0 - $(DefineConstants);SERVERFX;DBCONTEXT;net472; + $(DefineConstants);SERVERFX;DBCONTEXT;