public static AssetMaintenanceAssetTypeDefaultSparePart CreateAssetMaintenanceAssetTypeDefaultSparePart(string dataAreaId,
                                                                                                                string maintenanceAssetTypeId,
                                                                                                                string productId,
                                                                                                                string modelProductId,
                                                                                                                string modelId,
                                                                                                                string itemId,
                                                                                                                global::System.DateTimeOffset validFrom,
                                                                                                                global::System.DateTimeOffset validTo,
                                                                                                                global::System.DateTimeOffset approvedDateTime,
                                                                                                                global::Microsoft.Dynamics.DataEntities.AssetMaintenanceAssetTypeDefault assetMaintenanceAssetTypeDefault)
        {
            AssetMaintenanceAssetTypeDefaultSparePart assetMaintenanceAssetTypeDefaultSparePart = new AssetMaintenanceAssetTypeDefaultSparePart();

            assetMaintenanceAssetTypeDefaultSparePart.dataAreaId             = dataAreaId;
            assetMaintenanceAssetTypeDefaultSparePart.MaintenanceAssetTypeId = maintenanceAssetTypeId;
            assetMaintenanceAssetTypeDefaultSparePart.ProductId        = productId;
            assetMaintenanceAssetTypeDefaultSparePart.ModelProductId   = modelProductId;
            assetMaintenanceAssetTypeDefaultSparePart.ModelId          = modelId;
            assetMaintenanceAssetTypeDefaultSparePart.ItemId           = itemId;
            assetMaintenanceAssetTypeDefaultSparePart.ValidFrom        = validFrom;
            assetMaintenanceAssetTypeDefaultSparePart.ValidTo          = validTo;
            assetMaintenanceAssetTypeDefaultSparePart.ApprovedDateTime = approvedDateTime;
            if ((assetMaintenanceAssetTypeDefault == null))
            {
                throw new global::System.ArgumentNullException("assetMaintenanceAssetTypeDefault");
            }
            assetMaintenanceAssetTypeDefaultSparePart.AssetMaintenanceAssetTypeDefault = assetMaintenanceAssetTypeDefault;
            return(assetMaintenanceAssetTypeDefaultSparePart);
        }
 partial void OnAssetMaintenanceAssetTypeDefaultChanging(global::Microsoft.Dynamics.DataEntities.AssetMaintenanceAssetTypeDefault value);